Ejemplo n.º 1
0
        public string Login(string userName, string pwd)
        {
            string sql = "select * from Users where UserName=?userName and Pwd=?pwd and State=0 ";
            Dictionary <string, object> p = new Dictionary <string, object>();

            p["userName"] = userName;
            p["pwd"]      = pwd;
            UserModel user = DbUtil.Master.Query <UserModel>(sql, p);

            if (user != null)
            {
                string key = CryptoUtil.GetRandomAesKey();
                user.key = key;
                user.Pwd = string.Empty;
                string Token     = CryptoUtil.AesEncryptHex(user.UserName + uKey, key);
                string uloginKey = user.UserName + uKey;
                var    oldToken  = CacheHelp.Get <string>(uloginKey, DateTimeOffset.Now.AddDays(7), () => null);
                if (!string.IsNullOrEmpty(oldToken))
                {
                    CacheHelp.Set(oldToken, DateTimeOffset.Now.AddDays(7), null);
                }
                CacheHelp.Set(uloginKey, DateTimeOffset.Now.AddDays(7), Token);
                CacheHelp.Set(Token, DateTimeOffset.Now.AddDays(7), user);
                List <object> u = new List <object>();
                u.Add(new
                {
                    token = Token,
                });
                return(JsonUtil.Serialize(u));
            }
            return(string.Empty);
        }
Ejemplo n.º 2
0
        public string GetShoppingList(string token)
        {
            string key      = string.Concat(token, "SetShopping");
            var    uComList = CacheHelp.Get <List <CommodityModel> >(key, DateTimeOffset.Now.AddMonths(3), () => null);

            return(JsonUtil.Serialize(uComList));
        }
Ejemplo n.º 3
0
        public string DeleteShopping(string idStr, string token)
        {
            var user = UserService.CkToken(token);

            if (user != null)
            {
                string key      = string.Concat(user.UserName, "SetShopping");
                var    uComList = CacheHelp.Get <List <CommodityModel> >(key, DateTimeOffset.Now.AddMonths(3), () => null);
                if (!string.IsNullOrEmpty(idStr) && uComList != null && uComList.Count > 0)
                {
                    List <int> idList = new List <int>(idStr.Split(',').Select(x => int.Parse(x)));
                    foreach (var id in idList)  //移除购物车商品
                    {
                        var item = uComList.Find(o => o.CommodityId == id);
                        if (item != null)
                        {
                            uComList.Remove(item);
                        }
                    }
                    CacheHelp.Set(key, DateTimeOffset.Now.AddMonths(3), uComList);
                }
                return(JsonUtil.Serialize(uComList));
            }
            else
            {
                return(UserService.ckTokenState());
            }
        }
Ejemplo n.º 4
0
        public string SetShoppingCount(string token, int shpId, int spCount)
        {
            string key      = string.Concat(token, "SetShopping");
            var    uComList = CacheHelp.Get <List <CommodityModel> >(key, DateTimeOffset.Now.AddMonths(3), () => null);

            if (uComList == null)
            {
                uComList = new List <CommodityModel>();
            }
            var um = uComList.Find(o => o.CommodityId == shpId);

            if (um == null)
            {
                CommodityModel cm = GetComInfo(shpId);
                if (cm != null)
                {
                    cm.SpCount = spCount;
                    uComList.Add(cm);
                }
            }
            else
            {
                um.SpCount = spCount;
            }
            var         state = CacheHelp.Set(key, DateTimeOffset.Now.AddMonths(3), uComList);
            ReturnModel re    = new ReturnModel();

            if (state)
            {
                re.state  = true;
                re.rcount = uComList.Count;
            }
            return(JsonUtil.Serialize(re));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 获取指定购物车商品
        /// </summary>
        /// <param name="token"></param>
        /// <param name="spId"></param>
        /// <returns></returns>
        public string GetShoppingInId(string token, string spId)
        {
            var user = UserService.CkToken(token);

            if (user != null)
            {
                List <CommodityModel> tmpList = new List <CommodityModel>();
                if (!string.IsNullOrEmpty(spId))
                {
                    var    idList   = new List <int>(spId.Split(',').Select(x => int.Parse(x)));
                    string key      = string.Concat(user.UserName, "SetShopping");
                    var    uComList = CacheHelp.Get <List <CommodityModel> >(key, DateTimeOffset.Now.AddMonths(3), () => null);
                    if (uComList.Count > 0)
                    {
                        foreach (var id in idList)
                        {
                            var tmpdata = uComList.Find(o => o.CommodityId == id);
                            if (tmpdata != null)
                            {
                                tmpList.Add(tmpdata);
                            }
                        }
                    }
                }
                return(JsonUtil.Serialize(tmpList));
            }
            else
            {
                return(UserService.ckTokenState());
            }
        }
Ejemplo n.º 6
0
 public string UpdateUserInfo(string token, string nickname, string sex, string uImg)
 {
     if (!string.IsNullOrEmpty(token))
     {
         var userModel = CacheHelp.Get <UserModel>(token, DateTimeOffset.Now.AddDays(7), () => null);
         if (userModel != null)
         {
             string sql = "UPDATE Users SET Nickname=?nickname,Sex=?sex,UserImg=?userImg where Uid=?uid";
             Dictionary <string, object> p = new Dictionary <string, object>();
             p["nickname"] = nickname;
             p["sex"]      = sex;
             p["userImg"]  = uImg;
             p["uid"]      = userModel.Uid;
             int rowNum = DbUtil.Master.ExecuteNonQuery(sql, p);
             if (rowNum > 0)
             {
                 userModel.Nickname = nickname;
                 userModel.Sex      = sex;
                 userModel.UserImg  = uImg;
                 string key = string.Concat(token); //统一cache Key
                 CacheHelp.Set(key, DateTimeOffset.Now.AddDays(7), userModel);
                 ReturnModel re = new ReturnModel();
                 re.state = true;
                 return(JsonUtil.Serialize(re));
             }
         }
     }
     return(string.Empty);
 }
Ejemplo n.º 7
0
        public ActionResult Logout()
        {
            var logurl = FormsAuthentication.LoginUrl;

            if (User.Identity.IsAuthenticated)
            {
                logService.Logon();
                CacheHelp.RemoveKeyCache(User.Identity.Name);
            }
            return(Redirect(logurl));
        }
Ejemplo n.º 8
0
        private static object CreateInstance(string fullName, string assemblyName)
        {
            object instance = CacheHelp.Get(fullName);

            if (instance == null)
            {
                var ass = Assembly.Load(assemblyName);
                instance = ass.CreateInstance(fullName);
            }
            return(instance);
        }
Ejemplo n.º 9
0
        public string Register(string uName, string pwd, string sex, string nickname, string entName, string phones, string entPhone, string entAddres)
        {
            var isok = ckUnameSql(uName);

            if (!isok)
            {
                #region
                string sql = "INSERT INTO Users (UserName,Pwd,Nickname,Sex,EntName,Phones,EntPhone,EntAddres) VALUES (?userName,?pwd,?nickname,?sex,?entName,?phones,?entPhone,?entAddres)";
                Dictionary <string, object> p = new Dictionary <string, object>();
                p["userName"]  = uName;
                p["pwd"]       = pwd;
                p["nickname"]  = nickname;
                p["sex"]       = sex;
                p["entName"]   = entName;
                p["phones"]    = phones;
                p["entPhone"]  = entPhone;
                p["entAddres"] = entAddres;
                var row = DbUtil.Master.ExecuteNonQuery(sql, p);
                if (row > 0)
                {
                    UserModel user = new UserModel();
                    string    key  = CryptoUtil.GetRandomAesKey();
                    user.key      = key;
                    user.UserName = uName;
                    user.Pwd      = string.Empty;
                    string Token     = CryptoUtil.AesEncryptHex(user.UserName + uKey, key);
                    string uloginKey = user.UserName + uKey;
                    var    oldToken  = CacheHelp.Get <string>(uloginKey, DateTimeOffset.Now.AddDays(7), () => null);
                    if (!string.IsNullOrEmpty(oldToken))
                    {
                        CacheHelp.Set(oldToken, DateTimeOffset.Now.AddDays(7), null);
                    }
                    CacheHelp.Set(uloginKey, DateTimeOffset.Now.AddDays(7), Token);
                    CacheHelp.Set(Token, DateTimeOffset.Now.AddDays(7), user);
                    List <object> u = new List <object>();
                    u.Add(new
                    {
                        token = Token,
                    });
                    return(JsonUtil.Serialize(u));
                }
                else
                {
                    object obj = new { msg = false };
                    return(JsonUtil.Serialize(obj));
                }
                #endregion
            }
            else
            {
                object obj = new { msg = isok };
                return(JsonUtil.Serialize(obj));
            }
        }
Ejemplo n.º 10
0
        public string DeleteAllShopping(string token)
        {
            string key      = string.Concat(token, "SetShopping");
            var    uComList = CacheHelp.Get <List <CommodityModel> >(key, DateTimeOffset.Now.AddMonths(3), () => null);

            if (uComList != null && uComList.Count > 0)
            {
                uComList.Clear();
            }
            CacheHelp.Set(key, DateTimeOffset.Now.AddMonths(3), uComList);
            return(JsonUtil.Serialize(uComList));
        }
Ejemplo n.º 11
0
 public string GetUserInfo(string token)
 {
     if (!string.IsNullOrEmpty(token))
     {
         var userModel = CacheHelp.Get <UserModel>(token, DateTimeOffset.Now.AddDays(7), () => null);
         if (userModel != null)
         {
             return(JsonUtil.Serialize(userModel));
         }
     }
     return("");
 }
Ejemplo n.º 12
0
        public string GetShoppingCount(string token)
        {
            string      key      = string.Concat(token, "SetShopping");
            var         uComList = CacheHelp.Get <List <CommodityModel> >(key, DateTimeOffset.Now.AddMonths(3), () => null);
            ReturnModel re       = new ReturnModel();

            re.state = true;
            if (uComList != null)
            {
                re.rcount = uComList.Count;
            }
            return(JsonUtil.Serialize(re));
        }
Ejemplo n.º 13
0
        public void wapOk(string wapSpId, long orderId)
        {
            var idkey = CacheHelp.Get <string>(wapSpId, null);

            if (!string.IsNullOrEmpty(idkey))
            {
                var orId = Convert.ToInt64(idkey);
                if (orId == orderId)
                {
                    LogUtil.Info("支付加密:" + wapSpId + "订单编号;" + orderId);
                    UpdataState(orId);
                }
            }
        }
Ejemplo n.º 14
0
        public string GetSearchList(string token)
        {
            var user = UserService.CkToken(token);

            if (user != null)
            {
                string key = string.Concat("GetSearchList");
                return(CacheHelp.Get <string>(key, DateTimeOffset.Now.AddSeconds(3), () => GetSearchList(user.Uid)));
            }
            else
            {
                return(UserService.ckTokenState());
            }
        }
Ejemplo n.º 15
0
        public IEnumerable <typeListDto> FindCompanys(int typeId)
        {
            var cache = CacheHelp.GetCache("commonData_Company");           //先读取

            if (cache == null)                                              //如果没有该缓存
            {
                var queryCompany = _mic_TypeAppservice.typeListAll(typeId); //从数据库取出
                var enumerable   = queryCompany.ToList();
                CacheHelp.SetCache("commonData_Company", enumerable);       //添加缓存
                return(enumerable);
            }
            var result = (List <typeListDto>)cache;//有就直接返回该缓存

            return(result);
        }
Ejemplo n.º 16
0
        public string GetShoppingList(string token)
        {
            var user = UserService.CkToken(token);

            if (user != null)
            {
                string key      = string.Concat(user.UserName, "SetShopping");
                var    uComList = CacheHelp.Get <List <CommodityModel> >(key, DateTimeOffset.Now.AddMonths(3), () => null);
                return(JsonUtil.Serialize(uComList));
            }
            else
            {
                return(UserService.ckTokenState());
            }
        }
Ejemplo n.º 17
0
        public ActionResult <string> ExeAction(string Action, Object PostData)
        {
            Model.Action = Action;
            var           context     = _accessor.HttpContext;
            var           tokenHeader = context.Request.Headers["Authorization"].ToString().Replace("Bearer ", "");
            TokenModelJWT tokenModel  = JwtHelper.SerializeJWT(tokenHeader);

            if (new DateTimeOffset(DateTime.Now.AddMinutes(5)).ToUnixTimeSeconds() > tokenModel.Exp)
            {
                //需要更新Token
                Model.uptoken = JwtHelper.CreateJWT(tokenModel.UserName, "Admin");
            }
            JH_Auth_UserB.UserInfo UserInfo = CacheHelp.Get(tokenModel.UserName) as JH_Auth_UserB.UserInfo;
            if (UserInfo == null)
            {
                UserInfo = new JH_Auth_UserB().GetUserInfo(10334, tokenModel.UserName);
                CacheHelp.Set(tokenModel.UserName, UserInfo);
            }
            try
            {
                JObject JsonData = JObject.FromObject(PostData);
                string  P1       = JsonData["P1"] == null ? "" : JsonData["P1"].ToString();
                string  P2       = JsonData["P2"] == null ? "" : JsonData["P2"].ToString();


                // 1.Load(命名空间名称),GetType(命名空间.类名)
                Type type = Assembly.Load("QJY.API").GetType("QJY.API." + Action.Split('_')[0].ToUpper() + "Manage");
                //2.GetMethod(需要调用的方法名称)
                MethodInfo method = type.GetMethod(Action.Split('_')[1].ToUpper());
                // 3.调用的实例化方法(非静态方法)需要创建类型的一个实例
                object obj = Activator.CreateInstance(type);
                //4.方法需要传入的参数
                object[] parameters = new object[] { JsonData, Model, P1, P2, UserInfo };
                method.Invoke(obj, parameters);
                new JH_Auth_LogB().InsertLog(Model.Action, "--调用接口", "", UserInfo.User.UserName, UserInfo.User.UserRealName, UserInfo.QYinfo.ComId, "");
            }
            catch (Exception ex)
            {
                Model.ErrorMsg = Action + "接口调用失败,请检查日志";
                Model.Result   = ex.ToString();
                new JH_Auth_LogB().InsertLog(Action, Model.ErrorMsg + ex.StackTrace.ToString(), ex.ToString(), tokenModel.UserName, "", 0, "");
            }

            return(ControHelp.CovJson(Model));
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 检查token是否有效
        /// </summary>
        /// <param name="token"></param>
        /// <param name="uName"></param>
        /// <returns></returns>
        public static UserModel CkToken(string token)
        {
            var user = CacheHelp.Get <UserModel>(token, DateTimeOffset.Now.AddDays(7), () => null);

            if (user != null)
            {
                string tmpUName = CryptoUtil.AesDecryptHex(token, user.key);
                if (!string.IsNullOrEmpty(tmpUName) && tmpUName.Equals(user.UserName + uKey))
                {
                    return(user);
                }
                else
                {
                    return(null);
                }
            }
            return(null);
        }
Ejemplo n.º 19
0
        public string GetOrder(long orderId, string token, int orderType)
        {
            var user = UserService.CkToken(token);

            if (user != null)
            {
                string sql = "SELECT * FROM OrderList WHERE OrderId=?orderId";
                Dictionary <string, object> p = new Dictionary <string, object>();
                p["orderId"] = orderId;
                var orderList = DbUtil.Master.Query <OrderListModel>(sql, p);
                //调起支付
                string key     = CryptoUtil.GetRandomAesKey();
                string wapSpId = CryptoUtil.AesEncryptHex(orderId.ToString(), key);
                CacheHelp.Set(wapSpId, DateTimeOffset.Now.AddDays(1), orderId.ToString());
                return(wapPay(orderList, orderId, 0, wapSpId));
            }
            else
            {
                return(UserService.ckTokenState());
            }
        }
Ejemplo n.º 20
0
        public string GetShoppingCount(string token)
        {
            var user = UserService.CkToken(token);

            if (user != null)
            {
                string      key      = string.Concat(user.UserName, "SetShopping");
                var         uComList = CacheHelp.Get <List <CommodityModel> >(key, DateTimeOffset.Now.AddMonths(3), () => null);
                ReturnModel re       = new ReturnModel();
                re.state = true;
                if (uComList != null)
                {
                    re.rcount = uComList.Count;
                }
                return(JsonUtil.Serialize(re));
            }
            else
            {
                return(UserService.ckTokenState());
            }
        }
Ejemplo n.º 21
0
        public ActionResult <string> ExeAction(string Action, Object PostData)
        {
            Model.Action = Action;
            var           context     = _accessor.HttpContext;
            var           tokenHeader = context.Request.Headers["Authorization"].ToString().Replace("Bearer ", "");
            TokenModelJWT tokenModel  = JwtHelper.SerializeJWT(tokenHeader);

            if (new DateTimeOffset(DateTime.Now.AddMinutes(5)).ToUnixTimeSeconds() > tokenModel.Exp)
            {
                //需要更新Token
                Model.uptoken = JwtHelper.CreateJWT(tokenModel.UserName, "Admin");
            }
            JH_Auth_UserB.UserInfo UserInfo = CacheHelp.Get(tokenModel.UserName) as JH_Auth_UserB.UserInfo;
            if (UserInfo == null)
            {
                UserInfo = new JH_Auth_UserB().GetUserInfo(10334, tokenModel.UserName);
                CacheHelp.Set(tokenModel.UserName, UserInfo);
            }
            try
            {
                JObject JsonData = JObject.FromObject(PostData);
                string  P1       = JsonData["P1"] == null ? "" : JsonData["P1"].ToString();
                string  P2       = JsonData["P2"] == null ? "" : JsonData["P2"].ToString();

                //Dictionary<string, string> results3 = JsonConvert.DeserializeObject<Dictionary<string, string>>(PostData.ToString());
                var function = Activator.CreateInstance(typeof(AuthManage)) as AuthManage;
                var method   = function.GetType().GetMethod(Action.ToUpper());
                method.Invoke(function, new object[] { JsonData, Model, P1, P2, UserInfo });
                new JH_Auth_LogB().InsertLog(Model.Action, "--调用接口", "", UserInfo.User.UserName, UserInfo.User.UserRealName, UserInfo.QYinfo.ComId, "");
            }
            catch (Exception ex)
            {
                Model.ErrorMsg = Action + "接口调用失败,请检查日志";
                Model.Result   = ex.ToString();
                new JH_Auth_LogB().InsertLog(Action, Model.ErrorMsg + ex.StackTrace.ToString(), ex.ToString(), tokenModel.UserName, "", 0, "");
            }

            return(ControHelp.CovJson(Model));
        }
Ejemplo n.º 22
0
        public ActionResult <string> Login(Object PostData)
        {
            JObject JsonData = JObject.FromObject(PostData);
            string  username = JsonData["UserName"] == null ? "" : JsonData["UserName"].ToString();
            string  password = JsonData["password"] == null ? "" : JsonData["password"].ToString();
            Dictionary <string, string> results3 = JsonConvert.DeserializeObject <Dictionary <string, string> >(PostData.ToString());

            Model.ErrorMsg = "";
            JH_Auth_QY qyModel = new JH_Auth_QYB().GetALLEntities().First();

            password = CommonHelp.GetMD5(password);
            JH_Auth_User        userInfo = new JH_Auth_User();
            List <JH_Auth_User> userList = new JH_Auth_UserB().GetEntities(d => (d.UserName == username || d.mobphone == username) && d.UserPass == password).ToList();

            if (userList.Count() == 0)
            {
                Model.ErrorMsg = "用户名或密码不正确";
            }
            else
            {
                userInfo = userList[0];
                if (userInfo.IsUse != "Y")
                {
                    Model.ErrorMsg = "用户被禁用,请联系管理员";
                }
                if (Model.ErrorMsg == "")
                {
                    Model.Result  = JwtHelper.CreateJWT(username, "Admin");
                    Model.Result1 = userInfo.UserName;
                    Model.Result2 = qyModel.FileServerUrl;
                    Model.Result4 = userInfo;

                    CacheHelp.Remove(userInfo.UserName);
                }
            }


            return(ControHelp.CovJson(Model));;
        }
Ejemplo n.º 23
0
        public string Login(string userName, string pwd)
        {
            string token = string.Empty;
            string sql   = "select * from Users where UserName=?userName and Pwd=?pwd and State=0 ";
            Dictionary <string, object> p = new Dictionary <string, object>();

            p["userName"] = userName;
            p["pwd"]      = pwd;
            UserModel user = DbUtil.Master.Query <UserModel>(sql, p);

            if (user != null)
            {
                string key = string.Concat(user.UserName, user.Uid); //统一cache Key
                CacheHelp.Set(key, DateTimeOffset.Now.AddDays(7), user);
                List <object> u = new List <object>();
                u.Add(new
                {
                    token = key,
                });
                token = JsonUtil.Serialize(u);
            }
            return(token);
        }
Ejemplo n.º 24
0
        public JsonResult CreateAfter(ShopInfo model)
        {
            Utility.ReturnData <string> returnData = new Utility.ReturnData <string>();
            ShopInfoBll shopBll = new ShopInfoBll();
            UserPC      _model  = CacheHelp.Get("user") as UserPC;

            model.Relation     = 1;
            model.ContactPhone = "";
            model.Address      = "";
            model.Range        = "";
            model.shopIMG      = "";
            model.WeixinMPID   = 0;
            model.Remarks      = "";
            model.AgentID      = 0;
            model.ContactTEL   = "";
            model.Status       = 2;
            model.ProvinceID   = model.ProvinceID;
            model.CityID       = model.CityID;
            model.CountyID     = model.CountyID;
            model.EnterpriseID = LoginUser.UserBasic.EnterpriseID;
            returnData         = shopBll.Create(model);
            return(Json(returnData));
        }
Ejemplo n.º 25
0
        /// <summary>
        /// 返回false时前端需要重新登录
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        public static UserModel GetUserLoginState(string token)
        {
            var userModel = CacheHelp.Get <UserModel>(token, DateTimeOffset.Now.AddDays(7), () => null);

            return(userModel);
        }
Ejemplo n.º 26
0
        public string GetBrandHome(int size)
        {
            string key = string.Concat("GetBrandHome", size);

            return(CacheHelp.Get <string>(key, DateTimeOffset.Now.AddSeconds(3), () => GetBrandHomeSal(size)));
        }
Ejemplo n.º 27
0
        public string GetCityList()
        {
            string key = string.Concat("GetCitList");

            return(CacheHelp.Get <string>(key, DateTimeOffset.Now.AddSeconds(3), () => GetCityListSql()));
        }
Ejemplo n.º 28
0
        public bool ActionValidate(string roleId, string moduleId, string action)
        {
            var authorizeurldata = new List <AuthorizeActionModel>();
            //var cachedata = CacheFactory.cacheFactory.Cache().GetCache<List<AuthorizeActionModel>>("authorizeurldata_" + roleId);
            var cachedata = new CacheHelp().GetAuthorizeurlDatas(roleId);

            if (cachedata == null || cachedata.Count <= 0)
            {
                var moduledata    = moduleApp.GetList();
                var buttondata    = moduleButtonApp.GetList();
                var authorizedata = service.IQueryable(t => t.ObjectId == roleId).ToList();
                foreach (var item in authorizedata)
                {
                    if (item.ItemType == 1)
                    {
                        ModuleEntity moduleEntity = moduledata.Find(t => t.Id == item.ItemId);
                        if (moduleEntity != null)
                        {
                            authorizeurldata.Add(new AuthorizeActionModel {
                                Id = moduleEntity.Id, UrlAddress = moduleEntity.UrlAddress
                            });
                        }
                    }
                    else if (item.ItemType == 2)
                    {
                        ModuleButtonEntity moduleButtonEntity = buttondata.Find(t => t.Id == item.ItemId);
                        if (moduleButtonEntity != null)
                        {
                            authorizeurldata.Add(new AuthorizeActionModel {
                                Id = moduleButtonEntity.ModuleId, UrlAddress = moduleButtonEntity.UrlAddress
                            });
                        }
                    }
                }
                //CacheFactory.cacheFactory.Cache().WriteCache(authorizeurldata, "authorizeurldata_" + roleId, DateTime.Now.AddMinutes(5));
                new CacheHelp().WriteAuthorizeurlDatas(authorizeurldata, roleId);
            }
            else
            {
                authorizeurldata = cachedata;
            }
            authorizeurldata = authorizeurldata.FindAll(t => t.Id.Equals(moduleId));
            foreach (var item in authorizeurldata)
            {
                if (!string.IsNullOrEmpty(item.UrlAddress))
                {
                    string[] url = item.UrlAddress.Split('?');
                    if (item.Id == moduleId && url[0] == action)
                    {
                        return(true);
                    }
                    else
                    {
                        string[] urls = item.UrlAddress.Split('|');
                        if (item.Id == moduleId && urls.Contains(action))
                        {
                            return(true);
                        }
                    }
                }
            }
            return(false);
        }
Ejemplo n.º 29
0
        public string GetCommodityFamily(int familyId, int index = 1, int size = 10)
        {
            string key = string.Concat("GetCommodityFamily", familyId, index, size);

            return(CacheHelp.Get <string>(key, DateTimeOffset.Now.AddSeconds(3), () => GetCommodityByFamilyIdSql(familyId, index, size)));
        }
Ejemplo n.º 30
0
        public string GetCommodityByBrand(int brandId, int index = 1, int size = 10)
        {
            string key = string.Concat("GetCommodityByBrand", brandId, index, size);

            return(CacheHelp.Get <string>(key, DateTimeOffset.Now.AddSeconds(3), () => GetCommodityByBrandIdSql(brandId, index, size)));
        }