Пример #1
0
        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);
            }
        }
Пример #2
0
        //
        // 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);
        }
Пример #3
0
        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();

            }
        }
Пример #4
0
        /// <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);
        }
Пример #5
0
        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("操作成功");
        }
Пример #6
0
        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));
            }
        }
Пример #7
0
        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);
        }
Пример #8
0
        /// <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);

            }
        }
Пример #9
0
        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);
            }
        }
Пример #10
0
        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);
            }
        }
Пример #11
0
 public ActionResult AppView(int id)
 {
     using (LoveBankDBContext db = new LoveBankDBContext())
     {
         Notice notice = db.T_Notice.Find(id);
         return Json(notice);
     }
 }
Пример #12
0
 public ActionResult AppView(int id)
 {
     using (LoveBankDBContext db = new LoveBankDBContext())
     {
         WorkGuide work = db.T_WorkGuide.Find(id);
         return Json(work);
     }
 }
Пример #13
0
        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);
            }
        }
        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);
            }
        }
Пример #15
0
 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("操作成功");
     }
 }
Пример #16
0
        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();
        }
Пример #17
0
        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);
            }
        }
Пример #18
0
        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);
            }
        }
Пример #19
0
        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);
            }
        }
Пример #20
0
        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);
            }
        }
Пример #21
0
        public ActionResult Add()
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {
                //获取当前登录用户下的小区信息
                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();
        }
Пример #22
0
 public ActionResult Delete(int id)
 {
     using (LoveBankDBContext db = new LoveBankDBContext())
     {
         AppVer img = db.T_AppVer.Find(id);
         db.Delete<AppVer>(img);
         db.SaveChanges();
         db.Dispose();
         return Success("操作成功");
     }
 }
Пример #23
0
 public ActionResult Delete(int id)
 {
     using (LoveBankDBContext db = new LoveBankDBContext())
     {
         Notice notice = db.T_Notice.Find(id);
         db.Delete<Notice>(notice);
         db.SaveChanges();
         db.Dispose();
         return Success("操作成功");
     }
 }
Пример #24
0
        public ActionResult Add()
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {
                var t_d = db.T_Department;

                ////部门组织
                var list = t_d.Where(x =>x.Id.Contains("851")&& x.Level>=3 &&x.Level <= 4).ToList();
                ViewData["Department_List"] = HelpSerializer.JSONSerialize<List<Department>>(list);
                return View();
            }
        }
Пример #25
0
        public ActionResult ChangeStateAdImg(int id, int state)
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {
                AppVer img = db.T_AppVer.Find(id);

                img.State = state;
                db.Update<AppVer>(img);
                db.SaveChanges();
                db.Dispose();
                return Success("操作成功");
            }
        }
Пример #26
0
        public ActionResult Index(int? page, int? pageSize)
        {
            var pageNumber = page ?? 1;
            var size = pageSize ?? PageSize;
            using (LoveBankDBContext db = new LoveBankDBContext())
            {
                var app = db.T_AppVer;

                var list = from a in app select a;

                return View(list.OrderByDescending(x => x.Id).ToPagedList(pageNumber - 1, size));
            }
        }
Пример #27
0
        public ActionResult Add()
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {
                var t_a = db.T_LBStartOrBottomAd;
                var t_s = db.T_SourceFile;
                var t_d = db.T_Department;

                var list = t_d.Where(x => x.Level <= 6).ToList();
                ViewData["Department_List"] = HelpSerializer.JSONSerialize<List<Department>>(list);
            }

            return View();
        }
Пример #28
0
        public ActionResult AddTeamProjectStation()
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {
                var dep = db.T_Department;

                //部门组织
                //var list = DbProvider.D<Department>().Where(x => x.Level <= 6).ToList();
                var list = dep.Where(x => x.Level <= 6).ToList();
                ViewData["Department_List"] = HelpSerializer.JSONSerialize<List<Department>>(list);

                return View();
            }
        }
Пример #29
0
        public ActionResult Edit()
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {

                var t_wsn = db.T_UnitInfoAbout;
                UnitInfoAbout model = (from w in t_wsn where w.DeptId == AdminUser.DeptId select w).FirstOrDefault();
                if (model==null)
                {
                    model = new UnitInfoAbout();
                }
                return View(model);
            }
        }
Пример #30
0
        public ActionResult AddDetail(int unionHelpPojectID)
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {
                var t_d = db.T_Department;
                var t_u = db.T_UnionHelpPoject;

                UnionHelpPoject model = t_u.Find(unionHelpPojectID);

                ////部门组织
                var list = t_d.Where(x => x.Id.Contains("851") && x.Level >= 3 && x.Level <= 4).ToList();
                ViewData["Department_List"] = HelpSerializer.JSONSerialize<List<Department>>(list);
                return PartialView(model);
            }
        }