예제 #1
0
        public void ResetForm(int StoreID)
        {
            IList <DeliveryScopeInfo> storeDeliveryScop = StoresHelper.GetStoreDeliveryScop(StoreID);
            string text  = "";
            string text2 = "";

            foreach (DeliveryScopeInfo item in storeDeliveryScop)
            {
                text  = text + item.RegionId + ",";
                text2 = text2 + item.RegionName + ",";
            }
            text  = text.TrimEnd(',');
            text2 = text2.TrimEnd(',');
            this.txtRegionScop.Value     = text;
            this.txtRegionScopName.Value = text2;
        }
예제 #2
0
        public static string GetStoreDeliveryScop(object StoreID)
        {
            int storeID = 0;

            if (!int.TryParse(StoreID.ToString(), out storeID))
            {
                return("");
            }
            IList <DeliveryScopeInfo> storeDeliveryScop = StoresHelper.GetStoreDeliveryScop(storeID);
            string text  = "";
            string text2 = "";

            foreach (DeliveryScopeInfo item in storeDeliveryScop)
            {
                text  = text + item.RegionId + ",";
                text2 = text2 + item.RegionName + ",";
            }
            text = text.TrimEnd(',');
            return(text2.TrimEnd(','));
        }
예제 #3
0
        public void BindData()
        {
            StoresInfo  storeById   = StoresHelper.GetStoreById(this.storeId);
            ManagerInfo managerInfo = ManagerHelper.FindManagerByStoreId(this.storeId, SystemRoles.StoreAdmin);

            if (storeById == null)
            {
                base.Response.Redirect("StoresList.aspx");
            }
            else
            {
                DbQueryResult storeDeliveryScop = StoresHelper.GetStoreDeliveryScop(new DeliveryScopeQuery
                {
                    StoreId   = storeById.StoreId,
                    PageIndex = 1,
                    PageSize  = 2147483647
                });
                this.repStoreDeliveryScop.DataSource = storeDeliveryScop.Data;
                this.repStoreDeliveryScop.DataBind();
                this.lblState.Text        = (storeById.State.Equals(0) ? "关闭" : "开启");
                this.lblUserName.Text     = managerInfo.UserName;
                this.lblStoreName.Text    = storeById.StoreName;
                this.lblRegions.Text      = RegionHelper.GetFullRegion(storeById.RegionId, string.Empty, true, 0);
                this.lblAddress.Text      = storeById.Address;
                this.lblContactMan.Text   = storeById.ContactMan;
                this.lblTel.Text          = storeById.Tel;
                this.lblCategoryName.Text = storeById.WXCategoryName;
                Literal literal  = this.lblServeRadius;
                double? nullable = storeById.ServeRadius;
                literal.Text = nullable.ToString();
                this.lblStoreOpenTime.Text  = (string.IsNullOrEmpty(storeById.StoreOpenTime) ? "无" : storeById.StoreOpenTime);
                this.lblIsAboveSelf.Text    = (storeById.IsAboveSelf ? "是" : "否");
                this.lblWXBusinessName.Text = storeById.WXBusinessName;
                this.lblWXBranchName.Text   = storeById.WXBranchName;
                this.lblWxAddress.Text      = storeById.WxAddress;
                HiddenField hiddenField = this.hfLongitude;
                nullable          = storeById.Longitude;
                hiddenField.Value = nullable.ToString();
                HiddenField hiddenField2 = this.hfLatitude;
                nullable                 = storeById.Latitude;
                hiddenField2.Value       = nullable.ToString();
                this.lblWXTelephone.Text = storeById.WXTelephone;
                Literal literal2  = this.lblWXAvgPrice;
                int?    nullable2 = storeById.WXAvgPrice;
                literal2.Text               = nullable2.ToString();
                this.lblWXOpenTime.Text     = storeById.WXOpenTime;
                this.lblWXRecommend.Text    = storeById.WXRecommend;
                this.lblWXSpecial.Text      = storeById.WXSpecial;
                this.lblWXIntroduction.Text = storeById.WXIntroduction;
                HiddenField hiddenField3 = this.hidIsWX;
                nullable2          = storeById.WXState;
                hiddenField3.Value = nullable2.ToString();
                if (!string.IsNullOrEmpty(storeById.StoreImages))
                {
                    string[] array = storeById.StoreImages.Split(',');
                    foreach (string text in array)
                    {
                        if (!string.IsNullOrEmpty(text.Trim()))
                        {
                            Literal literal3 = this.lblImages;
                            literal3.Text += $"<img src='{text}' width='98' height='98' style='padding:0 10px;'/>";
                        }
                    }
                }
            }
        }
예제 #4
0
        public void BindData()
        {
            StoresInfo  storeById   = StoresHelper.GetStoreById(this.storeId);
            ManagerInfo managerInfo = ManagerHelper.FindManagerByStoreId(this.storeId, SystemRoles.StoreAdmin);

            if (storeById == null)
            {
                base.Response.Redirect("StoresList.aspx");
            }
            else
            {
                string empty  = string.Empty;
                string empty2 = string.Empty;
                if (!string.IsNullOrEmpty(storeById.WXCategoryName))
                {
                    empty  = storeById.WXCategoryName.Split(',')[0];
                    empty2 = storeById.WXCategoryName.Split(',')[1];
                }
                this.editDescription.Text = storeById.Introduce;
                HiddenField hiddenField = this.hidOldRegion;
                int         num         = storeById.RegionId;
                hiddenField.Value = num.ToString();
                IEnumerable <string> values = RegionHelper.GetFullRegion(storeById.RegionId, ",", true, 0).Split(',').Take(3);
                this.hfProvinceCityArea.Value = string.Join(",", values);
                HiddenField hiddenField2 = this.hidOldAddress;
                TrimTextBox trimTextBox  = this.txtAddress;
                string      text3        = hiddenField2.Value = (trimTextBox.Text = string.Join(string.Empty, values) + storeById.Address);
                this.txtContactMan.Text = storeById.ContactMan;
                IList <DeliveryScopeInfo> storeDeliveryScop = StoresHelper.GetStoreDeliveryScop(storeById.StoreId);
                string text4 = "";
                string text5 = "";
                this.chkOfflinePay.Checked     = storeById.IsOfflinePay;
                this.chkOnlinePay.Checked      = storeById.IsOnlinePay;
                this.chkCashOnDelivery.Checked = storeById.IsCashOnDelivery;
                foreach (DeliveryScopeInfo item in storeDeliveryScop)
                {
                    text4 = text4 + item.RegionId + ",";
                    text5 = text5 + item.RegionName + ",";
                }
                text4 = text4.TrimEnd(',');
                text5 = text5.TrimEnd(',');
                this.txtRegionScop.Value     = text4;
                this.txtRegionScopName.Value = text5;
                this.txtStoresName.Text      = storeById.StoreName;
                this.txtTel.Text             = storeById.Tel;
                this.labStoreUserName.Text   = managerInfo.UserName;
                this.dropRegion.SetSelectedRegionId(storeById.RegionId);
                this.hidOldImages.Value = storeById.StoreImages;
                HiddenField hiddenField3 = this.hidOldLatitude;
                HiddenField hiddenField4 = this.hfLatitude;
                double?     nullable     = storeById.Latitude;
                object      text6;
                double      value;
                if (!nullable.HasValue)
                {
                    text6 = string.Empty;
                }
                else
                {
                    nullable = storeById.Latitude;
                    value    = nullable.Value;
                    text6    = value.ToString();
                }
                text3 = (string)text6;
                hiddenField4.Value = (string)text6;
                hiddenField3.Value = text3;
                HiddenField hiddenField5 = this.hidOldLongitude;
                HiddenField hiddenField6 = this.hfLongitude;
                nullable = storeById.Longitude;
                object text7;
                if (!nullable.HasValue)
                {
                    text7 = string.Empty;
                }
                else
                {
                    nullable = storeById.Longitude;
                    value    = nullable.Value;
                    text7    = value.ToString();
                }
                text3 = (string)text7;
                hiddenField6.Value = (string)text7;
                hiddenField5.Value = text3;
                if (!string.IsNullOrEmpty(storeById.StoreOpenTime))
                {
                    string[] array  = storeById.StoreOpenTime.Split('-');
                    string[] array2 = array[0].Split(':');
                    this.txtStoreOpenTimeStartH.Text = array2[0];
                    this.txtStoreOpenTimeStartM.Text = ((array2.Length > 1) ? array2[1] : "");
                    if (array.Length > 1)
                    {
                        string[] array3 = array[1].Split(':');
                        this.txtStoreOpenTimeEndH.Text = array3[0];
                        this.txtStoreOpenTimeEndM.Text = ((array3.Length > 1) ? array3[1] : "");
                    }
                }
                this.chkIsAboveSelf.Checked      = storeById.IsAboveSelf;
                this.chkIsSupportExpress.Checked = storeById.IsSupportExpress;
                this.chkIsStoreDelive.Checked    = storeById.IsStoreDelive;
                TrimTextBox trimTextBox2 = this.txtServeRadius;
                nullable          = storeById.ServeRadius;
                trimTextBox2.Text = nullable.ToString();
                TrimTextBox trimTextBox3 = this.txtMinOrderPrice;
                object      text8;
                if (storeById.MinOrderPrice.HasValue)
                {
                    num   = storeById.MinOrderPrice.ToInt(0);
                    text8 = num.ToString();
                }
                else
                {
                    text8 = "";
                }
                trimTextBox3.Text = (string)text8;
                TrimTextBox trimTextBox4 = this.txtStoreFreight;
                object      text9;
                if (storeById.StoreFreight.HasValue)
                {
                    num   = storeById.StoreFreight.ToInt(0);
                    text9 = num.ToString();
                }
                else
                {
                    text9 = "";
                }
                trimTextBox4.Text           = (string)text9;
                this.txtCommissionRate.Text = storeById.CommissionRate.ToString();
                IList <int> storeTags = StoresHelper.GetStoreTags(this.storeId);
                this.litralStoreTag.SelectedValue = storeTags;
                if (storeTags != null && storeTags.Count > 0)
                {
                    foreach (int item2 in storeTags)
                    {
                        TrimTextBox trimTextBox5 = this.txtStoreTag;
                        trimTextBox5.Text = trimTextBox5.Text + item2.ToString() + ",";
                    }
                    this.txtStoreTag.Text = this.txtStoreTag.Text.Substring(0, this.txtStoreTag.Text.Length - 1);
                }
            }
        }
예제 #5
0
        public void BindData()
        {
            ManagerInfo manager   = HiContext.Current.Manager;
            StoresInfo  storeById = StoresHelper.GetStoreById(manager.StoreId);

            this.txtAddress.Text    = storeById.Address;
            this.txtContactMan.Text = storeById.ContactMan;
            IList <DeliveryScopeInfo> storeDeliveryScop = StoresHelper.GetStoreDeliveryScop(storeById.StoreId);
            string text  = "";
            string text2 = "";

            foreach (DeliveryScopeInfo item in storeDeliveryScop)
            {
                text  = text + item.RegionId + ",";
                text2 = text2 + item.RegionName + ",";
            }
            text  = text.TrimEnd(',');
            text2 = text2.TrimEnd(',');
            this.txtRegionScop.Value     = text;
            this.txtRegionScopName.Value = text2;
            this.txtStoresName.Text      = storeById.StoreName;
            this.txtTel.Text             = storeById.Tel;
            this.txtUserName.Text        = manager.UserName;
            this.txtUserName.Enabled     = false;
            this.dropRegion.SetSelectedRegionId(storeById.RegionId);
            if (string.IsNullOrEmpty(storeById.WxOpenId))
            {
                this.reGetOpenId.Style.Add("display", "none");
            }
            else
            {
                this.getOpenId.Style.Add("display", "none");
            }
            this.txtWxOpenId.Text = storeById.WxOpenId;
            IList <string> storeTagNames = StoresHelper.GetStoreTagNames(manager.StoreId);
            string         text3         = "";

            foreach (string item2 in storeTagNames)
            {
                text3 = text3 + item2 + "&nbsp;&nbsp;";
            }
            this.lblStoreTag.Text = text3;
            if (text3 == "")
            {
                this.liStoreTag.Visible = false;
            }
            string text4 = "";

            if (storeById.IsSupportExpress)
            {
                text4 += "快递配送&nbsp;&nbsp;";
            }
            if (storeById.IsAboveSelf)
            {
                text4 += "上门自提&nbsp;&nbsp;";
            }
            if (storeById.IsStoreDelive)
            {
                text4 += "门店配送&nbsp;&nbsp;";
            }
            else
            {
                this.liServeRadius.Visible   = false;
                this.liStoreFreight.Visible  = false;
                this.liMinOrderPrice.Visible = false;
                this.liScopTitle.Visible     = false;
                this.liScop.Visible          = false;
            }
            this.lblDeliveMode.Text    = text4;
            this.editDescription.Text  = storeById.Introduce;
            this.lblServeRadius.Text   = storeById.ServeRadius.ToString() + "&nbsp;KM(公里)";
            this.lblMinOrderPrice.Text = storeById.MinOrderPrice.ToDecimal(0).F2ToString("f2") + "&nbsp;元";
            this.lblStoreFreight.Text  = storeById.StoreFreight.ToDecimal(0).F2ToString("f2") + "&nbsp;元";
            string   text5    = (storeById.OpenEndDate < storeById.OpenStartDate) ? "次日" : "";
            Label    label    = this.lblStoreOpenTime;
            DateTime dateTime = storeById.OpenStartDate;
            string   str      = dateTime.ToString("HH:mm");
            string   str2     = text5;

            dateTime   = storeById.OpenEndDate;
            label.Text = str + "-" + str2 + dateTime.ToString("HH:mm");
        }