コード例 #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            int  num   = 0;
            long value = 0L;

            int.TryParse(this.txtNumber.Text, out num);
            long.TryParse(this.ddlStores.SelectedValue, out value);
            string text  = this.txtRemark.Text.Trim();
            string text2 = this.ddlStores.SelectedItem.Text;

            if (num <= 0)
            {
                this.ShowMsg("设备数量不能为空,设备数量只能输入正整数型数值!", false);
            }
            else if (this.ddlStores.SelectedIndex == 0)
            {
                this.ShowMsg("请选择放置的门店!", false);
            }
            else if (string.IsNullOrEmpty(text) || text.Length > 15)
            {
                this.ShowMsg("备注不能为空,长度必须小于或等于15个字符", false);
            }
            else
            {
                DeviceApplyResultJson deviceApplyResultJson = WXStoreHelper.ApplyEquipment(num, text, text, value);
                if (deviceApplyResultJson.errcode.Equals(ReturnCode.请求成功))
                {
                    HiCache.Remove("Devices");
                    this.ShowMsg("新增设备成功", true);
                }
            }
        }
コード例 #2
0
        public void GetWXStores()
        {
            int available_state_pass = 3;
            int num  = 0;
            int num2 = 50;
            List <GetStoreList_Business> list    = new List <GetStoreList_Business>();
            GetStoreListResultJson       poiList = WXStoreHelper.GetPoiList(num, num2);

            while (poiList.business_list.Count > 0)
            {
                list.AddRange(poiList.business_list);
                num    += num2;
                poiList = WXStoreHelper.GetPoiList(num, num2);
            }
            list = (from c in list
                    where c.base_info.available_state == available_state_pass
                    select c).ToList();
            list.Insert(0, new GetStoreList_Business
            {
                base_info = new GetStoreList_BaseInfo
                {
                    business_name = "请选择",
                    poi_id        = decimal.Zero.ToString()
                }
            });
            this.ddlStores.DataTextField  = "DataTextField";
            this.ddlStores.DataValueField = "DataValueField";
            this.ddlStores.DataSource     = (from c in list
                                             select new
            {
                DataTextField = ((c.base_info.poi_id == decimal.Zero.ToString()) ? c.base_info.business_name : (string.IsNullOrEmpty(c.base_info.branch_name) ? c.base_info.business_name : $"{c.base_info.business_name}({c.base_info.branch_name})")),
                DataValueField = c.base_info.poi_id
            }).ToList();
            this.ddlStores.DataBind();
        }
コード例 #3
0
        private DataGridViewModel <SearchDevices> GetDataList(HttpContext context)
        {
            int  num         = 1;
            int  num2        = 10;
            long EquipmentId = 0L;
            int  Status      = 0;

            num = base.GetIntParam(context, "page", false).Value;
            if (num < 1)
            {
                num = 1;
            }
            num2 = base.GetIntParam(context, "rows", false).Value;
            if (num2 < 1)
            {
                num2 = 10;
            }
            if (!string.IsNullOrEmpty(context.Request["Status"]))
            {
                Status = context.Request["Status"].ToInt(0);
            }
            DataGridViewModel <SearchDevices> dataGridViewModel = new DataGridViewModel <SearchDevices>();

            EquipmentId  = context.Request["EquipmentId"].ToLong(0);
            this.Devices = (from c in WXStoreHelper.GetAllDevices()
                            orderby c.status descending
                            select c).ToList();
            this.ConfigurationPages = WXStoreHelper.GetAllDevicesConfigurationPageNumber();
            int count = (num - 1) * num2;
            List <WXStoreHelper.Device> source = this.Devices;

            if (Status > -1)
            {
                source = (from c in source
                          where c.status == Status
                          select c).ToList();
            }
            if (EquipmentId > 0)
            {
                source = (from c in source
                          where c.device_id == EquipmentId
                          select c).ToList();
            }
            dataGridViewModel.total = source.Count();
            source = source.Skip(count).Take(num2).ToList();
            dataGridViewModel.rows = (from c in source
                                      select new SearchDevices
            {
                device_id = c.device_id,
                StoreName = c.poi_id.ToString(),
                LastTime = this.SetLastTime(c.last_active_time),
                Remark = c.comment,
                ConfigurationPageNumber = this.SetConfigurationPageNumber(c.device_id),
                WXDeviceStatusText = ((c.status == 1) ? "已激活" : "未激活"),
                major = c.major,
                minor = c.minor,
                uuid = c.uuid
            }).ToList();
            return(dataGridViewModel);
        }
コード例 #4
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string text    = this.txtTitle.Text.Trim();
            string text2   = this.txtSubtitle.Text.Trim();
            string text3   = this.txtURL.Text.Trim();
            string text4   = this.txtRemark.Text.Trim();
            string text5   = string.Empty;
            string empty   = string.Empty;
            string iconUrl = string.Empty;

            if (!string.IsNullOrEmpty(this.hidUploadLogo.Value))
            {
                text5 = this.hidUploadLogo.Value.Replace("//", "/");
            }
            if (string.IsNullOrEmpty(text) || text.Length > 100)
            {
                this.ShowMsg("主标题不能为空,长度必须小于或等于100个字符", false);
            }
            else if (string.IsNullOrEmpty(text2) || text2.Length > 100)
            {
                this.ShowMsg("副标题不能为空,长度必须小于或等于100个字符", false);
            }
            else if (string.IsNullOrEmpty(text3) || text3.Length > 300)
            {
                this.ShowMsg("跳转URL不能为空,长度必须小于或等于300个字符", false);
            }
            else if (string.IsNullOrEmpty(text4) || text4.Length > 100)
            {
                this.ShowMsg("备注不能为空,长度必须小于或等于100个字符", false);
            }
            else if (string.IsNullOrEmpty(text5))
            {
                this.ShowMsg("请上传缩略图", false);
            }
            else
            {
                System.Drawing.Image image = System.Drawing.Image.FromFile(HttpContext.Current.Server.MapPath(this.hidUploadLogo.Value));
                if (!image.Width.Equals(image.Height) || image.Height == 0 || image.Width == 0)
                {
                    this.ShowMsg("图片大小建议120px*120 px,限制不超过200 px *200 px,图片需为正方形。", false);
                }
                else
                {
                    image.Dispose();
                    empty = Globals.SaveFile("images", text5, "/Storage/master/store/", true, true, "");
                    UploadImageResultJson uploadImageResultJson = WXStoreHelper.UploadImageToWXShakeAShake(empty);
                    if (uploadImageResultJson.errcode.Equals(ReturnCode.请求成功))
                    {
                        iconUrl = uploadImageResultJson.data.pic_url;
                    }
                    AddPageResultJson addPageResultJson = WXStoreHelper.AddPage(text, text2, text3, iconUrl, text4);
                    if (addPageResultJson.errcode == ReturnCode.请求成功)
                    {
                        base.Response.Redirect("IbeaconPageList.aspx");
                    }
                }
            }
        }
コード例 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         this.AllStatistics = WXStoreHelper.GetAllStatistics();
         this.Devices       = WXStoreHelper.GetAllDevices();
         this.AllStores     = WXStoreHelper.GetAllPoiList();
     }
 }
コード例 #6
0
        private void BindCategoryParent()
        {
            IEnumerable <WXStoreHelper.WXCategory> category = WXStoreHelper.GetCategory();

            this.ddlCategoryParent.AutoPostBack   = true;
            this.ddlCategoryParent.DataTextField  = "FirstCategoryName";
            this.ddlCategoryParent.DataValueField = "FirstCategoryName";
            this.ddlCategoryParent.DataSource     = (from c in category
                                                     select new
            {
                c.FirstCategoryName
            }).Distinct().ToList();
            this.ddlCategoryParent.DataBind();
        }
コード例 #7
0
        private void BindCategoryChild()
        {
            IEnumerable <WXStoreHelper.WXCategory> category = WXStoreHelper.GetCategory();

            this.ddlCategoryChild.DataTextField  = "SecondCategoryName";
            this.ddlCategoryChild.DataValueField = "SecondCategoryName";
            this.ddlCategoryChild.DataSource     = (from c in category
                                                    where c.FirstCategoryName == this.ddlCategoryParent.SelectedValue
                                                    select new
            {
                c.SecondCategoryName
            }).Distinct().ToList();
            this.ddlCategoryChild.DataBind();
        }
コード例 #8
0
        public void Delete(HttpContext context)
        {
            string text = context.Request.Form["ids"];

            if (string.IsNullOrEmpty(text))
            {
                throw new HidistroAshxException("错误的参数");
            }
            WxJsonResult wxJsonResult = WXStoreHelper.DeletePage(text.ToLong(0));

            if (wxJsonResult.errcode.Equals(ReturnCode.请求成功))
            {
                base.ReturnSuccessResult(context, "删除成功!", 0, true);
            }
        }
コード例 #9
0
        private List <DeviceSearch_Data_Devices> DevicesInPage(long page_id)
        {
            List <DeviceSearch_Data_Devices> list = new List <DeviceSearch_Data_Devices>();
            int num  = 0;
            int num2 = 50;
            SearchPageResultJson searchPageResultJson = WXStoreHelper.SearchDevicesByPageId(page_id, num, num2);

            while (searchPageResultJson.data.relations.Count > 0)
            {
                num += num2;
                list.AddRange(searchPageResultJson.data.relations);
                searchPageResultJson = WXStoreHelper.SearchDevicesByPageId(page_id, num, num2);
            }
            return(list);
        }
コード例 #10
0
        private void BindData()
        {
            SearchPagesResultJson searchPagesResultJson = WXStoreHelper.SearchPagesByPageId(new long[1]
            {
                this.page_id
            });

            if (searchPagesResultJson.errcode.Equals(ReturnCode.请求成功) && searchPagesResultJson.data.pages.Count > 0)
            {
                SearchPages_Data_Page searchPages_Data_Page = searchPagesResultJson.data.pages[0];
                this.laTitle.Text          = searchPages_Data_Page.title;
                this.laSubtitle.Text       = searchPages_Data_Page.description;
                this.imgThumbnail.ImageUrl = searchPages_Data_Page.icon_url;
            }
        }
コード例 #11
0
        public void Delete(HttpContext context)
        {
            string      text = context.Request.Form["ids"];
            long        num  = context.Request["page_id"].ToLong(0);
            IList <int> list = new List <int>();

            string[] array = text.Split(',');
            foreach (string text2 in array)
            {
                if (!string.IsNullOrEmpty(text2))
                {
                    list.Add(text2.ToInt(0));
                }
            }
            if (string.IsNullOrEmpty(text))
            {
                throw new HidistroAshxException("请选择您要删除的设备");
            }
            bool   flag  = false;
            string text3 = text;
            int    num2  = 0;

            while (num2 < text3.Length)
            {
                char c = text3[num2];
                DeviceApply_Data_Device_Identifiers deviceApply_Data_Device_Identifiers = new DeviceApply_Data_Device_Identifiers();
                deviceApply_Data_Device_Identifiers.device_id = c;
                long[] pageIds = new long[1]
                {
                    num
                };
                WxJsonResult wxJsonResult = WXStoreHelper.BindPage(deviceApply_Data_Device_Identifiers, pageIds, ShakeAroundBindType.解除关联关系, ShakeAroundAppendType.覆盖);
                if (wxJsonResult.errcode.Equals(ReturnCode.请求成功))
                {
                    flag = true;
                    num2++;
                    continue;
                }
                flag = false;
                break;
            }
            if (flag)
            {
                base.ReturnSuccessResult(context, "删除成功!", 0, true);
                return;
            }
            throw new HidistroAshxException("删除失败");
        }
コード例 #12
0
        private IEnumerable <string> BuildImages(StringBuilder sbLocalImage, IList <string> lstFile)
        {
            string text = this.hidUploadImages.Value.Trim();

            string[] array = text.Split(',');
            for (int i = 0; i < array.Length; i++)
            {
                if (!string.IsNullOrEmpty(array[i]))
                {
                    string item = Globals.SaveFile("depot", array[i], "/Storage/master/", true, false, "");
                    lstFile.Add(item);
                }
            }
            sbLocalImage.Append(string.Join(",", lstFile.ToArray()));
            return(WXStoreHelper.ImageUploadForStore(lstFile));
        }
コード例 #13
0
        private DataGridViewModel <WXStoreHelper.SearchStatistics> GetDataList(HttpContext context)
        {
            DataGridViewModel <WXStoreHelper.SearchStatistics> dataGridViewModel = new DataGridViewModel <WXStoreHelper.SearchStatistics>();
            string calendarDate = string.Empty;
            string empty        = string.Empty;

            empty = context.Request["calendarDate"];
            if (!string.IsNullOrEmpty(empty))
            {
                calendarDate = empty;
            }
            List <WXStoreHelper.DataItemForDate> list = this.AllStatistics;

            if (calendarDate.ToDateTime() >= (DateTime?)DateTime.Now.Date)
            {
                throw new HidistroAshxException("请选择小于当天的日期");
            }
            this.AllStatistics = WXStoreHelper.GetAllStatistics();
            this.Devices       = WXStoreHelper.GetAllDevices();
            this.AllStores     = WXStoreHelper.GetAllPoiList();
            if (!string.IsNullOrEmpty(calendarDate))
            {
                list = (from c in list
                        where c.CurrentDate == calendarDate
                        select c).ToList();
            }
            if (list != null)
            {
                dataGridViewModel.total = list.Count;
                int count = (base.CurrentPageIndex - 1) * base.CurrentPageSize;
                list = list.Skip(count).Take(base.CurrentPageSize).ToList();
                dataGridViewModel.rows = (from c in list
                                          select new WXStoreHelper.SearchStatistics
                {
                    device_id = c.device_id,
                    shake_pv = c.shake_pv,
                    shake_uv = c.shake_uv,
                    click_pv = c.click_pv,
                    click_uv = c.click_uv,
                    StoreName = this.GetStoreName(c.device_id),
                    Remark = this.GetRemark(c.device_id),
                    CurrentDate = c.CurrentDate
                }).ToList();
            }
            return(dataGridViewModel);
        }
コード例 #14
0
        private void BindPage()
        {
            SearchPagesResultJson searchPagesResultJson = WXStoreHelper.SearchPagesByPageId(new long[1]
            {
                this.page_id
            });

            if (searchPagesResultJson.errcode.Equals(ReturnCode.请求成功) && searchPagesResultJson.data.pages.Count > 0)
            {
                SearchPages_Data_Page searchPages_Data_Page = searchPagesResultJson.data.pages[0];
                this.txtRemark.Text   = searchPages_Data_Page.comment;
                this.txtSubtitle.Text = searchPages_Data_Page.description;
                this.txtTitle.Text    = searchPages_Data_Page.title;
                this.txtURL.Text      = searchPages_Data_Page.page_url;
                this.hficon_url.Value = searchPages_Data_Page.icon_url;
            }
        }
コード例 #15
0
        public void Eidt(HttpContext context)
        {
            long num = context.Request.Form["ids"].ToLong(0);

            if (num < 0)
            {
                throw new HidistroAshxException("错误的参数");
            }
            string text = context.Request["Remark"];

            if (string.IsNullOrEmpty(text) || text.Length > 15)
            {
                throw new HidistroAshxException("设备的备注信息,不超过15个汉字或30个英文字母。");
            }
            WxJsonResult wxJsonResult = WXStoreHelper.DeviceUpdate(num, text);

            if (wxJsonResult.errcode.Equals(ReturnCode.请求成功))
            {
                base.ReturnSuccessResult(context, "修改备注成功!", 0, true);
            }
        }
コード例 #16
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string text = base.Request.Form["CheckBoxGroup"];

            if (string.IsNullOrEmpty(text))
            {
                this.ShowMsg("请选择一台设备!", false);
            }
            else
            {
                List <long> devices = new List <long>();
                text.Split(',').ForEach(delegate(string c)
                {
                    devices.Add(c.ToLong(0));
                });
                bool flag = true;
                foreach (long item in devices)
                {
                    DeviceApply_Data_Device_Identifiers deviceApply_Data_Device_Identifiers = new DeviceApply_Data_Device_Identifiers();
                    deviceApply_Data_Device_Identifiers.device_id = item;
                    long[] pageIds = new long[1]
                    {
                        this.page_id
                    };
                    WxJsonResult wxJsonResult = WXStoreHelper.BindPage(deviceApply_Data_Device_Identifiers, pageIds, ShakeAroundBindType.建立关联关系, ShakeAroundAppendType.新增);
                    if (!wxJsonResult.errcode.Equals(ReturnCode.请求成功))
                    {
                        flag = false;
                    }
                }
                if (flag)
                {
                    base.CloseWindow(null);
                }
                else
                {
                    this.ShowMsg("选择的设备没有配置成功!", false);
                }
            }
        }
コード例 #17
0
        private DataGridViewModel <SearchDevices> GetDataList(HttpContext context)
        {
            DataGridViewModel <SearchDevices> dataGridViewModel = new DataGridViewModel <SearchDevices>();
            int  num  = 1;
            int  num2 = 10;
            long num3 = 0L;

            num = base.GetIntParam(context, "page", false).Value;
            if (num < 1)
            {
                num = 1;
            }
            num2 = base.GetIntParam(context, "rows", false).Value;
            if (num2 < 1)
            {
                num2 = 10;
            }
            num3           = context.Request["page_id"].ToLong(0);
            this.AllStores = WXStoreHelper.GetAllPoiList();
            this.Devices   = (from c in WXStoreHelper.GetAllDevices()
                              orderby c.status descending
                              select c).ToList();
            this.ConfigurationPages = WXStoreHelper.GetAllDevicesConfigurationPageNumber();
            int begin = (num - 1) * num2;
            SearchPageResultJson searchPageResultJson = WXStoreHelper.SearchDevicesByPageId(num3, begin, num2);

            if (searchPageResultJson.errcode.Equals(ReturnCode.请求成功))
            {
                dataGridViewModel.rows = (from c in searchPageResultJson.data.relations
                                          select new SearchDevices
                {
                    device_id = c.device_id,
                    StoreName = this.SetStoreName(c.device_id),
                    Remark = c.comment,
                    EquipmentExistsNumber = this.SetConfigurationPageNumber(c.device_id)
                }).ToList();
                dataGridViewModel.total = searchPageResultJson.data.total_count;
            }
            return(dataGridViewModel);
        }
コード例 #18
0
        private void Save()
        {
            StringBuilder  sbLocalImage = new StringBuilder();
            IList <string> list         = new List <string>();
            StoresInfo     storeById    = StoresHelper.GetStoreById(this.storeId);

            if (!storeById.WXState.HasValue)
            {
                this.AddWXStore();
            }
            else if (storeById.WXState.HasValue && storeById.WXState.Value.Equals(WXStoreState.Pass))
            {
                IEnumerable <string> enumerable      = this.BuildImages(sbLocalImage, list);
                UpdateStoreData      updateStoreData = new UpdateStoreData();
                foreach (string item in enumerable)
                {
                    updateStoreData.business.base_info.photo_list.Add(new Store_Photo
                    {
                        photo_url = item
                    });
                }
                updateStoreData.business.base_info.avg_price    = this.txtWXAvgPrice.Text.ToInt(0);
                updateStoreData.business.base_info.introduction = this.txtWXIntroduction.Text.Trim();
                updateStoreData.business.base_info.open_time    = this.txtWXOpenTime.Text.Trim();
                updateStoreData.business.base_info.recommend    = this.txtWXRecommend.Text.Trim();
                updateStoreData.business.base_info.poi_id       = (storeById.WXPoiId.HasValue ? storeById.WXPoiId.Value.ToString() : string.Empty);
                updateStoreData.business.base_info.special      = this.txtWXSpecial.Text.Trim();
                updateStoreData.business.base_info.telephone    = this.txtWXTelephone.Text.Trim();
                WXStoreHelper.UpdateWXStore(updateStoreData);
                storeById.StoreImages = ((list.Count == 0) ? string.Empty : string.Join(",", list.ToArray()));
                StoresHelper.UpdateWXStore(updateStoreData, storeById.StoreId, storeById.StoreImages);
            }
            else
            {
                this.ShowMsg("微信门店审核中不能修改", false);
            }
        }
コード例 #19
0
        private DataGridViewModel <SerachPagesInfo> GetDataList(HttpContext context)
        {
            DataGridViewModel <SerachPagesInfo> dataGridViewModel = new DataGridViewModel <SerachPagesInfo>();
            int num  = 1;
            int num2 = 10;

            num = base.GetIntParam(context, "page", false).Value;
            if (num < 1)
            {
                num = 1;
            }
            num2 = base.GetIntParam(context, "rows", false).Value;
            if (num2 < 1)
            {
                num2 = 10;
            }
            int count = (num - 1) * num2;

            this.Pages = WXStoreHelper.GetAllPages();
            this.ConfigurationDevices = WXStoreHelper.GetAllPagesConfigurationDeviceNumber();
            dataGridViewModel.total   = this.Pages.Count;
            dataGridViewModel.rows    = (from c in this.Pages
                                         select new SerachPagesInfo
            {
                page_id = c.page_id,
                comment = c.comment,
                description = c.description,
                icon_url = c.icon_url,
                page_url = c.page_url,
                title = c.title,
                quantity = this.GetDevicesQuantity(c.page_id)
            } into c
                                         orderby c.quantity descending
                                         select c).Skip(count).Take(num2).ToList();
            return(dataGridViewModel);
        }
コード例 #20
0
        private void AddWXStore()
        {
            SiteSettings    masterSettings  = SettingsManager.GetMasterSettings();
            StoresInfo      storeById       = StoresHelper.GetStoreById(this.storeId);
            IList <string>  list            = new List <string>();
            CreateStoreData createStoreData = new CreateStoreData();
            string          text            = this.hidUploadImages.Value.Trim();

            string[] array = text.Split(',');
            for (int i = 0; i < array.Length; i++)
            {
                if (!string.IsNullOrEmpty(array[i]))
                {
                    string item = Globals.SaveFile("depot", array[i], "/Storage/master/", true, false, "");
                    list.Add(item);
                }
            }
            IEnumerable <string> enumerable = WXStoreHelper.ImageUploadForStore(list);

            foreach (string item2 in enumerable)
            {
                createStoreData.business.base_info.photo_list.Add(new Store_Photo
                {
                    photo_url = item2
                });
            }
            string        address = this.txtWxAddress.Text.Trim();
            List <string> list2   = RegionHelper.GetFullRegion(storeById.RegionId, ",", true, 0).Split(',').Take(3)
                                    .ToList();

            list2.ForEach(delegate(string c)
            {
                address = address.Replace(c, string.Empty);
            });
            createStoreData.business.base_info.address       = address;
            createStoreData.business.base_info.avg_price     = this.txtWXAvgPrice.Text.ToInt(0);
            createStoreData.business.base_info.branch_name   = storeById.StoreName;
            createStoreData.business.base_info.business_name = masterSettings.SiteName;
            createStoreData.business.base_info.categories    = new string[1]
            {
                $"{this.ddlCategoryParent.SelectedValue.Trim()},{this.ddlCategoryChild.SelectedValue.Trim()}"
            };
            createStoreData.business.base_info.city         = list2[1];
            createStoreData.business.base_info.district     = this.hfDistrict.Value;
            createStoreData.business.base_info.introduction = this.txtWXIntroduction.Text.Trim();
            createStoreData.business.base_info.latitude     = this.hfLatitude.Value;
            createStoreData.business.base_info.longitude    = this.hfLongitude.Value;
            createStoreData.business.base_info.offset_type  = 1;
            createStoreData.business.base_info.open_time    = this.txtWXOpenTime.Text.Trim();
            createStoreData.business.base_info.province     = list2[0];
            createStoreData.business.base_info.recommend    = this.txtWXRecommend.Text.Trim();
            createStoreData.business.base_info.special      = this.txtWXSpecial.Text.Trim();
            createStoreData.business.base_info.telephone    = this.txtWXTelephone.Text.Trim();
            storeById.StoreImages = ((list.Count == 0) ? string.Empty : string.Join(",", list.ToArray()));
            createStoreData.business.base_info.sid = this.storeId.ToString();
            WxJsonResult wxJsonResult = WXStoreHelper.CreateWXStore(createStoreData);

            if (wxJsonResult.errcode.Equals(ReturnCode.请求成功))
            {
                StoresHelper.FirstAddWXStore(createStoreData, this.storeId, storeById.StoreImages);
            }
            this.ShowMsg("添加成功,等待微信审核", true, "StoresList.aspx");
        }
コード例 #21
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            SiteSettings    masterSettings  = SettingsManager.GetMasterSettings();
            StoresInfo      storeById       = StoresHelper.GetStoreById(this.storeId);
            IList <string>  list            = new List <string>();
            CreateStoreData createStoreData = new CreateStoreData();

            if (string.IsNullOrEmpty(this.txtWxAddress.Text.Trim()) || this.txtWxAddress.Text.Trim().Length > 50)
            {
                this.ShowMsg("微信门店地址不能为空长度必须为2-50个字符", false);
            }
            else
            {
                string text = $"{this.ddlCategoryParent.SelectedValue.Trim()},{this.ddlCategoryChild.SelectedValue.Trim()}";
                if (string.IsNullOrEmpty(text) || text.Length > 50)
                {
                    this.ShowMsg("类目不能为空,长度必须为2-50个字符", false);
                }
                else if (string.IsNullOrEmpty(this.txtWXTelephone.Text.Trim()) || this.txtWXTelephone.Text.Trim().Length > 25)
                {
                    this.ShowMsg("电话不能为空,长度必须为2-50个字符", false);
                }
                else if (!string.IsNullOrEmpty(this.txtWXAvgPrice.Text.Trim()) && this.txtWXAvgPrice.Text.Trim().ToInt(0) <= 0)
                {
                    this.ShowMsg("人均价格必须大于零的整数,须如实填写,默认单位为人民币", false);
                }
                else
                {
                    string text2 = this.txtWXOpenTime.Text.Trim();
                    if (!string.IsNullOrEmpty(text2) && text2.Split('-').Length != 2)
                    {
                        this.ShowMsg("营业时间如,10:00-21:00", false);
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(text2))
                        {
                            DateTime minValue = DateTime.MinValue;
                            string[] array    = text2.Split('-');
                            if (!DateTime.TryParse(array[0], out minValue) || !DateTime.TryParse(array[1], out minValue))
                            {
                                this.ShowMsg("营业时间如,10:00-21:00", false);
                                return;
                            }
                        }
                        if (!string.IsNullOrEmpty(this.txtWXRecommend.Text.Trim()) && this.txtWXRecommend.Text.Trim().Length > 150)
                        {
                            this.ShowMsg("推荐长度必须为2-150个字符", false);
                        }
                        else if (!string.IsNullOrEmpty(this.txtWXSpecial.Text.Trim()) && this.txtWXSpecial.Text.Trim().Length > 150)
                        {
                            this.ShowMsg("特色服务必须为2-150个字符", false);
                        }
                        else if (!string.IsNullOrEmpty(this.txtWXIntroduction.Text.Trim()) && this.txtWXIntroduction.Text.Trim().Length > 150)
                        {
                            this.ShowMsg("简介必须为2-150个字符", false);
                        }
                        else
                        {
                            string   text3  = this.hidUploadImages.Value.Trim();
                            string[] array2 = text3.Split(',');
                            for (int i = 0; i < array2.Length; i++)
                            {
                                if (!string.IsNullOrEmpty(array2[i]))
                                {
                                    string item = Globals.SaveFile("depot", array2[i], "/Storage/master/", true, false, "");
                                    list.Add(item);
                                }
                            }
                            IEnumerable <string> enumerable = WXStoreHelper.ImageUploadForStore(list);
                            foreach (string item2 in enumerable)
                            {
                                createStoreData.business.base_info.photo_list.Add(new Store_Photo
                                {
                                    photo_url = item2
                                });
                            }
                            string        address = this.txtWxAddress.Text.Trim();
                            List <string> list2   = RegionHelper.GetFullRegion(storeById.RegionId, ",", true, 0).Split(',').Take(3)
                                                    .ToList();
                            list2.ForEach(delegate(string c)
                            {
                                address = address.Replace(c, string.Empty);
                            });
                            createStoreData.business.base_info.address       = address;
                            createStoreData.business.base_info.avg_price     = this.txtWXAvgPrice.Text.ToInt(0);
                            createStoreData.business.base_info.branch_name   = storeById.StoreName;
                            createStoreData.business.base_info.business_name = masterSettings.SiteName;
                            createStoreData.business.base_info.categories    = new string[1]
                            {
                                $"{this.ddlCategoryParent.SelectedValue.Trim()},{this.ddlCategoryChild.SelectedValue.Trim()}"
                            };
                            createStoreData.business.base_info.city         = list2[1];
                            createStoreData.business.base_info.district     = this.hfDistrict.Value;
                            createStoreData.business.base_info.introduction = this.txtWXIntroduction.Text.Trim();
                            createStoreData.business.base_info.latitude     = this.hfLatitude.Value;
                            createStoreData.business.base_info.longitude    = this.hfLongitude.Value;
                            createStoreData.business.base_info.offset_type  = 1;
                            createStoreData.business.base_info.open_time    = this.txtWXOpenTime.Text.Trim();
                            createStoreData.business.base_info.province     = list2[0];
                            createStoreData.business.base_info.recommend    = this.txtWXRecommend.Text.Trim();
                            createStoreData.business.base_info.special      = this.txtWXSpecial.Text.Trim();
                            createStoreData.business.base_info.telephone    = this.txtWXTelephone.Text.Trim();
                            storeById.StoreImages = ((list.Count == 0) ? string.Empty : string.Join(",", list.ToArray()));
                            createStoreData.business.base_info.sid = this.storeId.ToString();
                            WxJsonResult wxJsonResult = WXStoreHelper.CreateWXStore(createStoreData);
                            if (wxJsonResult.errcode.Equals(ReturnCode.请求成功))
                            {
                                StoresHelper.FirstAddWXStore(createStoreData, this.storeId, storeById.StoreImages);
                            }
                            this.ShowMsg("添加成功,等待微信审核", true, "StoresList.aspx");
                        }
                    }
                }
            }
        }