Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (PubFunction.ISCheckKey)
     {
         if (PubFunction.IEbrowser)
         {
             this.CreateKeyScript();
         }
         else
         {
             base.Response.Write("<script>location.href='index.aspx'</script>");
         }
     }
     if (this.UserModel != null)
     {
         this.GetFirstMemu();
         Chain.BLL.OnlineMessage bllProposal = new Chain.BLL.OnlineMessage();
         int count = bllProposal.GetRecordCount("IsReply=0 and MessageType=0");
         this.spMessageCount.InnerHtml = count.ToString();
         this.spRemindCount.InnerHtml  = this.GetSysRemind(this.UserModel.UserShopID, this.UserModel.UserID).ToString();
         this.spUserName.InnerHtml     = this.UserModel.UserName;
         Chain.Model.SysShop modelShop = new Chain.BLL.SysShop().GetModel(this.UserModel.UserShopID);
         if (modelShop.ShopImageUrl != null && modelShop.ShopImageUrl.ToString() != "")
         {
             this.spShopPhoto.Src = modelShop.ShopImageUrl;
         }
     }
     else
     {
         base.Response.Write("<script>location.href='login.aspx'</script>");
     }
 }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         this.sltShopState.Value = "0";
         this.chkSMS.Checked     = PubFunction.curParameter.bolSms;
         this.bindSltList();
         this.txtIsSendCard.Value   = (PubFunction.curParameter.bolIsSendCard ? "1" : "0");
         this.txtSmsManage.Value    = (PubFunction.curParameter.bolShopSmsManage ? "1" : "0");
         this.txtPointManage.Value  = (PubFunction.curParameter.bolShopPointManage ? "1" : "0");
         this.txtIsSettlement.Value = (PubFunction.curParameter.bolIsSettlement ? "1" : "0");
         this.union.Value           = PubFunction.curParameter.UsingUnion.ToString();
         this.txtShopType.Value     = "3";
         this.NewMethod();
         PubFunction.BindProvinceSelect(this.sltProvince);
         Chain.BLL.SysShop bllShop = new Chain.BLL.SysShop();
         int count = bllShop.GetRecordCount("IsMain=1");
         if (this._UserGroupID == 1 && count == 0)
         {
             this.btnMainShopAdd.Visible = true;
         }
         else
         {
             this.btnMainShopAdd.Visible = false;
         }
     }
 }
Пример #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         if (this.Session["userid"] != null)
         {
             Chain.BLL.SysUser   bllUser   = new Chain.BLL.SysUser();
             Chain.Model.SysUser modelUser = bllUser.GetModel(int.Parse(this.Session["userid"].ToString()));
             Chain.Model.SysShop modelShop = new Chain.BLL.SysShop().GetModel(modelUser.UserShopID);
             this.txtShopID.Value = modelUser.UserShopID.ToString();
         }
         else
         {
             base.Response.Redirect("login.aspx");
         }
         if (base.Request.QueryString["type"] != null)
         {
             this.txtType.Value = base.Request.QueryString["Type"];
         }
         else
         {
             this.txtType.Value = "1";
         }
     }
 }
Пример #4
0
 private void NewMethod()
 {
     if (!PubFunction.curParameter.UsingUnion)
     {
         this.sltShopList.SelectedIndex = 0;
         this.trSltShop.Attributes.Add("style", "display:none;");
         this.trShopSms.Attributes.Add("style", "display:none;");
         this.trShopPoint.Attributes.Add("style", "display:none;");
         this.BindShopList("");
     }
     else
     {
         StringBuilder strSql = new StringBuilder();
         if (this._UserShopID == 1)
         {
             strSql.Append(" and FatherShopID = 1");
         }
         else
         {
             strSql.AppendFormat(" and (FatherShopID = {0} or ShopID={0})", this._UserShopID);
         }
         this.BindShopList(strSql.ToString());
         Chain.Model.SysShop shop = new Chain.BLL.SysShop().GetModel(this._UserShopID);
         if (!shop.IsAllianceProgram && shop.ShopID != 1)
         {
             this.btnShopAdd.Visible = false;
         }
     }
 }
Пример #5
0
 public void Set_ShopInfo()
 {
     if (this.HidSid.Value != "")
     {
         Chain.Model.SysShop shop = new Chain.BLL.SysShop().GetModel(int.Parse(this.HidSid.Value));
         this.lblFrmTitle.Text = this.lblFrmTitle.Text + "--" + shop.ShopName + "  商家编辑";
         int AreaID = shop.ShopAreaID;
         Chain.Model.SysArea area = new Chain.BLL.SysArea().GetModel(AreaID);
         this.txtShopName.Value       = shop.ShopName;
         this.txtShopID.Value         = shop.ShopID.ToString();
         this.txtShopContactMan.Value = shop.ShopContactMan;
         this.txtShopTelephone.Value  = shop.ShopTelephone;
         this.txtShopAddress.Value    = shop.ShopAddress;
         this.txtShopRemark.Value     = shop.ShopRemark;
         this.txtShopPrintTitle.Value = shop.ShopPrintTitle;
         this.txtShopPrintFoot.Value  = shop.ShopPrintFoot;
         if (shop.ShopState)
         {
             this.radChooseYes.Checked = true;
         }
         else
         {
             this.radChooseNo.Checked = true;
         }
     }
     else
     {
         this.lblFrmTitle.Text = this.lblFrmTitle.Text + "--  商家设置";
     }
 }
Пример #6
0
        private void BindShopList(string strWhere)
        {
            Chain.BLL.SysShop Shop = new Chain.BLL.SysShop();
            int    Counts          = this.NetPagerParameter.RecordCount;
            string strSql          = " ShopID>0 and ShopType=2";

            strSql += strWhere;
            DataTable db = Shop.GetListSP(this.NetPagerParameter.PageSize, this.NetPagerParameter.CurrentPageIndex, out Counts, new string[]
            {
                strSql
            }).Tables[0];

            this.NetPagerParameter.RecordCount    = Counts;
            this.NetPagerParameter.CustomInfoHTML = string.Format("<div class=\"results\"><span>当前第{0}/{1}页 共{2}条记录 每页{3}条</span></div>", new object[]
            {
                this.NetPagerParameter.CurrentPageIndex,
                this.NetPagerParameter.PageCount,
                this.NetPagerParameter.RecordCount,
                this.NetPagerParameter.PageSize
            });
            if (PubFunction.curParameter.UsingUnion)
            {
                this.gvShopListProfession.Visible = false;
                this.gvShopListUnion.DataSource   = db;
                this.gvShopListUnion.DataBind();
                PageBase.BindSerialRepeater(this.gvShopListUnion, this.NetPagerParameter.PageSize * (this.NetPagerParameter.CurrentPageIndex - 1));
            }
            else
            {
                this.gvShopListUnion.Visible         = false;
                this.gvShopListProfession.DataSource = db;
                this.gvShopListProfession.DataBind();
                PageBase.BindSerialRepeater(this.gvShopListProfession, this.NetPagerParameter.PageSize * (this.NetPagerParameter.CurrentPageIndex - 1));
            }
        }
Пример #7
0
        protected string BindAddress(object shopID)
        {
            Chain.BLL.SysShop   bllSysShop = new Chain.BLL.SysShop();
            Chain.Model.SysShop modelShop  = bllSysShop.GetModel(int.Parse(shopID.ToString()));
            int    ProvinceID = modelShop.ShopProvince;
            string province   = "";
            string city       = "";
            string county     = "";

            if (ProvinceID != 0)
            {
                province = PubFunction.SysAreaName(ProvinceID) + "省";
            }
            int CityID = modelShop.ShopCity;

            if (CityID != 0)
            {
                city = PubFunction.SysAreaName(CityID) + "市";
            }
            int CountyID = modelShop.ShopCounty;

            if (CountyID != 0)
            {
                county = PubFunction.SysAreaName(CountyID);
            }
            return(province + city + county + modelShop.ShopAddress);
        }
Пример #8
0
 private void NewMethod()
 {
     if (!PubFunction.curParameter.UsingUnion)
     {
         this.txtSettlementInterval.Value = "36500";
         this.txtTotalRate.Value          = "0";
         this.trSettlement.Attributes.Add("style", "display:none;");
         this.sltShopList.SelectedIndex = 0;
         this.trSltShop.Attributes.Add("style", "display:none;");
         this.trShopSms.Attributes.Add("style", "display:none;");
         this.trShopPoint.Attributes.Add("style", "display:none;");
         this.trShopRecharge.Attributes.Add("style", "display:none;");
         this.BindShopList(" ShopState=0 ");
     }
     else
     {
         StringBuilder strSql = new StringBuilder();
         if (this._UserShopID == 1)
         {
             strSql.Append("  and ShopState=0  or (FatherShopID = 0 and shopid>1)  ");
         }
         else
         {
             strSql.AppendFormat(" and ShopState=0  and (FatherShopID = {0} or ShopID={0})", this._UserShopID);
         }
         this.BindShopList(strSql.ToString());
         Chain.Model.SysShop shop = new Chain.BLL.SysShop().GetModel(this._UserShopID);
         if (shop.ShopType == 3)
         {
             this.btnShopAdd.Visible = false;
         }
     }
 }
Пример #9
0
        protected string BindShopName(object shopid)
        {
            Chain.BLL.SysShop Shop     = new Chain.BLL.SysShop();
            string            shopname = "";

            if (shopid != null)
            {
                shopname = Shop.GetShopNameByShopid(shopid.ToString());
            }
            return(shopname);
        }
Пример #10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         this.txtShopID.Value = this.UserModel.UserShopID.ToString();
         Chain.BLL.SysShop   bllShop   = new Chain.BLL.SysShop();
         Chain.Model.SysShop modelShop = bllShop.GetModel(this.UserModel.UserShopID);
         this.txtShopType.Value = modelShop.ShopType.ToString();
         PubFunction.BindAllianceListSelect(this.UserModel.UserShopID, this.sltAlliance, true);
         int FatherShopID = -1;
         if (this.sltAlliance.Value != "")
         {
             FatherShopID = int.Parse(this.sltAlliance.Value);
         }
         PubFunction.BindShopListSelect(this.UserModel.UserShopID, FatherShopID, this.sltShop, true);
     }
 }
Пример #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         this.txtShopID.Value = "1";
         Chain.BLL.SysShop   bllSysShop = new Chain.BLL.SysShop();
         Chain.Model.SysShop modelShop  = bllSysShop.GetModel(1);
         this.txtShopName.Value = modelShop.ShopName;
         PubFunction.BindProvinceSelect(this.sltProvince);
         this.txtShopType.Value = "1";
         this.bindSltList();
         this.sltShopList.SelectedIndex = 0;
         this.trSltShop.Attributes.Add("style", "display:none;");
         this.trShopSms.Attributes.Add("style", "display:none;");
         this.trShopPoint.Attributes.Add("style", "display:none;");
     }
 }
Пример #12
0
    public static string GetSendContent(int intTemplateType, SmsTemplateParameter smsTemplateParameter, int intShopID)
    {
        Chain.BLL.SmsTemplate   bllTemplate   = new Chain.BLL.SmsTemplate();
        Chain.Model.SmsTemplate modelTemplate = new Chain.Model.SmsTemplate();
        modelTemplate = bllTemplate.GetModel(intTemplateType);
        StringBuilder strTemplateContent = new StringBuilder(modelTemplate.TemplateContent);

        strTemplateContent.Replace("{CardID}", smsTemplateParameter.strCardID);
        strTemplateContent.Replace("{LCardID}", smsTemplateParameter.strCardID.Substring(smsTemplateParameter.strCardID.Length - 3));
        strTemplateContent.Replace("{Name}", smsTemplateParameter.strName);
        strTemplateContent.Replace("{TempMoney}", smsTemplateParameter.dclTempMoney.ToString("0.00"));
        strTemplateContent.Replace("{Money}", smsTemplateParameter.dclMoney.ToString("0.00"));
        strTemplateContent.Replace("{Time}", DateTime.Now.ToString("yy年MM月dd日HH时mm分"));
        strTemplateContent.Replace("{TempPoint}", smsTemplateParameter.intTempPoint.ToString());
        strTemplateContent.Replace("{Point}", smsTemplateParameter.intPoint.ToString());
        Chain.BLL.MemLevel   bllMemLevel   = new Chain.BLL.MemLevel();
        Chain.Model.MemLevel modelMemLevel = new Chain.Model.MemLevel();
        modelMemLevel = bllMemLevel.GetModel(smsTemplateParameter.OldLevelID);
        strTemplateContent.Replace("{OldLevel}", modelMemLevel.LevelName);
        modelMemLevel = bllMemLevel.GetModel(smsTemplateParameter.NewLevelID);
        strTemplateContent.Replace("{NewLevel}", modelMemLevel.LevelName);
        strTemplateContent.Replace("{MemBirthday}", string.Format("{0}月{1}日", Convert.ToInt32(smsTemplateParameter.MemBirthday.ToString("MM")), Convert.ToInt32(smsTemplateParameter.MemBirthday.ToString("dd"))));
        strTemplateContent.Replace("{MemPastTime}", smsTemplateParameter.MemPastTime.ToString("yyyy-MM-dd"));
        strTemplateContent.Replace("{TempGoodsItem}", smsTemplateParameter.CountItemsString);
        if (modelTemplate.TemplateID < 13)
        {
            if (PubFunction.curParameter.bolIsSmsShopName)
            {
                if (PubFunction.curParameter.strSmsShopName != "")
                {
                    strTemplateContent.Append("【" + PubFunction.curParameter.strSmsShopName + "】");
                }
            }
            else
            {
                Chain.BLL.SysShop   bllShop   = new Chain.BLL.SysShop();
                Chain.Model.SysShop modelShop = new Chain.Model.SysShop();
                modelShop = bllShop.GetModel(intShopID);
                if (modelShop.ShopSmsName != "")
                {
                    strTemplateContent.Append("【" + modelShop.ShopSmsName + "】");
                }
            }
        }
        return(strTemplateContent.ToString());
    }
Пример #13
0
        public void bindSltList()
        {
            this.hdShopID.Value = this._UserShopID.ToString();
            Chain.BLL.SysShop bllSysShop = new Chain.BLL.SysShop();
            string            strWhere   = "ShopType=1 ";
            DataTable         dtSysShop  = bllSysShop.GetList(strWhere).Tables[0];

            foreach (DataRow dr in dtSysShop.Rows)
            {
                this.sltShopList.Items.Add(new ListItem(dr["ShopName"].ToString(), dr["ShopID"].ToString()));
            }
            if (this._UserShopID > 1)
            {
                this.sltShopList.Value = this._UserShopID.ToString();
                this.sltShopList.Attributes.Add("disabled", "disabled");
            }
        }
Пример #14
0
        protected string QueryCondition()
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("1=1  and SysShop.ShopType=3 ");
            if (this.sltIsFinish.Value != "")
            {
                strSql.AppendFormat(" and IsFinish = {0}", this.sltIsFinish.Value);
            }
            if (this.sltShop.Value != "")
            {
                Chain.Model.SysShop shop = new Chain.BLL.SysShop().GetModel(Convert.ToInt32(this.sltShop.Value));
                if (shop.ShopID == 1)
                {
                    strSql.Append("");
                }
                else if (shop.IsAllianceProgram)
                {
                    strSql.AppendFormat(" AND OutShopID IN (SELECT ShopID FROM SysShop WHERE FatherShopID = {0} or ShopID = {1} )", this.sltShop.Value, this.sltShop.Value);
                }
                else
                {
                    strSql.AppendFormat(" and OutShopID = '{0}'", this.sltShop.Value);
                }
            }
            else if (this._UserShopID == 1)
            {
                string str = " and " + PubFunction.GetMemListShopAuthority(this._UserShopID, "OutShopID", strSql.ToString());
                strSql.Append(str);
            }
            else
            {
                strSql.AppendFormat(" AND OutShopID IN (SELECT ShopID FROM SysShop WHERE FatherShopID = {0} or ShopID = {1} )", this._UserShopID, this._UserShopID);
            }
            if (this.txtStartTime.Value != "")
            {
                strSql.AppendFormat("and StartTime>='{0}' ", this.txtStartTime.Value);
            }
            if (this.txtEndTime.Value != "")
            {
                strSql.AppendFormat("and EndTime<='{0}'", PubFunction.TimeEndDay(this.txtEndTime.Value));
            }
            return(strSql.ToString());
        }
Пример #15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         if (this.Session["userid"] != null)
         {
             this.spOrderAccount.InnerHtml = "wxKS" + DateTime.Now.ToString("yyMMddHHmmssffff");
             Chain.BLL.SysUser   bllUser   = new Chain.BLL.SysUser();
             Chain.Model.SysUser modelUser = bllUser.GetModel(int.Parse(this.Session["userid"].ToString()));
             Chain.Model.SysShop modelShop = new Chain.BLL.SysShop().GetModel(modelUser.UserShopID);
             this.txtShopID.Value = modelUser.UserShopID.ToString();
             this.txtUserID.Value = modelUser.UserID.ToString();
         }
         else
         {
             base.Response.Redirect("login.aspx");
         }
     }
 }
Пример #16
0
        public void BindUserShop()
        {
            Chain.BLL.SysShop bllSysShop = new Chain.BLL.SysShop();
            DataTable         dtSysShop  = new DataTable();

            if (this._UserShopID == 1)
            {
                dtSysShop = bllSysShop.GetList(" ShopType=3 ").Tables[0];
            }
            else
            {
                dtSysShop = bllSysShop.GetList(string.Format("  ShopType=3 and FatherShopID = {0} OR ShopID = {1}", this._UserShopID, this._UserShopID)).Tables[0];
            }
            this.sltShop.Items.Add(new ListItem("====请选择====", ""));
            foreach (DataRow dr in dtSysShop.Rows)
            {
                this.sltShop.Items.Add(new ListItem(dr["ShopName"].ToString(), dr["ShopID"].ToString()));
            }
        }
Пример #17
0
        private void bindSyncShopList()
        {
            Chain.BLL.SysShop bllSS  = new Chain.BLL.SysShop();
            string            sqlStr = "ShopID>0 and ShopID<>" + this._UserShopID;

            sqlStr = PubFunction.GetShopAuthority(this._UserShopID, "ShopID", sqlStr);
            DataTable dt = bllSS.GetList(sqlStr).Tables[0];

            if (dt.Rows.Count > 0)
            {
                this.rptSyncShopList.DataSource = dt;
                this.rptSyncShopList.DataBind();
            }
            else
            {
                this.lblShowSync.Visible        = false;
                this.lblShowSyncPartial.Visible = false;
            }
        }
Пример #18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.Session["userid"] != null)
     {
         if (this.Session["userid"].ToString() != "")
         {
             Chain.Model.SysUser userModel = this.userBll.GetModel(int.Parse(this.Session["userid"].ToString()));
             Chain.Model.SysShop shopModel = new Chain.BLL.SysShop().GetModel(userModel.UserShopID);
             PubFunction.BindMemLevelSelect(this.sltMemLevelID, false);
             this.sltShop.Value          = shopModel.ShopID.ToString();
             this.sltMemUserID.Value     = userModel.UserID.ToString();
             this.txtMemCreateTime.Value = DateTime.Now.ToString();
         }
     }
     else
     {
         base.Response.Redirect("login.aspx");
     }
 }
Пример #19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         PubFunction.BindCustomFieldSelect(this._UserShopID, this.sltCustomField, true, 2);
         PubFunction.BindShopSelect(this._UserShopID, this.sltShop, this._UserShopID, this._UserShopID != 1);
         this.GetGoodsList(this.QueryCondition());
         Chain.Model.SysShop modelShop = new Chain.BLL.SysShop().GetModel(this._UserShopID);
         int count = new Chain.BLL.SysShop().GetRecordCount("ShopID>0 and ShopType=3 and IsMain=0");
         if (modelShop.IsMain && count > 0)
         {
             this.btnCopy.Visible = true;
         }
         else
         {
             this.btnCopy.Visible = false;
         }
     }
 }
Пример #20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.Session["userid"] != null)
     {
         if (this.Session["userid"].ToString() != "")
         {
             Chain.Model.SysUser userModel = this.userBll.GetModel(int.Parse(this.Session["userid"].ToString()));
             Chain.Model.SysShop modelShop = new Chain.BLL.SysShop().GetModel(userModel.UserShopID);
             string strMemToday            = "CONVERT(varchar(10),MemCreateTime,120) = CONVERT(varchar(10),GETDATE(),120) AND MemID > 0";
             string strMoneyToday          = "CONVERT(varchar(10),RechargeCreateTime,120) = CONVERT(varchar(10),GETDATE(),120)";
             strMemToday                 = PubFunction.GetShopAuthority(modelShop.ShopID, "MemShopID", strMemToday);
             strMoneyToday               = PubFunction.GetShopAuthority(modelShop.ShopID, "RechargeShopID", strMoneyToday);
             this.spShopName.InnerHtml   = modelShop.ShopName;
             this.spMemToday.InnerHtml   = this.bllMem.GetRecordCount(strMemToday).ToString();
             this.spMoneyToday.InnerHtml = this.bllMemRecharge.GetRecMoney(strMoneyToday).ToString("F2");
             if (modelShop.ShopType == 3)
             {
                 this.liExpense.Visible  = true;
                 this.liExpense1.Visible = true;
                 this.liExpense2.Visible = true;
             }
             else
             {
                 this.liExpense2.Visible = false;
                 this.liExpense.Visible  = false;
                 this.liExpense1.Visible = false;
             }
             if (modelShop.ShopType == 2)
             {
                 this.liExpense3.Visible = false;
             }
         }
         else
         {
             base.Response.Redirect("login.aspx");
         }
     }
     else
     {
         base.Response.Redirect("login.aspx");
     }
 }
Пример #21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         this.BindPreferentialObject();
         this.rptShopBind();
         if (base.Request.QueryString["PromotionsID"] != null)
         {
             int PromotionsID = int.Parse(base.Request.QueryString["PromotionsID"]);
             Chain.BLL.Promotions   bllPromotions   = new Chain.BLL.Promotions();
             Chain.Model.Promotions modelPromotions = bllPromotions.GetModel(PromotionsID);
             this.txtPromotionsDesc.Value       = modelPromotions.PromotionsDesc;
             this.txtPromotionsID.Value         = PromotionsID.ToString();
             this.txtPromotionsRemark.Value     = modelPromotions.PromotionsRemark;
             this.txtUpdatePromotionsName.Value = modelPromotions.PromotionsPhoto;
             this.imgPromotionsPhoto.Src        = modelPromotions.PromotionsPhoto;
             this.txtPromotionsTitle.Value      = modelPromotions.PromotionsTitle;
             this.txtShopList.Value             = modelPromotions.ShopList;
             string[] shopList = this.txtShopList.Value.Split(new char[]
             {
                 ','
             });
             string shopname = "";
             for (int i = 0; i < shopList.Length; i++)
             {
                 Chain.BLL.SysShop   bllShop   = new Chain.BLL.SysShop();
                 Chain.Model.SysShop modelShop = bllShop.GetModel(int.Parse(shopList[i]));
                 shopname = shopname + modelShop.ShopName + ";";
             }
             shopname.TrimEnd(new char[]
             {
                 ';'
             });
             this.txtShopNameList.Value = shopname;
             this.ltlTitle.Text         = "微官网   >    优惠活动   >   优惠活动编辑 ";
         }
         else
         {
             this.ltlTitle.Text = "微官网   >   优惠活动   >   优惠活动新增 ";
         }
     }
 }
Пример #22
0
 public void Set_GiftInfo()
 {
     if (this.HidGiftID.Value != "")
     {
         this.modelPg = this.bllPg.GetModel(int.Parse(this.HidGiftID.Value));
         Chain.Model.SysShop modelShop = new Chain.BLL.SysShop().GetModel(this.modelPg.GiftShopID);
         this.lblFrmTitle.Text            = this.lblFrmTitle.Text + "--" + this.modelPg.GiftName + "  礼品编辑";
         this.txtGiftID.Value             = this.modelPg.GiftID.ToString();
         this.txtGiftName.Value           = this.modelPg.GiftName;
         this.txtGiftCode.Value           = this.modelPg.GiftCode;
         this.txtGiftStockNumber.Value    = this.modelPg.GiftStockNumber.ToString();
         this.txtGiftExchangePoint.Value  = this.modelPg.GiftExchangePoint.ToString();
         this.txtGiftExchangeNumber.Value = this.modelPg.GiftExchangeNumber.ToString();
         this.txtGiftRemark.Value         = this.modelPg.GiftRemark;
     }
     else
     {
         this.lblFrmTitle.Text = this.lblFrmTitle.Text + "--  礼品新增";
     }
 }
Пример #23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         if (base.Request.QueryString["ShopID"] != null)
         {
             int shopID = int.Parse(base.Request.QueryString["ShopID"].ToString());
             Chain.BLL.SysShop   bllSysShop = new Chain.BLL.SysShop();
             Chain.Model.SysShop modelShop  = bllSysShop.GetModel(int.Parse(shopID.ToString()));
             int    ProvinceID = modelShop.ShopProvince;
             string province   = "";
             string city       = "";
             string county     = "";
             if (ProvinceID != 0)
             {
                 province = PubFunction.SysAreaName(ProvinceID) + "省";
             }
             int CityID = modelShop.ShopCity;
             if (CityID != 0)
             {
                 city = PubFunction.SysAreaName(CityID) + "市";
             }
             int CountyID = modelShop.ShopCounty;
             if (CountyID != 0)
             {
                 county = PubFunction.SysAreaName(CountyID);
             }
             this.spAddress.InnerHtml = province + city + county + modelShop.ShopAddress;
             JavaScriptSerializer jsonReader  = new JavaScriptSerializer();
             HttpRequestHelper    httpRequest = new HttpRequestHelper();
             string         jsonString        = httpRequest.Reqeust("http://apis.map.qq.com/ws/geocoder/v1/?address=" + this.spAddress.InnerHtml + "&key=FMXBZ-MQALQ-ZCT5V-GB46R-G62I2-6MF7X");
             MapAddressInfo MapInfo           = jsonReader.Deserialize <MapAddressInfo>(jsonString);
             int            status            = MapInfo.Status;
             if (status == 0)
             {
                 this.spLat.InnerHtml = MapInfo.Result.Location.Lat.ToString();
                 this.spLng.InnerHtml = MapInfo.Result.Location.Lng.ToString();
             }
         }
     }
 }
Пример #24
0
        public bool Login(string Account, string Pwd)
        {
            Chain.BLL.SysUser   bll   = new Chain.BLL.SysUser();
            Chain.Model.SysUser model = bll.CheckUserLogin(Account, DESEncrypt.Encrypt(Pwd));
            bool result;

            if (model != null && !model.UserLock)
            {
                Chain.Model.SysShop shop = new Chain.BLL.SysShop().GetModel(model.UserShopID);
                if (shop != null && !shop.ShopState)
                {
                    this.IsLoggedOn      = true;
                    this.LoginUser       = model;
                    this._lastUpdateTime = DateTime.Now;
                    string code = this.Encode(model, this._lastUpdateTime);
                    this.LoginIn(code);
                    result = true;
                    return(result);
                }
            }
            result = false;
            return(result);
        }
Пример #25
0
 protected void gvMemList_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         DataRowView       dr      = (DataRowView)e.Item.DataItem;
         HtmlInputCheckBox chkItem = (HtmlInputCheckBox)e.Item.FindControl("chkItem");
         chkItem.Attributes.Add("memID", dr["MemID"].ToString());
         chkItem.Attributes.Add("memcard", dr["MemCard"].ToString());
         chkItem.Attributes.Add("memname", dr["MemName"].ToString());
         chkItem.Attributes.Add("mobiles", dr["MemMobile"].ToString());
         chkItem.Attributes.Add("state", dr["MemState"].ToString());
         HtmlControl         hyEdit    = (HtmlControl)e.Item.FindControl("hyEdit");
         Chain.Model.SysShop modelShop = new Chain.BLL.SysShop().GetModel(this._UserShopID);
         if (modelShop.ShopType == 3)
         {
             hyEdit.Attributes.Add("style", "display:block;");
         }
         else
         {
             hyEdit.Attributes.Add("style", "display:none;");
         }
     }
 }
Пример #26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         if (this.Session["userid"] != null)
         {
             if (this.Session["userid"].ToString() != "")
             {
                 Chain.Model.SysUser userModel = this.userBll.GetModel(int.Parse(this.Session["userid"].ToString()));
                 Chain.Model.SysShop shopModel = new Chain.BLL.SysShop().GetModel(userModel.UserShopID);
                 this.spOrderAccount.InnerText = "wx" + PubFunction.curParameter.strGoodsExpensePrefix + DateTime.Now.ToString("yyMMddHHmmssffff");
                 this.txtShopID.Value          = shopModel.ShopID.ToString();
                 this.hidUserID.Value          = userModel.UserID.ToString();
                 this.rptClassBind(shopModel.ShopID);
                 this.prtGoodsBind(shopModel.ShopID);
             }
         }
         else
         {
             base.Response.Redirect("login.aspx");
         }
     }
 }
Пример #27
0
 private void rptShopBind(string sql)
 {
     Chain.BLL.SysShop bllShop = new Chain.BLL.SysShop();
     this.rptShop.DataSource = bllShop.GetList(sql).Tables[0];
     this.rptShop.DataBind();
 }
Пример #28
0
        protected void btnCopy_Click(object sender, EventArgs e)
        {
            Chain.BLL.SysShop             bllShop = new Chain.BLL.SysShop();
            Chain.BLL.GoodsClassAuthority bllGoodsClassAuthority = new Chain.BLL.GoodsClassAuthority();
            Chain.BLL.GoodsClass          bllGoodsClass          = new Chain.BLL.GoodsClass();
            DataTable dtShop       = bllShop.GetList("ShopID>0 and ShopType=3 and IsMain=0 ").Tables[0];
            DataTable dtGoodsClass = bllGoodsClass.GetList("CreateShopID=" + this._UserShopID).Tables[0];

            for (int i = 0; i < dtShop.Rows.Count; i++)
            {
                int ShopID = int.Parse(dtShop.Rows[i]["ShopID"].ToString());
                for (int j = 0; j < dtGoodsClass.Rows.Count; j++)
                {
                    int ClassID = int.Parse(dtGoodsClass.Rows[j]["ClassID"].ToString());
                    Chain.Model.GoodsClassAuthority modelGoodsClassAuthority = new Chain.Model.GoodsClassAuthority();
                    modelGoodsClassAuthority.ClassID = ClassID;
                    modelGoodsClassAuthority.ShopID  = ShopID;
                    int count = bllGoodsClassAuthority.GetRecordCount(string.Concat(new object[]
                    {
                        "ShopID=",
                        ShopID,
                        " and ClassID=",
                        ClassID
                    }));
                    if (count == 0)
                    {
                        bllGoodsClassAuthority.Add(modelGoodsClassAuthority);
                    }
                }
            }
            Chain.BLL.GoodsClassDiscount bllGoodsClassDiscount = new Chain.BLL.GoodsClassDiscount();
            DataTable dtClassDiscount = bllGoodsClassDiscount.GetList("DiscountShopID=" + this._UserShopID).Tables[0];

            for (int i = 0; i < dtShop.Rows.Count; i++)
            {
                int ShopID = int.Parse(dtShop.Rows[i]["ShopID"].ToString());
                for (int j = 0; j < dtClassDiscount.Rows.Count; j++)
                {
                    Chain.Model.GoodsClassDiscount modelGoodsClassDiscount = new Chain.Model.GoodsClassDiscount();
                    int ClassID    = int.Parse(dtClassDiscount.Rows[j]["GoodsClassID"].ToString());
                    int MemLevelID = int.Parse(dtClassDiscount.Rows[j]["MemLevelID"].ToString());
                    modelGoodsClassDiscount.GoodsClassID         = ClassID;
                    modelGoodsClassDiscount.MemLevelID           = MemLevelID;
                    modelGoodsClassDiscount.DiscountShopID       = ShopID;
                    modelGoodsClassDiscount.ClassDiscountPercent = int.Parse(dtClassDiscount.Rows[j]["ClassDiscountPercent"].ToString());
                    modelGoodsClassDiscount.ClassPointPercent    = int.Parse(dtClassDiscount.Rows[j]["ClassPointPercent"].ToString());
                    DataTable dtShopGoodsClassDiscount = bllGoodsClassDiscount.GetList(string.Concat(new object[]
                    {
                        "MemLevelID=",
                        MemLevelID,
                        " and DiscountShopID=",
                        ShopID,
                        " and GoodsClassID=",
                        ClassID
                    })).Tables[0];
                    if (dtShopGoodsClassDiscount.Rows.Count == 0)
                    {
                        bllGoodsClassDiscount.Add(modelGoodsClassDiscount);
                    }
                    else
                    {
                        modelGoodsClassDiscount.ClassDiscountID = int.Parse(dtShopGoodsClassDiscount.Rows[0]["ClassDiscountID"].ToString());
                        bllGoodsClassDiscount.Update(modelGoodsClassDiscount);
                    }
                }
            }
            Chain.BLL.Goods bllGoods = new Chain.BLL.Goods();
            DataTable       dtGoods  = bllGoods.GetGoodsList("CreateShopID=" + this._UserShopID).Tables[0];

            Chain.BLL.GoodsNumber bllGoodsNumber = new Chain.BLL.GoodsNumber();
            for (int i = 0; i < dtShop.Rows.Count; i++)
            {
                int ShopID = int.Parse(dtShop.Rows[i]["ShopID"].ToString());
                for (int j = 0; j < dtGoods.Rows.Count; j++)
                {
                    int GoodsID = int.Parse(dtGoods.Rows[j]["GoodsID"].ToString());
                    int count   = bllGoodsNumber.GetRecordCount(string.Concat(new object[]
                    {
                        "GoodsID=",
                        GoodsID,
                        " and ShopID=",
                        ShopID
                    }));
                    Chain.Model.GoodsNumber modelGoodsNumber = new Chain.Model.GoodsNumber();
                    modelGoodsNumber.GoodsID = GoodsID;
                    modelGoodsNumber.Number  = 0m;
                    modelGoodsNumber.ShopID  = ShopID;
                    if (count == 0)
                    {
                        bllGoodsNumber.Add(modelGoodsNumber);
                    }
                }
            }
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "message", "<Script Language='JavaScript' defer>art.dialog({title: '系统提示',time: 2,content:'同步成功',close: function () { location.href = 'GoodsList.aspx?PID=62';  }});</script>");
        }
Пример #29
0
 protected void btnSetLevel_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(base.Request["MemLevelID"]))
     {
         Chain.Model.MemLevel        mdMemLevel        = new Chain.Model.MemLevel();
         Chain.BLL.SysShopMemLevel   ShopMemLevelBLL   = new Chain.BLL.SysShopMemLevel();
         Chain.Model.SysShopMemLevel ModelShopMemLevel = new Chain.Model.SysShopMemLevel();
         mdMemLevel.LevelDiscountPercent = Convert.ToDecimal(this.txtLevelDiscountPercent.Value.Trim()) / 100m;
         if (this.txtLevelPointPercent.Value != "" && this.txtLevelPointPercent.Value != "0")
         {
             mdMemLevel.LevelPointPercent = ((Convert.ToDecimal(this.txtLevelPointPercent.Value.Trim()) == 0m) ? 0m : Convert.ToDecimal(this.txtLevelPointPercent.Value.Trim()));
         }
         else
         {
             base.MessagePageShowError("快速消费-积分比率输入错误,必须为大于等于0的正整数!");
         }
         mdMemLevel.LevelName  = this.txtLevelName.Value.Trim();
         mdMemLevel.LevelPoint = Convert.ToInt32(this.txtLevelPoint.Value.Trim());
         mdMemLevel.LevellLock = this.chkLevellLock.Checked;
         int flag = this.bllMemLevel.Add(mdMemLevel);
         if (flag > 0)
         {
             Chain.BLL.SysShop shop = new Chain.BLL.SysShop();
             for (int i = 1; i < shop.GetMaxId(); i++)
             {
                 ModelShopMemLevel.ShopID                 = i;
                 ModelShopMemLevel.MemLevelID             = this.bllMemLevel.GetMaxId() - 1;
                 ModelShopMemLevel.ClassDiscountPercent   = Convert.ToDecimal(this.txtLevelDiscountPercent.Value.Trim()) / 100m;
                 ModelShopMemLevel.ClassPointPercent      = ((Convert.ToDecimal(this.txtLevelPointPercent.Value.Trim()) == 0m) ? 0m : Convert.ToDecimal(this.txtLevelPointPercent.Value.Trim()));
                 ModelShopMemLevel.ClassRechargePointRate = ((Convert.ToDecimal(this.txtLevelRechargePointRate.Value.Trim()) == 0m) ? 0m : Convert.ToDecimal(this.txtLevelRechargePointRate.Value.Trim()));
                 int dsasd = ShopMemLevelBLL.Add(ModelShopMemLevel);
             }
             ArrayList sqlArray                = new ArrayList();
             string    strSqlColumn            = "INSERT INTO GoodsClassDiscount (GoodsClassID,MemLevelID,ClassDiscountPercent,ClassPointPercent,DiscountShopID) VALUES ('{0}','{1}','{2}','{3}','{4}')";
             string    strAllSql               = string.Empty;
             string    GoodsClassID            = string.Empty;
             int       MemLevelID              = flag;
             string    strClassDiscountPercent = string.Empty;
             decimal   decClassDiscountPercent = 100m;
             string    ClassDiscountPercent    = string.Empty;
             string    strClassPointPercent    = string.Empty;
             decimal   decClassPointPercent    = 1m;
             string    ClassPointPercent       = string.Empty;
             for (int i = 0; i < this.rptShopClassLevel.Items.Count; i++)
             {
                 strAllSql               = strSqlColumn;
                 GoodsClassID            = ((Literal)this.rptShopClassLevel.Items[i].FindControl("ltClassID")).Text;
                 strClassDiscountPercent = ((HtmlInputText)this.rptShopClassLevel.Items[i].FindControl("txtDiscountPercent")).Value.Trim();
                 if (decimal.TryParse(strClassDiscountPercent, out decClassDiscountPercent))
                 {
                     ClassDiscountPercent = (decClassDiscountPercent / 100m).ToString();
                 }
                 else
                 {
                     ClassDiscountPercent = "1.00";
                 }
                 strClassPointPercent = ((HtmlInputText)this.rptShopClassLevel.Items[i].FindControl("txtPointPercent")).Value.Trim();
                 if (decimal.TryParse(strClassPointPercent, out decClassPointPercent))
                 {
                     ClassPointPercent = ((strClassPointPercent == "0") ? "0" : decClassPointPercent.ToString());
                 }
                 else
                 {
                     ClassPointPercent = ((strClassPointPercent == "0") ? "0" : "1");
                 }
                 strAllSql = string.Format(strAllSql, new object[]
                 {
                     GoodsClassID,
                     MemLevelID,
                     ClassDiscountPercent,
                     ClassPointPercent,
                     this._UserShopID
                 });
                 sqlArray.Add(strAllSql);
             }
             if (this.bllGoodsClassDiscount.AddList(sqlArray))
             {
                 string strSql = "INSERT INTO GoodsClassDiscount (GoodsClassID,MemLevelID,DiscountShopID,ClassDiscountPercent,ClassPointPercent) ";
                 strSql += string.Format("(SELECT GoodsClass.ClassID,{0},ShopID,1,1 FROM GoodsClass inner join GoodsClassAuthority on GoodsClass.ClassID = GoodsClassAuthority.ClassID WHERE ShopID <> {1})", MemLevelID, this._UserShopID);
                 DbHelperSQL.ExecuteSql(strSql);
                 this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "message", "<Script Language='JavaScript' defer>art.dialog({title: '系统提示',time: 2,content:'保存成功',close: function () { location.href = 'SetLevel.aspx?PID=5'; }});</script>");
             }
             else
             {
                 this.bllMemLevel.Delete(flag);
                 base.MessagePageShowError("保存失败,请重试!");
             }
         }
         else
         {
             string strError = "保存失败,请重试!";
             if (flag == -1)
             {
                 strError = "已存在所需积分的会员等级,请重新输入!";
             }
             base.MessagePageShowError(strError);
         }
     }
     else
     {
         int MemLevelID     = Convert.ToInt32(base.Request["MemLevelID"]);
         int ShopMemLevelID = Convert.ToInt32(base.Request["ShopMemLevelID"]);
         Chain.Model.MemLevel mdMemLevel = this.bllMemLevel.GetModel(MemLevelID);
         mdMemLevel.LevelName  = this.txtLevelName.Value.Trim();
         mdMemLevel.LevelPoint = Convert.ToInt32(this.txtLevelPoint.Value.Trim());
         mdMemLevel.LevellLock = this.chkLevellLock.Checked;
         int flag = this.bllMemLevel.Update(mdMemLevel);
         Chain.BLL.SysShopMemLevel   shopmemleverBll = new Chain.BLL.SysShopMemLevel();
         Chain.Model.SysShopMemLevel ModelMemLevel   = shopmemleverBll.GetModel(ShopMemLevelID);
         ModelMemLevel.ClassDiscountPercent   = Convert.ToDecimal(this.txtLevelDiscountPercent.Value.Trim()) / 100m;
         ModelMemLevel.ClassPointPercent      = ((Convert.ToDecimal(this.txtLevelPointPercent.Value.Trim()) == 0m) ? 0m : Convert.ToDecimal(this.txtLevelPointPercent.Value.Trim()));
         ModelMemLevel.ClassRechargePointRate = ((Convert.ToDecimal(this.txtLevelRechargePointRate.Value.Trim()) == 0m) ? 0m : Convert.ToDecimal(this.txtLevelRechargePointRate.Value.Trim()));
         bool o = shopmemleverBll.Update(ModelMemLevel);
         if (o && flag > 0)
         {
             ArrayList sqlArray             = new ArrayList();
             string    strSqlColumn         = "UPDATE GoodsClassDiscount SET ClassDiscountPercent = '{0}',ClassPointPercent = '{1}' WHERE ClassDiscountID = '{2}'";
             string    strAllSql            = string.Empty;
             string    ClassDiscountPercent = string.Empty;
             string    ClassPointPercent    = string.Empty;
             string    ClassDiscountID      = string.Empty;
             for (int i = 0; i < this.rptShopClassLevel.Items.Count; i++)
             {
                 ClassDiscountID      = ((Literal)this.rptShopClassLevel.Items[i].FindControl("ltClassDiscountID")).Text;
                 ClassDiscountPercent = (Convert.ToDecimal(((HtmlInputText)this.rptShopClassLevel.Items[i].FindControl("txtDiscountPercent")).Value.Trim()) / 100m).ToString();
                 ClassPointPercent    = ((HtmlInputText)this.rptShopClassLevel.Items[i].FindControl("txtPointPercent")).Value.Trim();
                 ClassPointPercent    = ((ClassPointPercent == "0") ? "0" : Convert.ToDecimal(ClassPointPercent).ToString());
                 strAllSql            = string.Format(strSqlColumn, ClassDiscountPercent, ClassPointPercent, ClassDiscountID);
                 sqlArray.Add(strAllSql);
             }
             if (this.bllGoodsClassDiscount.AddList(sqlArray))
             {
                 this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "message", "<Script Language='JavaScript' defer>art.dialog({title: '系统提示',time: 2,content:'保存成功',close: function () { location.href = 'SetLevel.aspx?PID=5'; }});</script>");
             }
             else
             {
                 base.MessagePageShowError("保存失败,请重试!");
             }
         }
         else
         {
             string strError = "保存失败,请重试!";
             if (flag == -1)
             {
                 strError = "已存在所需积分的会员等级,请重新输入!";
             }
             base.MessagePageShowError(strError);
         }
     }
 }
Пример #30
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         PubFunction.BindSysAreaNew(this.sltProvince, 0);
         Chain.BLL.SysShop bllShop = new Chain.BLL.SysShop();
         DataTable         dt      = bllShop.GetList("ShopID>0").Tables[0];
         string            strSql  = "ShopID>0 and ShopType=3  ";
         if (base.Request.QueryString["key"] != null)
         {
             string key = base.Request.QueryString["key"].ToString();
             if (key != "")
             {
                 strSql            = strSql + " and ShopName like'%" + key + "%'";
                 this.txtKey.Value = key;
             }
         }
         if (base.Request.QueryString["pid"] != null)
         {
             if (base.Request.QueryString["pid"] != "")
             {
                 strSql = strSql + " and ShopProvince=" + base.Request.QueryString["pid"];
                 PubFunction.BindSysAreaNew(this.sltCity, int.Parse(base.Request.QueryString["pid"]));
             }
             this.txtPID.Value      = base.Request.QueryString["pid"];
             this.sltProvince.Value = base.Request.QueryString["pid"];
         }
         if (base.Request.QueryString["cid"] != null)
         {
             if (base.Request.QueryString["cid"] != "")
             {
                 strSql = strSql + " and ShopCity=" + base.Request.QueryString["cid"];
                 PubFunction.BindSysAreaNew(this.sltCounty, int.Parse(base.Request.QueryString["cid"]));
             }
             this.txtCID.Value  = base.Request.QueryString["cid"];
             this.sltCity.Value = base.Request.QueryString["cid"];
         }
         if (base.Request.QueryString["cyid"] != null)
         {
             if (base.Request.QueryString["cyid"] != "")
             {
                 strSql = strSql + " and ShopCounty=" + base.Request.QueryString["cyid"];
             }
             this.txtCYID.Value   = base.Request.QueryString["cyid"];
             this.sltCounty.Value = base.Request.QueryString["cyid"];
         }
         if (base.Request.QueryString["type"] == "all")
         {
             dt = bllShop.GetList(strSql).Tables[0];
         }
         else
         {
             dt = bllShop.GetList(10, strSql, "ShopCreateTime").Tables[0];
         }
         this.rptShop.DataSource = dt;
         this.rptShop.DataBind();
         if (dt.Rows.Count < 10 || base.Request.QueryString["type"] == "all")
         {
             this.moreShop.Attributes.Add("style", "display:none");
         }
     }
 }