当前位置: 首页>>代码示例>>C#>>正文


C# Repository.Gets方法代码示例

本文整理汇总了C#中Repository.Gets方法的典型用法代码示例。如果您正苦于以下问题:C# Repository.Gets方法的具体用法?C# Repository.Gets怎么用?C# Repository.Gets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Repository的用法示例。


在下文中一共展示了Repository.Gets方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeleteEducation

 public void DeleteEducation()
 {
     var repo = new Repository<EducationModel>(DbCollection.Education);
     var contacts = repo.Gets().Where(m => m.UserId == "5709a5b24a549a1a9873a19b");
     foreach (var item in contacts)
     {
         repo.Delete(item.Id);
     }
 }
开发者ID:xuantranm,项目名称:DigitalMarket,代码行数:9,代码来源:Common.cs

示例2: AddCountryHelper

        public static bool AddCountryHelper(CountryModel model)
        {
            var repo = new Repository<CountryModel>(DbCollection.Country);
            if (repo.Gets().Any(m => m.Name.Equals(model.Name)))
            {
                return false;
            }

            repo.Insert(model);
            return true;
        }
开发者ID:xuantranm,项目名称:DigitalMarket,代码行数:11,代码来源:Helper.cs

示例3: DownloadAlonhadat

        public FileResult DownloadAlonhadat()
        {
            var repo = new Repository<AlonhadatReport>("alonhadatreports");
            var data = repo.Gets().OrderBy(i => i.Date);
            var csv = new StringBuilder();
            csv.AppendLine("Date,Vip1,Vip2,Vip3,Vip4,Vip5,Basic,Total");

            foreach (var item in data)
            {
                csv.AppendLine(item.Csv);
            }
            return File(new System.Text.UTF8Encoding().GetBytes(csv.ToString()), "text/csv", "alonhadat.com.vn.csv");
        }
开发者ID:xuantranm,项目名称:MbndServices,代码行数:13,代码来源:ListingController.cs

示例4: Batdongsan

 public JsonResult Batdongsan()
 {
     var repo = new Repository<BdsReport>("bdsreports");
     return Json(repo.Gets().OrderBy(i => i.Date).Select(i => new
     {
         date = TimeZoneInfo.ConvertTimeToUtc(i.Date, TimeZoneInfo.Local).ToShortDateString() + " (" + i.Count + ")",
         count = i.Count,
         specialvip = i.SpecialVip,
         vip1 = i.Vip1,
         vip2 = i.Vip2,
         vip3 = i.Vip3,
         basic = i.Basic
     }), JsonRequestBehavior.AllowGet);
 }
开发者ID:xuantranm,项目名称:MbndServices,代码行数:14,代码来源:ListingController.cs

示例5: Diaoconline

 public JsonResult Diaoconline()
 {
     var repo = new Repository<DiaOcOnlineReport>("diaoconlinereports");
     return Json(repo.Gets().OrderBy(i => i.Date).Select(i => new
     {
         date = TimeZoneInfo.ConvertTimeToUtc(i.Date, TimeZoneInfo.Local).ToShortDateString() + " (" + i.Count + ")",
         count = i.Count,
         vip = i.Vip,
         tietkiem = i.TietKiem,
         tienloi = i.TienLoi,
         hieuqua = i.HieuQua,
         basic = i.Basic
     }), JsonRequestBehavior.AllowGet);
 }
开发者ID:xuantranm,项目名称:MbndServices,代码行数:14,代码来源:ListingController.cs

示例6: Cafeland

 public JsonResult Cafeland()
 {
     var repo = new Repository<CafelandReport>("cafelandreports");
     return Json(repo.Gets().OrderBy(i => i.Date).Select(i => new
     {
         date = TimeZoneInfo.ConvertTimeToUtc(i.Date, TimeZoneInfo.Local).ToShortDateString() + " (" + i.Count + ")",
         count = i.Count,
         supervip = i.SuperVip,
         vip1 = i.Vip1,
         vip2 = i.Vip2,
         vip3 = i.Vip3,
         basic = i.Basic
     }), JsonRequestBehavior.AllowGet);
 }
开发者ID:xuantranm,项目名称:MbndServices,代码行数:14,代码来源:ListingController.cs

示例7: Alonhadat

 public JsonResult Alonhadat()
 {
     var repo = new Repository<AlonhadatReport>("alonhadatreports");
     return Json(repo.Gets().OrderBy(i => i.Date).Select(i => new
     {
         date = TimeZoneInfo.ConvertTimeToUtc(i.Date, TimeZoneInfo.Local).ToShortDateString() + " (" + i.Count + ")",
         count = i.Count,
         vip1 = i.Vip1,
         vip2 = i.Vip2,
         vip3 = i.Vip3,
         vip4 = i.Vip4,
         vip5 = i.Vip5,
         basic = i.Basic
     }), JsonRequestBehavior.AllowGet);
 }
开发者ID:xuantranm,项目名称:MbndServices,代码行数:15,代码来源:ListingController.cs

示例8: FixErrorDefaultData

 public void FixErrorDefaultData()
 {
     var repo = new Repository<UserModel>(DbCollection.User);
     var repoShare = new Repository<ShareSettingModel>(DbCollection.ShareSetting);
     var users = repo.Gets().ToList();
     Console.WriteLine("BEGIN INSERT MISSING DATA...");
     foreach (var user in users)
     {
         Console.WriteLine("CHECK ShareSetting: " + user.UserName);
         var shareSetting = repoShare.Gets().FirstOrDefault(m => m.UserId.Equals(user.Id.ToString()));
         if (shareSetting == null)
         {
             Console.WriteLine("BEGIN INSERT ShareSetting: " + user.UserName);
             repoShare.Insert(new ShareSettingModel { UserId = user.Id.ToString() });
         }
     }
     Console.WriteLine("DONE!!!!");
     Console.ReadLine();
 }
开发者ID:xuantranm,项目名称:DigitalMarket,代码行数:19,代码来源:Common.cs

示例9: Create

        public ActionResult Create(AdminSetting model)
        {
            try
            {
                var repo = new Repository<AdminSetting>(DbCollection.AdminSetting);
                var item = repo.Gets().FirstOrDefault(m => m.Title.Equals(model.Title));
                if (item == null)
                {
                    model.Enable = true;
                    repo.Insert(model);
                    return RedirectToAction("Index");
                }
                else
                {
                    return Json(new { result = MyConstants.Duplicate });
                }

            }
            catch
            {
                return View();
            }
        }
开发者ID:xuantranm,项目名称:DigitalMarket,代码行数:23,代码来源:AdminSettingController.cs

示例10: TranslationMainLanguagePair

        //[ValidateAntiForgeryToken]
        public ActionResult TranslationMainLanguagePair(ProfileTranslationViewModel model)
        {
            var repo = new Repository<ProfileLanguageModel>(DbCollection.ProfileLanguage);
            var listItem = repo.Gets().Where(m => m.AccountId.Equals(User.Identity.GetUserId()) && m.Type.Equals(1)).ToList();
            foreach (var profileLanguageModel in listItem)
            {
                repo.Delete(profileLanguageModel.Id);
            }
            foreach (var item in model.ProfileLanguageList)
            {
                item.AccountId = User.Identity.GetUserId();
                item.Type = 1;
                repo.Insert(item);
            }
            if (string.IsNullOrEmpty(model.SourceOther) || string.IsNullOrEmpty(model.TargetOther))
                return Json(new {result = true, model});

            var other = new ProfileLanguageModel
            {
                AccountId = User.Identity.GetUserId(),
                Type = 1,
                SourceLanguage = model.SourceOther,
                TargetLanguage = model.TargetOther,
            };
            repo.Insert(other);

            return Json(new { result = true, model });
        }
开发者ID:xuantranm,项目名称:DigitalMarket,代码行数:29,代码来源:ManageController.cs

示例11: TranslationBestRate

        public ActionResult TranslationBestRate(ProfileTranslationViewModel model)
        {
            var repo = new Repository<ProfileTranslationRateModel>(DbCollection.ProfileTranslationRate);
            var item = repo.Gets().FirstOrDefault(m => m.Id.Equals(model.ProfileRate.Id));
            if (item != null)
            {
                item.MinRatePerSourceWord = model.ProfileRate.MinRatePerSourceWord;
                item.PreferredRatePerSourceWord = model.ProfileRate.PreferredRatePerSourceWord;
                item.MinRatePerHour = model.ProfileRate.MinRatePerHour;
                item.PreferredRatePerHour = model.ProfileRate.PreferredRatePerHour;
                repo.Update(item);
            }
            else
            {
                item = new ProfileTranslationRateModel
                {
                    AccountId = User.Identity.GetUserId(),
                    MinRatePerSourceWord = model.ProfileRate.MinRatePerSourceWord,
                    PreferredRatePerSourceWord = model.ProfileRate.PreferredRatePerSourceWord,
                    MinRatePerHour = model.ProfileRate.MinRatePerHour,
                    PreferredRatePerHour = model.ProfileRate.PreferredRatePerHour,
                };
                repo.Insert(item);
            }

            return Json(new { result = true, model });
        }
开发者ID:xuantranm,项目名称:DigitalMarket,代码行数:27,代码来源:ManageController.cs

示例12: TranslationBestRateLoad

 public ActionResult TranslationBestRateLoad()
 {
     var repo = new Repository<ProfileTranslationRateModel>(DbCollection.ProfileTranslationRate);
     var item = repo.Gets().Where(m => m.AccountId.Equals(User.Identity.GetUserId())).OrderByDescending(i => i.Id).FirstOrDefault() ??
                new ProfileTranslationRateModel();
     var model = new ProfileTranslationViewModel
     {
         ProfileRate = item
     };
     return PartialView("_ProfileTranslationRateLoadPartial", model);
 }
开发者ID:xuantranm,项目名称:DigitalMarket,代码行数:11,代码来源:ManageController.cs

示例13: TranslationTool

 public ActionResult TranslationTool()
 {
     var repo = new Repository<ProfileToolModel>(DbCollection.ProfileTool);
     var listItem = repo.Gets().Where(m => m.AccountId.Equals(User.Identity.GetUserId()) && m.Type.Equals(1) & m.ToolId != null).ToList();
     var itemOrther = repo.Gets().FirstOrDefault(m => m.AccountId.Equals(User.Identity.GetUserId()) && m.Type.Equals(1) & m.Tool == null) ??
                new ProfileToolModel();
     var repoTool = new Repository<ToolModel>(DbCollection.Tool);
     var listTool = repoTool.Gets().ToList();
     var model = new ProfileTranslationViewModel
     {
         ProfileToolList = listItem,
         ToolList = listTool,
         ExpertiseOther = itemOrther.Tool
     };
     return PartialView("_ProfileTranslationToolPartial", model);
 }
开发者ID:xuantranm,项目名称:DigitalMarket,代码行数:16,代码来源:ManageController.cs

示例14: Index

 // GET: SettingAdmin
 public ActionResult Index()
 {
     var repo = new Repository<AdminSetting>(DbCollection.AdminSetting);
     var listItem = repo.Gets().ToList();
     return View(listItem);
 }
开发者ID:xuantranm,项目名称:DigitalMarket,代码行数:7,代码来源:AdminSettingController.cs

示例15: LoadContact

        public JsonResult LoadContact()
        {
            String searc = Request.QueryString["search[value]"];
           var repo = new Repository<ContactMarkettingModel>("contactMarketting");
            var datax = repo.Gets().Select(i => new
            {

                name = i.Name,
                objecttitle = i.ObjectTitle,
                tel = i.Tel,
                email = i.Email,
                date = i.date
            });
            JsonPage page=new JsonPage();
            String pageindex=   Request.QueryString["draw"];
            int pagesize = 10;
            page.recordsTotal = datax.ToList().Count;



            page.recordsFiltered = datax.ToList().Count;
            page.draw = int.Parse(pageindex);
            String lg = Request.QueryString["length"];
            String begin = Request.QueryString["start"];
            datax = datax.Skip(int.Parse(begin)).Take(int.Parse(lg));
            page.data = datax;


            var data = Json(page, JsonRequestBehavior.AllowGet);



            return data;

        }
开发者ID:xuantranm,项目名称:MbndServices,代码行数:35,代码来源:ContactMakettingController.cs


注:本文中的Repository.Gets方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。