• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# MSData.LoveBankDBContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中LoveBank.Core.MSData.LoveBankDBContext的典型用法代码示例。如果您正苦于以下问题:C# LoveBankDBContext类的具体用法?C# LoveBankDBContext怎么用?C# LoveBankDBContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LoveBankDBContext类属于LoveBank.Core.MSData命名空间,在下文中一共展示了LoveBankDBContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Edit

        public ActionResult Edit(int id)
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {
                var t_a = db.T_InfoManage;
                var t_s = db.T_SourceFile;

                var model = (from a in t_a
                             where a.ID == id
                             select new InfoManageModel
                             {
                                 AddTime = a.AddTime,
                                 Title = a.Title,
                                 ID = a.ID,
                                 DeptId = a.DeptId,
                                 Desc = a.Desc,
                                 State = a.State,
                                 LinkUrl = a.LinkUrl,
                                 Contact = a.Contact,
                                 Phone = a.Phone,
                                 Type = a.Type,
                                 SourceFileList = t_s.Where(x => x.Guid == a.Guid).ToList()
                             }).SingleOrDefault();

                return View(model);
            }
        }
开发者ID:gowhy,项目名称:MicroWish,代码行数:27,代码来源:InfoManageController.cs


示例2: Index

        //
        // GET: /Product/
        public ActionResult Index(int page = 1, int pageSize =9)
        {
            var list = Task.Factory.StartNew<IPagedList<ProductModel>>(() =>
            {
                using (LoveBankDBContext db = new LoveBankDBContext())
                {

                    return GetProduct(page, pageSize);
                }
            });

            var listHot = Task.Factory.StartNew<List<ProductModel>>(() =>
            {
                using (LoveBankDBContext db = new LoveBankDBContext())
                {

                    return GetHotExchangProduct(page, 3);
                }
            });

            Task.WaitAll(list,listHot);

            LoveProductModel model = new LoveProductModel();
            model.ProductList = list.Result;
            model.ProductListHot = listHot.Result;

            return View(model);
        }
开发者ID:gowhy,项目名称:LoveBank,代码行数:30,代码来源:ProductController.cs


示例3: GetHotExchangProduct

        private List<ProductModel> GetHotExchangProduct(int page = 1, int pageSize = 8)
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {
                var tp = db.T_Product;
                var tpe = db.T_LoveBankProductExchangeLog;
                var t_s = db.T_SourceFile;
                var list = from pe in tpe
                           join p in tp on  pe.LoveBankProductId equals p.ID
                           where p.DeptId == BaseWebSiteConifg.DeptId && p.State != RowState.删除
                           select new ProductModel
                           {
                               CostScore = p.CostScore,
                               DeptId = p.DeptId,
                               Id = p.ID,
                               Name = p.Name,
                               Price = p.Price,
                               State = p.State,
                               ProductPic = (from s in t_s where s.Guid == p.Guid select new ImgUrlModel { ImgHttpUrl = s.Domain + s.Path }).ToList()

                           };
                return list.OrderByDescending(x => x.Id).ToPagedList(page-1, pageSize).ToList();

            }
        }
开发者ID:gowhy,项目名称:LoveBank,代码行数:25,代码来源:ProductController.cs


示例4: AppLogin

        /// <summary>
        /// App登录
        /// </summary>
        /// <param name="phone"></param>
        /// <param name="passWord"></param>
        /// <returns></returns>
        public ActionResult AppLogin(string phone,string passWord)
        {
            JsonMessage returnJson = new JsonMessage();
            using (LoveBankDBContext db = new LoveBankDBContext())
            {

                var t_a = db.T_AppUser;
                string passWordHash = passWord.Hash();
                AppUser appUser = db.T_AppUser.Where(x => x.Phone == phone && x.PassWord == passWordHash).FirstOrDefault();
                if (appUser != null)
                {
                    returnJson.Status = true;
                    appUser.PassWord = string.Empty;
                    returnJson.Data =
                        new
                        {
                            Ticket = AutheTicketManager.CreateAppLoginUserTicket(appUser.ID.ToString()),
                            User=appUser
                        };
                    returnJson.Info = "登录成功";
                    return Json(returnJson);
                }

            }
            returnJson.Status = false;
            returnJson.Info = "登录失败,系统异常";
            returnJson.Data = HttpContext.Error;
            return Json(returnJson);
        }
开发者ID:gowhy,项目名称:MicroWish,代码行数:35,代码来源:AppCommController.cs


示例5: AdminApply

        public ActionResult AdminApply(int id, int state, string msg)
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {

                Supervise model = db.T_Supervise.Find(id);

                var vol = db.T_Vol;
                Vol vEntity = vol.Find(model.AddUser);
                if (model.State != SuperviseRowState.已回复)
                {
                    vEntity.LoveBankScore = vEntity.LoveBankScore + 5;
                    db.Update<Vol>(vEntity);
                    db.SaveChanges();
                }

                model.Msg = msg.Trim();
                model.State = (SuperviseRowState)state;

                db.Update<Supervise>(model);
                db.SaveChanges();

                #region 发送通知信息
                //短信通知
                //string failMsg = "【社区1+1】您于" + model.AddTime.ToString("yyyy-MM-dd HH:mm") + "投诉的:" + model.Content + ".管理员处理,处理意见是:" + msg;
                SMSComm.Send(vEntity.Phone, "【社区1+1】您于" + model.AddTime.ToString("yyyy-MM-dd HH:mm") + "反映的问题我们将尽快核实处理,感谢您的参与.");

                //App 推送通知待完善

                #endregion
            }

            return Success("操作成功");
        }
开发者ID:gowhy,项目名称:LoveBank,代码行数:34,代码来源:LBTSController.cs


示例6: Index

        public ActionResult Index(int? page, int? pageSize)
        {
            var pageNumber = page ?? 1;
            var size = pageSize ?? PageSize;

            using (LoveBankDBContext db = new LoveBankDBContext())
            {

                var ad = db.T_LoveBank_Ad;

                var t_d = db.T_Department;

                var list = from a in ad
                           select new LoveBank_AdModel
                           {

                               AddTime = a.AddTime,
                               Title = a.Title,
                               ID = a.ID,
                               DeptId = a.DeptId,
                               Desc = a.Desc,
                               State = a.State,
                               LinkUrl = a.LinkUrl,
                               Postion = a.Postion,

                           };

                list = list.Where(x => x.State != RowState.删除);

                return View(list.OrderByDescending(x => x.ID).ToPagedList(pageNumber - 1, size));
            }
        }
开发者ID:gowhy,项目名称:MicroWish,代码行数:32,代码来源:LoveBank_AdController.cs


示例7: AppPostAddSuggestion

        public ActionResult AppPostAddSuggestion(Suggestion entity)
        {
            JsonMessage retJson = new JsonMessage();

            using (LoveBankDBContext db = new LoveBankDBContext())
            {

                if (entity.AddUser>0)
                {
                      var addUserModel = (from v in db.T_Vol where v.ID == entity.AddUser select new { v.DepId, v.Phone, v.RealName }).FirstOrDefault();

                      entity.DepId = addUserModel.DepId;
                      entity.AddUserName = addUserModel.RealName;
                      entity.AddUserPhone = addUserModel.Phone;
                }

                entity.AddTime = DateTime.Now;
                db.Add<Suggestion>(entity);
                db.SaveChanges();

                retJson.Status = true;
                retJson.Info = "新增成功";
            }
            return Json(retJson);
        }
开发者ID:gowhy,项目名称:LoveBank,代码行数:25,代码来源:AppCommController.cs


示例8: AppPostHelperMoney

        /// <summary>
        /// 必传参数
        /// AppUserId/
        /// SeekHelperId/
        /// Money:捐助的金额
        /// BankCard:支付卡号
        /// Desc:捐赠寄语
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public ActionResult AppPostHelperMoney(SeekHelperRecorde entity)
        {
            JsonMessage ret = new JsonMessage();

            entity.AddTime = DateTime.Now;

            using (LoveBankDBContext db = new LoveBankDBContext())
            {
                var t_a = db.T_SeekHelper;
                var t_sr = db.T_SeekHelperRecorde;
                var t_u = db.T_AppUser; ;

                //SeekHelper sh = t_a.Find(entity.SeekHelperId);
                AppUser au = t_u.Find(entity.AppUserId);

                entity.Name = au.Name;
                entity.Phone = au.Phone;
                entity.AppUserType = au.Type;

                db.Add(entity);
                db.SaveChanges();
                ret.Status = true;
                ret.Info = "捐助成功";
                return Json(ret);

            }
        }
开发者ID:gowhy,项目名称:MicroWish,代码行数:37,代码来源:SeekHelperController.cs


示例9: Edit

        public ActionResult Edit(int id)
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {
                var t_a = db.T_LBStartOrBottomAd;
                var t_s = db.T_SourceFile;
                var t_d = db.T_Department;

                var model = (from a in t_a
                             join d in t_d on a.DeptId equals d.Id
                             where a.ID == id
                             select new LBStartOrBottomAdModel
                             {
                                 AddTime = a.AddTime,
                                 Department = d,
                                 Title = a.Title,
                                 ID = a.ID,
                                 DeptId = a.DeptId,
                                 Desc = a.Desc,
                                 State = a.State,
                                 Postion=a.Postion,
                                 LinkUrl = a.LinkUrl,
                                 SourceFileList = t_s.Where(x => x.Guid == a.Guid).ToList()
                             }).SingleOrDefault();

                var list = t_d.Where(x => x.Level <= 6).ToList();
                ViewData["Department_List"] = HelpSerializer.JSONSerialize<List<Department>>(list);
                return View(model);
            }
        }
开发者ID:gowhy,项目名称:LoveBank,代码行数:30,代码来源:LBStartOrBottomAdController.cs


示例10: AppPostTSAdd

        public ActionResult AppPostTSAdd(Supervise entity)
        {
            JsonMessage retJson = new JsonMessage();
            try
            {

                using (LoveBankDBContext db = new LoveBankDBContext())
                {
                    entity.AddTime = DateTime.Now;
                    db.Add(entity);
                    db.SaveChanges();

                    retJson.Status = true;
                    retJson.Info = "新增成功";
                }
                return Json(retJson);
            }
            catch (Exception ex)
            {
                retJson.Status = false;
                retJson.Data = ex.Message + ex.TargetSite;

                return Json(retJson);
            }
        }
开发者ID:gowhy,项目名称:LoveBank,代码行数:25,代码来源:AppCommController.cs


示例11: AppView

 public ActionResult AppView(int id)
 {
     using (LoveBankDBContext db = new LoveBankDBContext())
     {
         Notice notice = db.T_Notice.Find(id);
         return Json(notice);
     }
 }
开发者ID:gowhy,项目名称:LoveBank,代码行数:8,代码来源:LBNoticeController.cs


示例12: AppView

 public ActionResult AppView(int id)
 {
     using (LoveBankDBContext db = new LoveBankDBContext())
     {
         WorkGuide work = db.T_WorkGuide.Find(id);
         return Json(work);
     }
 }
开发者ID:gowhy,项目名称:LoveBank,代码行数:8,代码来源:LBWorkGuideController.cs


示例13: Edit

        public ActionResult Edit(int id)
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {
                var dep = db.T_Department;
                var grid = db.T_GridMember;

                var glist =( from g in grid
                            //join d in dep on g.VDeptId equals d.Id
                            where g.Id==id
                            select new GridMemberModel
                            {

                                Desc = g.Desc,
                                VDeptId = g.VDeptId,
                                GridNo = g.GridNo,
                                GridPhone = g.GridPhone,
                                GridName = g.GridName,
                                GridHeaderImg = g.GridHeaderImg,
                                DeptId = g.DeptId,
                                Id = g.Id
                            }).FirstOrDefault();

                //glist.VDeptName = dep.Where(x => glist.VDeptId.IndexOf(x.Id+",") > -1).FirstOrDefault().Name;

                var depNameList = (from d in dep where d.PId.IndexOf(AdminUser.DeptId) > -1 select d).ToList();

                if (glist != null && !string.IsNullOrEmpty(glist.VDeptId))
                    {
                        foreach (var item2 in glist.VDeptId.Split(','))
                        {
                            string tmp = (depNameList.FirstOrDefault(x => x.Id == item2) ?? new Department()).Name;
                            if (!string.IsNullOrEmpty(tmp))
                            {
                                glist.VDeptName += tmp + ",";
                            }
                        }
                    }

                #region    //恢复图片数组
                SourceFile sf = new SourceFile();
                sf.Id = glist.Id+DateTime.Now.Millisecond;

                Uri uri = new Uri(glist.GridHeaderImg);
                sf.Domain =uri.Scheme+ "://"+uri.Authority;
                sf.Path = uri.LocalPath;
                sf.FileName = uri.Segments[3];

                glist.SourceFileList = new List<SourceFile>();
                glist.SourceFileList.Add(sf);
                #endregion

                //获取当前登录用户下的小区信息
                var list = db.T_Department.AsQueryable<Department>().Where(x => x.Level == 7 && x.PId == AdminUser.DeptId).ToList();
                ViewData["Department_List"] = HelpSerializer.JSONSerialize<List<Department>>(list);
                return View(glist);
            }
        }
开发者ID:gowhy,项目名称:LoveBank,代码行数:58,代码来源:LBGridMemberController.cs


示例14: Edit

        public ActionResult Edit(int id)
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {

                var t_wsn = db.T_ConvenienceServices;
                ConvenienceServices model = t_wsn.Find(id);
                return View(model);
            }
        }
开发者ID:gowhy,项目名称:LoveBank,代码行数:10,代码来源:ConvenienceServicesController.cs


示例15: Delete

 public ActionResult Delete(int id)
 {
     using (LoveBankDBContext db = new LoveBankDBContext())
     {
         AdminUser user = db.T_AdminUser.Find(id);
         db.Delete<AdminUser>(user);
         db.SaveChanges();
         return Success("操作成功");
     }
 }
开发者ID:gowhy,项目名称:MicroWish,代码行数:10,代码来源:AdminController.cs


示例16: Add

        public ActionResult Add()
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {
                var list = db.T_Department.AsQueryable<Department>().Where(x => x.Level <= 6).ToList();
                ViewData["Department_List"] = HelpSerializer.JSONSerialize<List<Department>>(list);
            }

            return View();
        }
开发者ID:gowhy,项目名称:LoveBank,代码行数:10,代码来源:LBNoticeController.cs


示例17: Edit

        public ActionResult Edit(int id)
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {

                var t_wsn = db.T_LoveFund;
                LoveFund model = t_wsn.Find(id);
                return View(model);
            }
        }
开发者ID:gowhy,项目名称:LoveBank,代码行数:10,代码来源:LoveFundController.cs


示例18: Edit

        public ActionResult Edit(int id)
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {

                var t_wsn = db.T_CServiceCenterInfo;
                CServiceCenterInfo model = t_wsn.Find(id);
                return View(model);
            }
        }
开发者ID:gowhy,项目名称:LoveBank,代码行数:10,代码来源:CServiceCenterInfoController.cs


示例19: Edit

        public ActionResult Edit(int id)
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {

                var t_wsn = db.T_IncomeAndPayDetail;
                IncomeAndPayDetail model = t_wsn.Find(id);
                return View(model);
            }
        }
开发者ID:gowhy,项目名称:LoveBank,代码行数:10,代码来源:IncomeAndPayDetailController.cs


示例20: Edit

        public ActionResult Edit(int id)
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {

                var t_wsn = db.T_WebSitNotice;
                WebSitNotice model = t_wsn.Find(id);
                return View(model);
            }
        }
开发者ID:gowhy,项目名称:LoveBank,代码行数:10,代码来源:WebSitNoticeController.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Common.BitArrayInputStream类代码示例发布时间:2022-05-26
下一篇:
C# Models.User类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap