예제 #1
0
        public ActionResult PostInsuranceData()
        {
            int    insurance_id   = DoRequest.GetFormInt("insurance_id");
            string insurance_name = DoRequest.GetFormString("insurance_name").Trim();
            int    paytype        = DoRequest.GetFormInt("paytype");

            #region Checking
            if (insurance_name.Length < 1)
            {
                return(Json(new { error = true, message = "【名称】商保不能为空" }));
            }
            if (paytype == 0)
            {
                return(Json(new { error = true, message = "请选择【支付方式】" }));
            }
            #endregion
            int returnValue = -1;
            var res         = OpInsuranceInfo.Do(insurance_id, insurance_name, paytype);
            if (res != null && res.Header != null && res.Header.Result != null && res.Header.Result.Code != null)
            {
                returnValue = Utils.StrToInt(res.Header.Result.Code, -1);
            }

            if (returnValue == 0)
            {
                return(Json(new { error = false, message = "操作成功" }));
            }

            return(Json(new { error = true, message = "操作失败" }));
        }
예제 #2
0
 public Task <DoResponse> DoAsync(DoRequest request)
 {
     Console.WriteLine("We are in SampleService-DoAsync");
     return(Task.FromResult(new DoResponse {
         IsSuccess = true
     }));
 }
예제 #3
0
        public ActionResult List()
        {
            UserResBody currResBody = new UserResBody();

            foreach (UserResBody item in base._userResBody)
            {
                if (item.res_path.Equals("0,1,105,144,202,"))
                {
                    currResBody = item;
                    break;
                }
            }

            HasPermission(currResBody.res_id);

            ViewData["currResBody"] = currResBody;//当前菜单
            string position = "";

            ViewData["pageTitle"] = base.FormatPageTile(currResBody, ref position);
            ViewData["position"]  = position;//页面位置

            int    pagesize  = 30;
            int    posId     = DoRequest.GetQueryInt("posid", -1);
            int    pageindex = DoRequest.GetQueryInt("page", 1);
            string q         = DoRequest.GetQueryString("q");
            int    useplat   = DoRequest.GetQueryInt("useplat");

            int dataCount = 0;
            int pageCount = 0;
            List <RecommendPositionList> infoList = null;
            var resp = QueryRecommendPositionList.Do(pagesize, pageindex
                                                     , posId, useplat
                                                     , q
                                                     , ref dataCount, ref pageCount);

            if (resp == null || resp.Body == null)
            {
                infoList = new List <RecommendPositionList>();
            }
            else
            {
                infoList = resp.Body.recommend_list;
            }
            ViewData["infoList"] = infoList;

            System.Text.StringBuilder currPageUrl = new System.Text.StringBuilder();//拼接当前页面URL
            currPageUrl.Append("/mpolymeric/list?");
            currPageUrl.Append("&posid=" + posId);
            currPageUrl.Append("&q=" + q);
            currPageUrl.Append("&page=" + pageindex);
            currPageUrl.Append("&useplat=" + useplat);
            ViewData["currPageUrl"]    = currPageUrl;//当前页面的URL
            ViewData["pagesize"]       = pagesize;
            ViewData["pageindex"]      = pageindex;
            ViewData["dataCount"]      = dataCount;
            ViewData["pageIndexLink"]  = this.FormatPageIndex(dataCount, pagesize, pageindex, currPageUrl.ToString());
            ViewData["pageIndexLink2"] = this.FormatPageIndex(dataCount, pagesize, pageindex, currPageUrl.ToString());

            return(View());
        }
예제 #4
0
        public ActionResult ShopEditor()
        {
            UserResBody currResBody = new UserResBody();

            foreach (UserResBody item in base._userResBody)
            {
                if (item.res_path.Equals("0,1,101,199,"))
                {
                    currResBody = item;
                    break;
                }
            }

            ViewData["currResBody"] = currResBody;//当前菜单
            string position = "";

            ViewData["pageTitle"] = base.FormatPageTile(currResBody, ref position);
            ViewData["position"]  = position;//页面位置

            int      shopid = DoRequest.GetQueryInt("shopid");
            ShopInfo shop   = null;

            if (shopid == 0)
            {
                shop = new ShopInfo();
            }
            else
            {
                shop = GetShopDetail.Do(shopid).Body;
            }
            ViewData["shop"] = shop;

            return(View());
        }
예제 #5
0
        public ActionResult SetLocalAddress()
        {
            string val = DoRequest.GetFormString("address").Trim();

            Cookies.SetLocalAddress(val);
            return(Json(new { error = false, message = "操作成功!" }));
        }
예제 #6
0
        public static string GetLocalAddress()
        {
            string val = DoRequest.GetCookie(LocalAddressCookieName);

            return(val);
            //return Utils.DeUnicode(val);
        }
예제 #7
0
        public ActionResult ResetUserState()
        {
            string idString = DoRequest.GetFormString("visitid").Trim();
            int    status   = DoRequest.GetFormInt("status");

            if (string.IsNullOrEmpty(idString))
            {
                return(Json(new { error = true, message = "没有选择任何项" }));
            }

            int returnValue = -1;
            var res         = ModifyUserState.Do(idString, status);

            if (res != null && res.Header != null && res.Header.Result != null && res.Header.Result.Code != null)
            {
                returnValue = Utils.StrToInt(res.Header.Result.Code, -1);
            }
            if (returnValue == 0)
            {
                DoCache cache = new DoCache();
                cache.RemoveCacheStartsWith("user");
                return(Json(new { error = false, message = "操作成功!" }));
            }

            return(Json(new { error = true, message = "操作失败" }));
        }
예제 #8
0
        public static ConfigInfo config = JiuZhou.HttpTools.ConnStringConfig.GetConfig;//网站配置

        #region 根据父ID获取子菜单
        public void GetHtmlNodes()
        {
            int rootId = DoRequest.RequestInt("parentid", 0);
            List <UserResBody> nodes = base._userResBody.FindAll(delegate(UserResBody item) { return(item.parent_id == rootId); });
            int _count = 0;

            Response.Write("<dl>\n");
            foreach (UserResBody node in nodes)
            {
                // if (!USysGroupDB.HasNode(base._sysGroupItems, base._currManager.IsSysUser ? "" : node.NodeCode))
                //   continue;
                if (_count == 0)
                {
                    Response.Write("<dt class=\"first\">" + node.res_name + "</dt>\n");
                }
                else
                {
                    Response.Write("<dt>" + node.res_name + "</dt>\n");
                }
                _count++;
                List <UserResBody> cNodes = base._userResBody.FindAll(delegate(UserResBody item) { return(item.parent_id == node.res_id); });
                foreach (UserResBody em in cNodes)
                {
                    //  if (!USysGroupDB.HasNode(base._sysGroupItems, base._currManager.IsSysUser ? "" : em.NodeCode))
                    //    continue;
                    string url = "javascript:void(0);";
                    if (!string.IsNullOrEmpty(em.res_src))
                    {
                        url = em.res_src;
                    }
                    Response.Write("<dd val=\"" + em.res_path + "\"><a href=\"" + url + "\" title=\"" + em.res_name + "\">" + em.res_name + "</a></dd>\n");
                }
            }
            Response.Write("</dl>\n");
        }
예제 #9
0
        public ActionResult SendVerifyCode()
        {
            if (Session["SendVerifyCodeTime"] != null)
            {
                try
                {
                    DateTime time = DateTime.Parse(Session["SendVerifyCodeTime"].ToString());
                    if (time.AddSeconds(60) > DateTime.Now)
                    {
                        return(Json(new { error = true, message = "请稍后再申请发送验证码" }));
                    }
                }
                catch (Exception)
                {
                    return(Json(new { error = true, message = "Error" }));
                }
            }
            int    type      = DoRequest.GetFormInt("sendType", 1);
            int    returnVal = -1;
            string msgText   = "";
            var    res       = SendManagerVerifyCode.Do(type);

            if (res != null && res.Header != null && res.Header.Result != null && res.Header.Result.Code != null)
            {
                returnVal = Utils.StrToInt(res.Header.Result.Code, -1);
                msgText   = res.Header.Result.Msg;
            }
            if (returnVal == 0)
            {
                Session["SendVerifyCodeTime"] = DateTime.Now;
            }
            return(Json(new { error = returnVal == 0 ? false : true, message = msgText, returnValue = returnVal }));
        }
예제 #10
0
        public ActionResult CheckYzm()
        {
            string code = DoRequest.GetFormString("code");

            string msg   = "系统错误";
            bool   error = true;

            if (string.IsNullOrEmpty(code))
            {
                return(Json(new { error = error, message = "验证码不能为空" }));
            }

            int           returnVal = -1;
            CheckCodeInfo info      = new CheckCodeInfo();
            var           res       = CheckManagerVerifyCode.Do(code);

            if (res != null && res.Header != null && res.Header.Result != null && res.Header.Result.Code != null)
            {
                returnVal = Utils.StrToInt(res.Header.Result.Code, -1);
                msg       = res.Header.Result.Msg;
                info      = res.Body;
            }

            string url = _config.UrlManager + "/Home/index";

            if (returnVal == 0)
            {
                Cookies.SaveLoginInfo(info.mobile_no, info.last_login_ip, info.last_login_time);
            }
            return(Json(new { error = returnVal == 0 ? false : true, message = msg, url = url }));
        }
예제 #11
0
        public ActionResult ResetMobile()
        {
            int    id        = DoRequest.GetFormInt("userid");
            string newmobile = DoRequest.GetFormString("newmobile");

            int returnValue = -1;
            var res         = ModifyUserMoblie.Do(id, newmobile);

            if (res != null && res.Header != null && res.Header.Result != null && res.Header.Result.Code != null)
            {
                returnValue = Utils.StrToInt(res.Header.Result.Code, -1);
            }
            if (returnValue == 0)
            {
                DoCache cache = new DoCache();
                cache.RemoveCacheStartsWith("user");
                return(Json(new { error = false, mobile = newmobile, message = "操作成功!" }));
            }
            if (returnValue == 135251)
            {
                return(Json(new { error = true, message = "该手机号,已经使用,请更换手机号!" }));
            }

            return(Json(new { error = true, message = "操作失败!" }));
        }
예제 #12
0
        public ActionResult PostRole()
        {
            int    id   = DoRequest.GetFormInt("roleid");
            string name = DoRequest.GetFormString("rolename").Trim();
            string desc = DoRequest.GetFormString("roledesc").Trim();
            int    type = DoRequest.GetFormInt("roletype", 2);

            RoleInfo role = new RoleInfo();

            role.role_id   = id;
            role.role_name = name;
            role.role_desc = desc;
            role.role_type = type;

            var returnValue = -1;
            var res         = OpRole.Do(role);

            if (res != null && res.Header != null && res.Header.Result != null && res.Header.Result.Code != null)
            {
                returnValue = Utils.StrToInt(res.Header.Result.Code, -1);
            }
            if (returnValue == 0)
            {
                DoCache cache = new DoCache();
                cache.RemoveCacheStartsWith("user");
                return(Json(new { error = false, message = "操作成功!" }));
            }

            return(Json(new { error = true, message = "操作失败" }));
        }
예제 #13
0
        public ActionResult PostInsuranceTypeData()
        {
            int    id            = DoRequest.GetFormInt("id");
            int    insurancetype = DoRequest.GetFormInt("insurancetype");
            string usertype      = DoRequest.GetFormString("usertype");

            #region Checking
            if (usertype.Length < 1)
            {
                return(Json(new { error = true, message = "【名称】用户类别不能为空" }));
            }
            #endregion
            int returnValue = -1;
            var res         = OpInsuranceTypeInfo.Do(id, insurancetype, usertype);
            if (res != null && res.Header != null && res.Header.Result != null && res.Header.Result.Code != null)
            {
                returnValue = Utils.StrToInt(res.Header.Result.Code, -1);
            }

            if (returnValue == 0)
            {
                return(Json(new { error = false, message = "操作成功" }));
            }

            return(Json(new { error = true, message = "操作失败" }));
        }
예제 #14
0
        public ActionResult PostCoupon()
        {
            int    userid    = DoRequest.GetFormInt("userid");
            string name      = DoRequest.GetFormString("couponname");
            string price     = DoRequest.GetFormString("couponvalue");
            int    couponnum = DoRequest.GetFormInt("couponnum");

            if (string.IsNullOrEmpty(name))
            {
                return(Json(new { error = true, message = "请输入优惠券名称!" }));
            }
            if (price.Equals("-1"))
            {
                return(Json(new { error = true, message = "请选择赠送优惠券的面值!" }));
            }
            if (couponnum <= 0)
            {
                return(Json(new { error = true, message = "请输入优惠券数量!" }));
            }
            int returnValue = -1;
            var res         = GiveUserCoupon.Do(userid, name, price, couponnum);

            if (res != null && res.Header != null && res.Header.Result != null && res.Header.Result.Code != null)
            {
                returnValue = Utils.StrToInt(res.Header.Result.Code, -1);
            }
            if (returnValue == 0)
            {
                return(Json(new { error = false, message = "操作成功!" }));
            }

            return(Json(new { error = true, message = "操作失败!" }));
        }
예제 #15
0
        //[HttpPost]
        public ActionResult GetClass()
        {
            string parentCode = DoRequest.Request("parentCode");
            string code       = DoRequest.Request("Code");

            List <PicTypeList> sysFClassList = new List <PicTypeList>();
            var restype = GetSysFileType.Do(-1);

            if (restype != null && restype.Body != null && restype.Body.type_list != null)
            {
                sysFClassList = restype.Body.type_list;
            }

            PicTypeList pInfo = sysFClassList.FindLast(delegate(PicTypeList item) { return(item.type_code.Equals(parentCode)); });
            PicTypeList tInfo = sysFClassList.FindLast(delegate(PicTypeList item) { return(item.type_code.Equals(code)); });

            if (pInfo == null)
            {
                pInfo = new PicTypeList();
            }
            if (tInfo == null)
            {
                tInfo = new PicTypeList();
            }
            if (tInfo.sp_type_id < 1)
            {
                List <PicTypeList> temList = sysFClassList.FindAll(delegate(PicTypeList item) { return(item.parent_code == parentCode); });
                tInfo.sort_no = 1;
                foreach (PicTypeList node in temList)
                {
                    if (tInfo.sort_no <= node.sort_no)
                    {
                        tInfo.sort_no += 1;
                    }
                }
            }

            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            string[] arr = pInfo.type_path.Split(',');
            sb.Append("根");
            foreach (string s in arr)
            {
                if (string.IsNullOrEmpty(s))
                {
                    continue;
                }
                //int val = Utils.StrToInt(s.Trim());
                List <PicTypeList> list = sysFClassList.FindAll(
                    delegate(PicTypeList item)
                {
                    return(item.type_code.Equals(s));
                });
                if (list.Count > 0)
                {
                    sb.Append(" >> " + list[0].sp_type_name);
                }
            }
            return(Json(new { parent = pInfo, type = tInfo, parentName = sb.ToString() }, JsonRequestBehavior.AllowGet));
        }
예제 #16
0
 public static void SetLocalAddress(string val)
 {
     DoRequest.SetCookie(LocalAddressCookieName
                         , HttpUtility.UrlEncode(Utils.ToUnicode(val))
                         , 1
                         , "d"
                         , config.Domain);
 }
예제 #17
0
        public ActionResult QuerySql()
        {
            UserResBody currResBody = new UserResBody();

            foreach (UserResBody item in base._userResBody)
            {
                if (item.res_path.Equals("0,1,108,238,239,"))
                {
                    currResBody = item;
                    break;
                }
            }

            HasPermission(currResBody.res_id);

            ViewData["currResBody"] = currResBody;//当前菜单
            string position = "";

            ViewData["pageTitle"] = base.FormatPageTile(currResBody, ref position);
            ViewData["position"]  = position;//页面位置

            string q = DoRequest.GetFormString("q", false);

            string state = DoRequest.GetFormString("database");

            List <string> colname  = new List <string>();
            DataTable     infoList = new DataTable();

            if (!q.Equals("") && q != null)
            {
                var resp = QueryDataBySql.Do(state, q);

                infoList = resp;

                if (infoList == null)
                {
                    infoList = new DataTable();
                }

                for (int i = 0; i < infoList.Columns.Count; i++)
                {
                    colname.Add(infoList.Columns[i].ColumnName);
                }
            }

            ViewData["colname"]  = colname;
            Session["colname"]   = colname;
            ViewData["infoList"] = infoList;//数据列表
            Session["infoList"]  = infoList;

            ViewData["sql"]  = q;
            ViewData["type"] = state;

            System.Text.StringBuilder currPageUrl = new System.Text.StringBuilder();//拼接当前页面URL
            currPageUrl.Append("/home/querysql");

            return(View());
        }
예제 #18
0
        public ActionResult List()
        {
            UserResBody currResBody = new UserResBody();

            foreach (UserResBody item in base._userResBody)
            {
                if (item.res_path.Equals("0,1,104,226,227,"))
                {
                    currResBody = item;
                    break;
                }
            }

            HasPermission(currResBody.res_id);
            ViewData["currResBody"] = currResBody;//当前菜单
            string position = "";

            ViewData["pageTitle"] = base.FormatPageTile(currResBody, ref position);
            ViewData["position"]  = position;//页面位置

            int pagesize  = DoRequest.GetQueryInt("size", 100);
            int pageindex = DoRequest.GetQueryInt("page", 1);
            int classid   = DoRequest.GetQueryInt("classid", -1);

            string q    = DoRequest.GetQueryString("q");
            string sKey = q;

            #region 文章列表
            int dataCount = 0;
            int pageCount = 0;
            List <ShortArticleInfo> _table = new List <ShortArticleInfo>();
            var res = QueryArticleList.Do(pagesize, pageindex
                                          , classid
                                          , sKey, ref dataCount, ref pageCount);
            if (res != null && res.Body != null && res.Body.article_list != null)
            {
                _table = res.Body.article_list;
            }
            ViewData["infoList"] = _table;                                           //文章列表

            System.Text.StringBuilder currPageUrl = new System.Text.StringBuilder(); //拼接当前页面URL
            currPageUrl.Append("/marticle/list?");
            currPageUrl.Append("&size=" + pagesize);
            currPageUrl.Append("&classid=" + classid);

            currPageUrl.Append("&q=" + DoRequest.UrlEncode(q));
            currPageUrl.Append("&page=" + pageindex);
            ViewData["currPageUrl"] = currPageUrl;//当前页面的URL
            ViewData["pagesize"]    = pagesize;
            ViewData["pageindex"]   = pageindex;
            ViewData["dataCount"]   = dataCount;

            ViewData["pageIndexLink"]  = this.FormatPageIndex(dataCount, pagesize, pageindex, currPageUrl.ToString());
            ViewData["pageIndexLink2"] = this.FormatPageIndex(dataCount, pagesize, pageindex, currPageUrl.ToString());
            #endregion

            return(View());
        }
예제 #19
0
        public ActionResult PostHomeType()
        {
            int posId = DoRequest.GetFormInt("posid");

            CategSetInfo categ    = new CategSetInfo();
            var          rescateg = GetHomeTypeById.Do(posId);

            if (rescateg != null && rescateg.Body != null)
            {
                categ = rescateg.Body;
            }

            if (categ == null)
            {
                categ.home_pt_id = 0;
            }
            else
            {
                categ.home_pt_id = posId;
            }

            categ.parent_id  = DoRequest.GetFormInt("pid");
            categ.type_name  = DoRequest.GetFormString("name");
            categ.type_url   = DoRequest.GetFormString("url");
            categ.sort_no    = DoRequest.GetFormInt("sort");
            categ.is_black   = DoRequest.GetFormInt("Isb") > 0 ? 1 : 0;
            categ.is_color   = DoRequest.GetFormInt("Iscolor") > 0 ? 1 : 0;
            categ.is_newline = DoRequest.GetFormInt("IsBr") > 0 ? 1 : 0;
            categ.pos_type   = DoRequest.GetFormInt("position1");

            if (categ.type_name.Length <= 0)
            {
                return(Json(new { error = true, message = "菜单名称不能为空" }));
            }
            if (categ.type_url.Length <= 0)
            {
                return(Json(new { error = true, message = "URL不能为空" }));
            }
            if (HasChinese(categ.type_url))
            {
                return(Json(new { error = true, message = "URL不能含中文!" }));
            }

            int rVal = -1;
            var res  = OpHomeType.Do(categ);

            if (res != null && res.Header != null && res.Header.Result != null && res.Header.Result.Code != null)
            {
                rVal = Utils.StrToInt(res.Header.Result.Code, -1);
            }
            if (rVal == 0)
            {
                return(Json(new { error = false, message = "操作成功" }));
            }

            return(Json(new { error = true, message = "操作失败" }));
        }
예제 #20
0
        public ActionResult PostRecommendPage()
        {
            int posId = DoRequest.GetFormInt("posid2");
            int flag  = DoRequest.GetFormInt("flag", 0);
            int plat  = DoRequest.GetFormInt("plat", 0);

            if (plat == 4)
            {
                plat = 6;
            }

            string posName = DoRequest.GetFormString("name");

            if (posName.Length < 1)
            {
                return(Json(new { error = true, message = "页面名称不能为空" }));
            }
            if (posName.Length > 50)
            {
                return(Json(new { error = true, message = "页面名称不能超过50个字符" }));
            }

            RecommendPositionInfo pos = new RecommendPositionInfo();
            var resrep = GetRecommendPositionInfo.Do(posId);

            if (resrep != null && resrep.Body != null)
            {
                pos = resrep.Body;
            }
            pos.rp_name = posName;
            if (flag == 0 && pos.rp_id > 0)
            {
                return(Json(new { error = true, message = "该位置ID已存在!" }));
            }
            if (pos.rp_id < 1)
            {
                pos.rp_id    = posId;
                pos.rp_code  = Guid.NewGuid().ToString().ToLower();
                pos.use_plat = plat;
            }
            pos.op_flag = flag;

            int rVal = -1;
            var res  = OpTopRecommendPosition.Do(pos);

            if (res != null && res.Header != null && res.Header.Result != null && res.Header.Result.Code != null)
            {
                rVal = Utils.StrToInt(res.Header.Result.Code, -1);
            }
            if (rVal == 0)
            {
                return(Json(new { error = false, message = "操作成功" }));
            }

            return(Json(new { error = true, message = "操作失败" }));
        }
예제 #21
0
        public ActionResult PostUserRole()
        {
            string roleids = DoRequest.GetFormString("roleids");
            int    userid  = DoRequest.GetFormInt("userid");

            List <UserRoleList> oldlist = new List <UserRoleList>();
            var reslist = GetUserRole.Do(userid);

            if (reslist != null && reslist.Body != null && reslist.Body.user_role_list != null)
            {
                oldlist = reslist.Body.user_role_list;
            }

            string[]   newidss = roleids.Split(',');
            List <int> newids  = new List <int>();

            foreach (string em in newidss)
            {
                newids.Add(Utils.StrToInt(em, 0));
            }

            string delids = "";
            int    _count = 0;

            foreach (UserRoleList em in oldlist)
            {
                if (!newids.Contains(em.role_id))
                {
                    if (_count == 0)
                    {
                        delids = em.role_id.ToString();
                    }
                    else
                    {
                        delids = delids + "," + em.role_id.ToString();
                    }
                }
            }
            if (delids.Equals(""))
            {
                delids = "0";
            }
            int returnValue = -1;
            var res         = OpUserRole.Do(userid, roleids, delids);

            if (res != null && res.Header != null && res.Header.Result != null && res.Header.Result.Code != null)
            {
                returnValue = Utils.StrToInt(res.Header.Result.Code, -1);
            }
            if (returnValue == 0)
            {
                return(Json(new { error = false, message = "操作成功!" }));
            }

            return(Json(new { error = true, message = "操作失败!" }));
        }
예제 #22
0
        /// <summary>
        /// 拼接验证字串
        /// </summary>
        /// <returns></returns>
        public static string CreateVerifyString()
        {
            StringBuilder sb          = new StringBuilder();
            string        loginString = "UID=" + LoginCookies.UserID.ToString() + "&Name=" + LoginCookies.UserName;
            string        code        = AES.Encode(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

            sb.Append("code=" + DoRequest.UrlEncode(code));
            sb.Append("&user=" + DoRequest.UrlEncode(AES.Encode(loginString)));
            return(sb.ToString());
        }
예제 #23
0
        public ActionResult ShopList()
        {
            UserResBody currResBody = new UserResBody();

            foreach (UserResBody item in base._userResBody)
            {
                if (item.res_path.Equals("0,1,107,119,123,"))
                {
                    currResBody = item;
                    break;
                }
            }

            HasPermission(currResBody.res_id);

            ViewData["currResBody"] = currResBody;//当前菜单
            string position = "";

            ViewData["pageTitle"] = base.FormatPageTile(currResBody, ref position);
            ViewData["position"]  = position;//页面位置

            int    pagesize  = DoRequest.GetQueryInt("size", 60);
            int    pageindex = DoRequest.GetQueryInt("page", 1);
            string q         = DoRequest.GetQueryString("q");
            int    dataCount = 0;
            int    pageCount = 0;
            List <ShortShopInfo> infoList = null;
            var resp = QueryShopList.Do(pagesize, pageindex, q, ref dataCount, ref pageCount);

            if (resp == null || resp.Body == null || resp.Body.shop_list == null)
            {
                infoList = new List <ShortShopInfo>();
            }
            else
            {
                infoList = resp.Body.shop_list;
            }

            ViewData["infoList"] = infoList;                                         //数据列表

            System.Text.StringBuilder currPageUrl = new System.Text.StringBuilder(); //拼接当前页面URL
            currPageUrl.Append("/musers/shoplist?");
            currPageUrl.Append("&size=" + pagesize);
            currPageUrl.Append("&page=" + pageindex);
            currPageUrl.Append("&q=" + DoRequest.UrlEncode(q));
            ViewData["currPageUrl"] = currPageUrl;//当前页面的URL
            ViewData["pagesize"]    = pagesize;
            ViewData["pageindex"]   = pageindex;
            ViewData["dataCount"]   = dataCount;

            ViewData["pageIndexLink"]  = this.FormatPageIndex(dataCount, pagesize, pageindex, currPageUrl.ToString());
            ViewData["pageIndexLink2"] = this.FormatPageIndex(dataCount, pagesize, pageindex, currPageUrl.ToString());

            return(View());
        }
예제 #24
0
        public ActionResult PostShopData()
        {
            int      shopid = DoRequest.GetFormInt("shopid");
            ShopInfo shop   = GetShopDetail.Do(shopid).Body;

            shop.shop_name    = DoRequest.GetFormString("shopName");
            shop.company_name = DoRequest.GetFormString("Company");
            shop.shop_key     = DoRequest.GetFormString("keyword");
            shop.shop_pswd    = DoRequest.GetFormString("psword");

            int province = DoRequest.GetFormInt("province");
            int city     = DoRequest.GetFormInt("city");

            shop.area_id   = province;
            shop.shop_addr = GetArea.Do(province).Body.area_list[0].area_name;
            string cityName = GetArea.Do(city).Body.area_list[0].area_name;

            if (!cityName.StartsWith("市辖") && !cityName.StartsWith("直辖"))
            {
                shop.shop_addr += cityName;
            }
            shop.link_way    = DoRequest.GetFormString("linkway");
            shop.shop_remark = DoRequest.GetFormString("remarks");

            #region Checking
            if (shop.shop_name.Length < 1)
            {
                return(Json(new { error = true, message = "[名称] 不能为空" }));
            }
            if (shop.shop_name.Length > 50)
            {
                return(Json(new { error = true, message = "[名称] 不能大于50个字符" }));
            }
            if (shop.company_name.Length < 0 && shop.company_name.Length > 100)
            {
                return(Json(new { error = true, message = "[公司] 不能为空或大于100个字符" }));
            }
            if (shop.area_id < 0)
            {
                return(Json(new { error = true, message = "[发货地址] 不能为空" }));
            }
            #endregion

            int returnValue = -1;

            returnValue = int.Parse(OpShopInfo.Do(shop).Header.Result.Code);

            if (returnValue == 0)
            {
                return(Json(new { error = false, message = "操作成功" }));
            }
            return(Json(new { error = true, message = "操作失败" }));
        }
예제 #25
0
        public ActionResult TypeList()
        {
            UserResBody currResBody = new UserResBody();

            foreach (UserResBody item in base._userResBody)
            {
                if (item.res_path.Equals("0,1,611,612,613,"))
                {
                    currResBody = item;
                    break;
                }
            }
            HasPermission(currResBody.res_id);

            ViewData["currResBody"] = currResBody;//当前菜单
            string position = "";

            ViewData["pageTitle"] = base.FormatPageTile(currResBody, ref position);
            ViewData["position"]  = position;//页面位置
            int insurancetype = DoRequest.GetQueryInt("insurancetype", 0);
            int pagesize      = DoRequest.GetQueryInt("size", 4);
            int pageindex     = DoRequest.GetQueryInt("page", 1);

            //string q = DoRequest.GetQueryString("q");
            //string sKey = q;

            #region 商保列表
            int dataCount = 0;
            int pageCount = 0;
            List <InsurancetypeInfo> _table = new List <InsurancetypeInfo>();
            var res = QueryInsuranceTypeList.Do(pagesize, pageindex, insurancetype, ref dataCount, ref pageCount);
            if (res != null && res.Body != null && res.Body.insusertype_list != null)
            {
                _table = res.Body.insusertype_list;
            }
            ViewData["infoList"] = _table;                                           //商保用户类别列表

            System.Text.StringBuilder currPageUrl = new System.Text.StringBuilder(); //拼接当前页面URL
            currPageUrl.Append("/minsurance/Typelist?");
            currPageUrl.Append("insurance_id=" + insurancetype);
            currPageUrl.Append("&size=" + pagesize);
            currPageUrl.Append("&page=" + pageindex);
            ViewData["currPageUrl"] = currPageUrl;//当前页面的URL
            ViewData["pagesize"]    = pagesize;
            ViewData["pageindex"]   = pageindex;
            ViewData["dataCount"]   = dataCount;

            ViewData["pageIndexLink"]  = this.FormatPageIndex(dataCount, pagesize, pageindex, currPageUrl.ToString());
            ViewData["pageIndexLink2"] = this.FormatPageIndex(dataCount, pagesize, pageindex, currPageUrl.ToString());
            #endregion

            return(View());
        }
예제 #26
0
        public ActionResult PostCategData()
        {
            int    parentId = DoRequest.GetFormInt("parentId");
            int    itemId   = DoRequest.GetFormInt("itemId");
            string name     = DoRequest.GetFormString("name").Trim();
            int    sort     = DoRequest.GetFormInt("sort", 0);

            #region Checking
            if (name.Length < 1)
            {
                return(Json(new { error = true, message = "【名称】不能为空" }));
            }
            if (name.Length > 50)
            {
                return(Json(new { error = true, message = "【名称】不能多于50个字符" }));
            }
            #endregion

            List <ArticleTypeInfo> tList = new List <ArticleTypeInfo>();
            var resart = GetArticleType.Do(0, 2, -1);
            if (resart != null && resart.Body != null && resart.Body.article_type_list != null)
            {
                tList = resart.Body.article_type_list;
            }

            ArticleTypeInfo tInfo = tList.Find(delegate(ArticleTypeInfo em)
            {
                return(em.article_type_id == itemId);
            });
            if (tInfo == null)
            {
                tInfo = new ArticleTypeInfo();
            }
            tInfo.article_type_id   = itemId;
            tInfo.parent_id         = parentId;
            tInfo.article_type_name = name;
            tInfo.sort_no           = sort;

            int returnValue = -1;
            var res         = OpArticleType.Do(tInfo);
            if (res != null && res.Header != null && res.Header.Result != null && res.Header.Result.Code != null)
            {
                returnValue = Utils.StrToInt(res.Header.Result.Code, -1);
            }

            if (returnValue == 0)
            {
                return(Json(new { error = false, message = "操作成功" }));
            }

            return(Json(new { error = true, message = "操作失败" }));
        }
예제 #27
0
        public ActionResult GetProductInfo2()
        {
            int productid            = DoRequest.GetFormInt("productid");
            ShortProductInfo product = new ShortProductInfo();
            var res = GetShortProductsByProductIds.Do(productid.ToString());

            if (res != null && res.Body != null && res.Body.product_list != null)
            {
                product = res.Body.product_list[0];
            }
            return(Json(product, JsonRequestBehavior.AllowGet));
            //return Json(new {productname=product.product_name, seotitle=product.seo_title, seotext=product.seo_text,seokey=product.seo_key }, JsonRequestBehavior.AllowGet);
        }
예제 #28
0
        public ActionResult GetProductSkuList()
        {
            int            productid = DoRequest.RequestInt("productid");
            List <SkuList> list      = new List <SkuList>();
            var            res       = GetSkusByProductId.Do(productid);

            if (res != null && res.Body != null && res.Body.sku_list != null)
            {
                list = res.Body.sku_list;
            }

            return(Json(new { data = list }, JsonRequestBehavior.AllowGet));
        }
예제 #29
0
        public ActionResult GetProductList2()
        {
            string ids = DoRequest.Request("ids");
            List <ShortProductInfo> list = new List <ShortProductInfo>();
            var res = GetShortProductsByProductIds.Do(ids);

            if (res != null && res.Body != null && res.Body.product_list != null)
            {
                list = res.Body.product_list;
            }
            foreach (ShortProductInfo item in list)
            {
                DateTime _sDate = DateTime.Parse(item.promotion_bdate);
                DateTime _eDate = DateTime.Parse(item.promotion_edate);
                if (_sDate <= DateTime.Now && DateTime.Now <= _eDate)
                {
                    item.sale_price = item.promotion_price;//促销价
                }
            }

            List <TypeList> tList = GetTypeListAll.Do(-1).Body.type_list;

            foreach (ShortProductInfo item in list)
            {
                string   path    = item.product_type_path;
                string[] _tem    = path.Split(',');
                int      _xCount = 0;
                for (int x = 0; x < _tem.Length; x++)
                {
                    if (string.IsNullOrEmpty(_tem[x].Trim()))
                    {
                        continue;
                    }
                    int _v = Utils.StrToInt(_tem[x].Trim());
                    foreach (TypeList em in tList)
                    {
                        if (em.product_type_id == _v)
                        {
                            if (_xCount > 0)
                            {
                                item.type_name += (" &gt;&gt; ");
                            }
                            item.type_name += (em.type_name);
                            _xCount++;
                        }
                    }
                }
            }

            return(Json(list, JsonRequestBehavior.AllowGet));
        }
예제 #30
0
        public ActionResult GetProductInfo()
        {
            int        productid = DoRequest.GetFormInt("productid");
            ProductSeo product   = new ProductSeo();
            var        res       = GetProductSeo.Do(productid);

            if (res != null && res.Body != null)
            {
                product = res.Body;
            }

            return(Json(product, JsonRequestBehavior.AllowGet));
            //return Json(new {productname=product.product_name, seotitle=product.seo_title, seotext=product.seo_text,seokey=product.seo_key }, JsonRequestBehavior.AllowGet);
        }