Ejemplo n.º 1
0
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Customerservice model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Customerservice>();

            if (!model.ServiceName.IsNullOrEmpty())
            {
                insert.Insert(p => p.ServiceName == model.ServiceName);
            }
            if (!model.ServicePwd.IsNullOrEmpty())
            {
                insert.Insert(p => p.ServicePwd == model.ServicePwd);
            }
            if (!model.IsService.IsNullOrEmpty())
            {
                insert.Insert(p => p.IsService == model.IsService);
            }
            if (!model.ServiceQQ.IsNullOrEmpty())
            {
                insert.Insert(p => p.ServiceQQ == model.ServiceQQ);
            }
            if (!model.ServiceWechat.IsNullOrEmpty())
            {
                insert.Insert(p => p.ServiceWechat == model.ServiceWechat);
            }
            if (!model.ServiceALWW.IsNullOrEmpty())
            {
                insert.Insert(p => p.ServiceALWW == model.ServiceALWW);
            }
            if (!model.ServicePhone.IsNullOrEmpty())
            {
                insert.Insert(p => p.ServicePhone == model.ServicePhone);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
Ejemplo n.º 2
0
 public CustomerserviceInfo(Customerservice Customerservice)
 {
     this.Id            = Customerservice.Id;
     this.ServiceName   = Customerservice.ServiceName;
     this.ServiceQQ     = Customerservice.ServiceQQ;
     this.ServicePhone  = Customerservice.ServicePhone;
     this.ServiceWechat = Customerservice.ServiceWechat;
     this.ServiceALWW   = Customerservice.ServiceALWW;
     this.IsService     = Customerservice.IsService == true ? "工作中": "繁忙";
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 根据Id修改
 /// </summary>
 /// <param name="Id">客服Id</param>
 /// <returns></returns>
 public string UpdateModel(Customerservice model)
 {
     if (CustomerserviceOper.Instance.Update(model))
     {
         return("成功!");
     }
     else
     {
         return("插入失败!");
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 根据Id插入
 /// </summary>
 /// <param name="Id">客服Id</param>
 /// <returns></returns>
 public string InsertModel(Customerservice model)
 {
     if (CustomerserviceOper.Instance.Insert(model))
     {
         return("成功!");
     }
     else
     {
         return("插入失败!");
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// 根据模型删除数据
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public bool DeleteModel(Customerservice model = null, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var delete = new LambdaDelete <Customerservice>();

            if (model != null)
            {
                if (!model.Id.IsNullOrEmpty())
                {
                    delete.Where(p => p.Id == model.Id);
                }
                if (!model.ServiceName.IsNullOrEmpty())
                {
                    delete.Where(p => p.ServiceName == model.ServiceName);
                }
                if (!model.ServicePwd.IsNullOrEmpty())
                {
                    delete.Where(p => p.ServicePwd == model.ServicePwd);
                }
                if (!model.IsService.IsNullOrEmpty())
                {
                    delete.Where(p => p.IsService == model.IsService);
                }
                if (!model.ServiceQQ.IsNullOrEmpty())
                {
                    delete.Where(p => p.ServiceQQ == model.ServiceQQ);
                }
                if (!model.ServiceWechat.IsNullOrEmpty())
                {
                    delete.Where(p => p.ServiceWechat == model.ServiceWechat);
                }
                if (!model.ServiceALWW.IsNullOrEmpty())
                {
                    delete.Where(p => p.ServiceALWW == model.ServiceALWW);
                }
                if (!model.ServicePhone.IsNullOrEmpty())
                {
                    delete.Where(p => p.ServicePhone == model.ServicePhone);
                }
            }
            return(delete.GetDeleteResult(connection, transaction));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 数据条数
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>对象列表</returns>
        public int SelectCount(Customerservice model = null, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var query = new LambdaQuery <Customerservice>();

            if (model != null)
            {
                if (!model.Id.IsNullOrEmpty())
                {
                    query.Where(p => p.Id == model.Id);
                }
                if (!model.ServiceName.IsNullOrEmpty())
                {
                    query.Where(p => p.ServiceName == model.ServiceName);
                }
                if (!model.ServicePwd.IsNullOrEmpty())
                {
                    query.Where(p => p.ServicePwd == model.ServicePwd);
                }
                if (!model.IsService.IsNullOrEmpty())
                {
                    query.Where(p => p.IsService == model.IsService);
                }
                if (!model.ServiceQQ.IsNullOrEmpty())
                {
                    query.Where(p => p.ServiceQQ == model.ServiceQQ);
                }
                if (!model.ServiceWechat.IsNullOrEmpty())
                {
                    query.Where(p => p.ServiceWechat == model.ServiceWechat);
                }
                if (!model.ServiceALWW.IsNullOrEmpty())
                {
                    query.Where(p => p.ServiceALWW == model.ServiceALWW);
                }
                if (!model.ServicePhone.IsNullOrEmpty())
                {
                    query.Where(p => p.ServicePhone == model.ServicePhone);
                }
            }
            return(query.GetQueryCount(connection, transaction));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 筛选全部数据不是这个用户
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>对象列表</returns>
        public List <Customerservice> SelectAllNotThisService(Customerservice model = null, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var query = new LambdaQuery <Customerservice>();

            if (model != null)
            {
                if (!model.Id.IsNullOrEmpty())
                {
                    query.Where(p => p.Id != model.Id);
                }

                if (!model.ServiceName.IsNullOrEmpty())
                {
                    query.Where(p => p.ServiceName == model.ServiceName);
                }
                if (!model.IsService.IsNullOrEmpty())
                {
                    query.Where(p => p.IsService == model.IsService);
                }
            }
            return(query.GetQueryList(connection, transaction));
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 根据模型更新
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public bool Update(Customerservice model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var update = new LambdaUpdate <Customerservice>();

            if (!model.Id.IsNullOrEmpty())
            {
                update.Where(p => p.Id == model.Id);
            }
            if (!model.ServiceName.IsNullOrEmpty())
            {
                update.Set(p => p.ServiceName == model.ServiceName);
            }
            if (!model.ServicePwd.IsNullOrEmpty())
            {
                update.Set(p => p.ServicePwd == model.ServicePwd);
            }
            if (!model.IsService.IsNullOrEmpty())
            {
                update.Set(p => p.IsService == model.IsService);
            }
            if (!model.ServiceQQ.IsNullOrEmpty())
            {
                update.Set(p => p.ServiceQQ == model.ServiceQQ);
            }
            if (!model.ServiceWechat.IsNullOrEmpty())
            {
                update.Set(p => p.ServiceWechat == model.ServiceWechat);
            }
            if (!model.ServiceALWW.IsNullOrEmpty())
            {
                update.Set(p => p.ServiceALWW == model.ServiceALWW);
            }
            if (!model.ServicePhone.IsNullOrEmpty())
            {
                update.Set(p => p.ServicePhone == model.ServicePhone);
            }
            return(update.GetUpdateResult(connection, transaction));
        }
Ejemplo n.º 9
0
 /// <summary>
 /// 筛选全部数据
 /// </summary>
 /// <param name="model">模型</param>
 /// <returns>对象列表</returns>
 public List <Customerservice> SelectByModel(Customerservice model)
 {
     return(CustomerserviceOper.Instance.SelectAll(model));
 }
Ejemplo n.º 10
0
 /// <summary>
 /// 数据条数
 /// </summary>
 /// <param name="model">模型</param>
 /// <returns>对象列表</returns>
 public int SelectCount(Customerservice model)
 {
     return(CustomerserviceOper.Instance.SelectCount(model));
 }
Ejemplo n.º 11
0
 /// <summary>
 /// 根据模型插入
 /// </summary>
 /// <param name="model">模型</param>
 /// <returns>是否成功</returns>
 public bool Insert(Customerservice model)
 {
     return(CustomerserviceOper.Instance.Insert(model));
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 根据模型插入
 /// </summary>
 /// <param name="model">模型</param>
 /// <returns>是否成功</returns>
 public int InsertReturnKey(Customerservice model)
 {
     return(CustomerserviceOper.Instance.InsertReturnKey(model));
 }
Ejemplo n.º 13
0
 /// <summary>
 /// 根据模型更新
 /// </summary>
 /// <param name="model">模型</param>
 /// <returns>是否成功</returns>
 public bool Update(Customerservice model)
 {
     return(CustomerserviceOper.Instance.Update(model));
 }
Ejemplo n.º 14
0
 /// <summary>
 /// 根据模型删除数据
 /// </summary>
 /// <param name="model">模型</param>
 /// <returns>是否成功</returns>
 public bool DeleteModel(Customerservice model)
 {
     return(CustomerserviceOper.Instance.DeleteModel(model));
 }
Ejemplo n.º 15
0
 /// <summary>
 /// 根据分页筛选数据
 /// </summary>
 /// <param name="Key">主键</param>
 /// <param name="start">开始数据</param>
 /// <param name="PageSize">页面长度</param>
 /// <param name="desc">排序</param>
 /// <param name="model">对象</param>
 /// <returns>对象列表</returns>
 public List <Customerservice> SelectByPage(string Key, int start, int PageSize, bool desc, Customerservice model, string SelectFiled)
 {
     return(CustomerserviceOper.Instance.SelectByPage(Key, start, PageSize, desc, model));
 }
        /// <summary>
        /// 重新设置用户的过期时间
        /// </summary>
        /// <param name="filterContext"></param>
        protected override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            var userGuid = CookieOper.Instance.GetUserGuid();
            var user     = MemCacheHelper2.Instance.Cache.GetModel <User>("UserGuID_" + userGuid);
            List <Hisdesigninfo_View> ListHisdesign = new List <Hisdesigninfo_View>();
            int?userId = null;

            if (user != null)
            {
                userId           = user.Id;
                user             = UserFunc.Instance.SelectById(user.Id);
                ViewBag.UserInfo = user;
                MemCacheHelper2.Instance.Cache.Set("UserGuID_" + userGuid, user, 24 * 60);
                #region 微信支付列表
                var WechatOrder = Order_InfoFunc.Instance.SelectByModel(new Order_Info {
                    WechatFaild = false, Status = 1, UserId = user.Id
                });
                foreach (var item in WechatOrder)
                {
                    HttpClient client = new HttpClient();
                    client.BaseAddress = new Uri(HttpContext.Request.Url.Scheme + "://" + HttpContext.Request.Url.Authority);
                    var result = client.GetStringAsync("api/Order/WeiChatOrder?OrderNo=" + item.OrderNo);
                }
                #endregion
            }
            #region 购物车列表
            ListHisdesign = HisdesignFunc.Instance.GetModleHisdesign(new Hisdesigninfo_View {
                UserID = userId, UserGuId = userGuid, OrderId = 0, IsMobile = false
            });
            ViewBag.HisdesignCount = HisdesignFunc.Instance.GetHisdesignInfoCount(new Hisdesigninfo_View {
                UserID = userId, UserGuId = userGuid, OrderId = 0, IsMobile = false
            });
            var list = CommodityPriceFunc.Instance.SelectByIds(ListHisdesign.Select(p => p.CommodityId).ToList());
            List <HisdesigninfoResponse> listResponse = new List <HisdesigninfoResponse>();
            foreach (var item in ListHisdesign)
            {
                var priceList = list.Where(p => p.CommodityId == item.CommodityId).ToList();
                HisdesigninfoResponse response = new HisdesigninfoResponse(item, priceList);
                listResponse.Add(response);
            }
            ViewBag.HisdesignInfo  = listResponse;
            ViewBag.HisdesignPrice = listResponse.Sum(p => p.Price);
            //颜色列表
            ViewBag.ColorList = ColorinfoFunc.Instance.GetColorListBase();
            #endregion
            ViewBag.listGradeOfTitle = GradeFunc.Instance.GetAllGrade();
            ViewBag.listScence       = GradeFunc.Instance.GetAllScene();
            #region 分类推荐列表
            ViewBag.ShowgradeList = ShowgradeinfoFunc.Instance.SelectByModel(null);
            ViewBag.AllListGrade  = GradeFunc.Instance.GetAllGradeInfo();
            #endregion
            ViewBag.listCommdity = CommodityFunc.Instance.GetAllCommList();
            ViewBag.CommShowList = CommshowFunc.Instance.SelectByModel(null);
            ViewBag.DisCount     = user == null ? 1 : user.Discount;
            ViewBag.AdminUrl     = System.Configuration.ConfigurationManager.AppSettings["AdminUrl"];
            var ServiceList = CustomerserviceFunc.Instance.SelectByModel(new Customerservice {
                IsService = true
            });
            Customerservice customerservice = new Customerservice();
            if (ServiceList.Count != 0)
            {
                Random rd    = new Random();
                var    rdNum = rd.Next(0, ServiceList.Count - 1);
                customerservice = ServiceList[rdNum];
            }
            ViewBag.customerservice = customerservice;
        }
Ejemplo n.º 17
0
        /// <summary>
        /// 根据分页筛选数据
        /// </summary>
        /// <param name="Key">主键</param>
        /// <param name="start">开始数据</param>
        /// <param name="PageSize">页面长度</param>
        /// <param name="desc">排序</param>
        /// <param name="model">对象</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>对象列表</returns>
        public List <Customerservice> SelectByPage(string Key, int start, int PageSize, bool desc = true, Customerservice model = null, string SelectFiled = null, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var query = new LambdaQuery <Customerservice>();

            if (model != null)
            {
                if (!model.Id.IsNullOrEmpty())
                {
                    query.Where(p => p.Id == model.Id);
                }
                if (!model.ServiceName.IsNullOrEmpty())
                {
                    query.Where(p => p.ServiceName == model.ServiceName);
                }
                if (!model.ServicePwd.IsNullOrEmpty())
                {
                    query.Where(p => p.ServicePwd == model.ServicePwd);
                }
                if (!model.IsService.IsNullOrEmpty())
                {
                    query.Where(p => p.IsService == model.IsService);
                }
                if (!model.ServiceQQ.IsNullOrEmpty())
                {
                    query.Where(p => p.ServiceQQ == model.ServiceQQ);
                }
                if (!model.ServiceWechat.IsNullOrEmpty())
                {
                    query.Where(p => p.ServiceWechat == model.ServiceWechat);
                }
                if (!model.ServiceALWW.IsNullOrEmpty())
                {
                    query.Where(p => p.ServiceALWW == model.ServiceALWW);
                }
                if (!model.ServicePhone.IsNullOrEmpty())
                {
                    query.Where(p => p.ServicePhone == model.ServicePhone);
                }
            }
            if (SelectFiled != null)
            {
                SelectFiled = SelectFiled.ToLowerInvariant();
                if (SelectFiled.Contains("id,"))
                {
                    query.Select(p => new { p.Id });
                }
                if (SelectFiled.Contains("servicename,"))
                {
                    query.Select(p => new { p.ServiceName });
                }
                if (SelectFiled.Contains("servicepwd,"))
                {
                    query.Select(p => new { p.ServicePwd });
                }
                if (SelectFiled.Contains("isservice,"))
                {
                    query.Select(p => new { p.IsService });
                }
                if (SelectFiled.Contains("serviceqq,"))
                {
                    query.Select(p => new { p.ServiceQQ });
                }
                if (SelectFiled.Contains("servicewechat,"))
                {
                    query.Select(p => new { p.ServiceWechat });
                }
                if (SelectFiled.Contains("servicealww,"))
                {
                    query.Select(p => new { p.ServiceALWW });
                }
                if (SelectFiled.Contains("servicephone,"))
                {
                    query.Select(p => new { p.ServicePhone });
                }
            }
            if (Key != null)
            {
                query.OrderByKey(Key, desc);
            }
            return(query.GetQueryPageList(start, PageSize, connection, transaction));
        }