예제 #1
0
        private void BindMemCountList()
        {
            MemCount       bllCount       = new MemCount();
            MemCountDetail bllCountDetail = new MemCountDetail();
            string         strSql         = this.QueryCondition();

            strSql = PubFunction.GetShopAuthority(this._UserShopID, "CountShopID", strSql);
            DataTable dtMoney = bllCount.GetCountMoney(strSql).Tables[0];

            this.lblMoney.Text         = decimal.Parse(dtMoney.Rows[0]["TotalMoney"].ToString()).ToString("0.00");
            this.lblDiscountMoney.Text = decimal.Parse(dtMoney.Rows[0]["DiscountMoney"].ToString()).ToString("0.00");
            this.lblTotalPoint.Text    = int.Parse(dtMoney.Rows[0]["TotalPoint"].ToString()).ToString();
            DataTable dtNumber = bllCount.GetCountNumber(strSql).Tables[0];

            this.lblToalCount.Text   = dtNumber.Rows[0]["TotalNumber"].ToString();
            this.lblRemainCount.Text = dtNumber.Rows[0]["RemainCount"].ToString();
        }
예제 #2
0
        public ActionResult DeletePacket(string id)
        {
            string[] tmpIDArr = id.Split(new char[] { ',' });
            int      OID      = int.Parse(tmpIDArr[0]);
            Order    tmpOrder = db.Orders.FirstOrDefault(r => r.OID == OID);

            if (tmpOrder != null)
            {
                string tmpStr = "";
                for (int i = 1; i < tmpIDArr.Length; i++)
                {
                    tmpStr = tmpIDArr[i];
                    int PID = int.Parse(tmpStr);
                    tmpOrder.Packets.RemoveAll(r => r.PacketID == PID);
                }
                db.SaveChanges();
                //添加到cookie里
                bool       hasCookie = Request.Cookies.AllKeys.Contains("Order");
                HttpCookie cookie    = null;
                if (!hasCookie)
                {
                    cookie         = new HttpCookie("Order");
                    cookie.Expires = DateTime.Now.AddMonths(1);
                }
                else
                {
                    cookie = Request.Cookies["Order"];
                }
                tmpStr = tmpOrder.OID.ToString() + ",";
                foreach (OrderPacket op in tmpOrder.Packets)
                {
                    tmpStr = op.Product.PID + "," + op.Count.ToString() + "," + op.Product.Title.Substring(0, Math.Min(20, op.Product.Title.Length)) + "," + op.Product.ImgPathArr[0] + ",";
                }
                cookie.Value = Server.UrlEncode(tmpStr);
                Response.Cookies.Add(cookie);
            }
            if (Request.IsAjaxRequest())
            {
                string jsonStr = PubFunction.BuildResult("OK");
                return(Content(jsonStr));
            }
            else
            {
                return(View());
            }
        }
예제 #3
0
        protected void btnRptExpenseExcel_Click(object sender, EventArgs e)
        {
            Chain.BLL.GoodsLog bllGoodsLog = new Chain.BLL.GoodsLog();
            int    Counts   = this.NetPagerParameter.RecordCount;
            string strSql   = this.QueryCondition();
            string strAgent = "";

            strSql += " and GoodsLog.ShopID>0";
            strSql += " and GoodsLog.ShopID = SysShop.ShopID and GoodsLog.UserID = SysUser.UserID";
            strSql  = PubFunction.GetShopAuthority(this._UserShopID, "GoodsLog.ShopID", strSql);
            DataTable db = bllGoodsLog.GetListSP(100000, 1, out Counts, new string[]
            {
                strSql
            }).Tables[0];

            DataExcelInfo.GoodsLogExcel(db, this._UserName, strAgent);
        }
예제 #4
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);
     }
 }
예제 #5
0
        public ActionResult GetProductBrand(int id)
        {
            Product tmpProduct = db.Products.FirstOrDefault(r => r.PID == id);

            if (Request.IsAjaxRequest())
            {
                string jsonStr = PubFunction.BuildResult(new List <Brand>()
                {
                    tmpProduct.Brand
                });
                return(Content(jsonStr));
            }
            else
            {
                return(View());
            }
        }
예제 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         PubFunction.BindSysAreaMobile(this.sltProvince, 0);
         if (this.Session["MemID"] != null)
         {
             int MemID = int.Parse(this.Session["MemID"].ToString());
             this.BindMemInfo(MemID);
             this.txtMemID.Value = MemID.ToString();
         }
         else
         {
             base.Response.Redirect("login.aspx");
         }
     }
 }
예제 #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         PubFunction.BindMemLevelSelect(this.sltMemLevelID, true);
         PubFunction.BindShopSelect(this._UserShopID, this.sltShop, true);
         if (PubFunction.curParameter.dataAuthority != 0)
         {
             if (this._UserShopID > 1)
             {
                 this.sltShop.Value = this._UserShopID.ToString();
                 this.sltShop.Attributes.Add("disabled", "disabled");
             }
         }
         this.Get_ParameterList(this.QueryCondition());
     }
 }
예제 #8
0
        protected string QueryCondition()
        {
            string        strQueryMem     = this.txtQueryMem.Value;
            string        strMemLevelID   = this.sltMemLevelID.Value;
            string        strMemShopID    = this.sltShop.Value;
            string        strRemark       = PubFunction.RemoveSpace(this.txtRemark.Value);
            string        strCountAccount = PubFunction.RemoveSpace(this.txtCountAccount.Value);
            string        strProjectName  = this.txtProjectName.Value;
            StringBuilder strSql          = new StringBuilder();

            strSql.Append("1=1 ");
            if (strQueryMem != "")
            {
                strSql.AppendFormat(" and (Mem.MemCard = '{0}' or Mem.MemName like '%{0}%' or Mem.MemMobile = '{0}' or Mem.MemCardNumber = '{0}' )", strQueryMem);
            }
            if (strMemLevelID != "")
            {
                strSql.AppendFormat(" and Mem.MemLevelID={0}", int.Parse(strMemLevelID));
            }
            if (strMemShopID != "")
            {
                strSql.AppendFormat(" and MemStorageTiming.StorageTimingShopID={0}", int.Parse(strMemShopID));
            }
            if (strCountAccount != "")
            {
                strSql.AppendFormat(" and MemStorageTiming.StorageTimingAccount='{0}'", strCountAccount);
            }
            if (strRemark != "")
            {
                strSql.AppendFormat(" and MemStorageTiming.StorageTimingRemark like '%{0}%' ", strRemark);
            }
            if (strProjectName != "")
            {
                strSql.AppendFormat(" and TimingProject.ProjectName like '%{0}%'", strProjectName);
            }
            if (this.txtStartTime.Value != "")
            {
                strSql.AppendFormat(" and MemStorageTiming.StorageTimingCreateTime>='{0}' ", this.txtStartTime.Value);
            }
            if (this.txtEndTime.Value != "")
            {
                strSql.AppendFormat(" and MemStorageTiming.StorageTimingCreateTime<='{0}'", PubFunction.TimeEndDay(this.txtEndTime.Value));
            }
            return(strSql.ToString());
        }
예제 #9
0
 public void GetMemInfoByMobile(string mobile)
 {
     Chain.Model.Mem modelMem = new Chain.BLL.Mem().GetMemInfoByMobile(mobile);
     if (modelMem != null)
     {
         this.txtFMemID.Value           = modelMem.MemID.ToString();
         this.txtFMemCard.Value         = modelMem.MemCard;
         this.txtFMemName.Value         = modelMem.MemName;
         this.txtFMemMoney.Value        = modelMem.MemMoney.ToString();
         this.txtFMemPoint.Value        = modelMem.MemPoint.ToString();
         this.txtFMemLevelName.Value    = PubFunction.LevelIDToName(modelMem.MemLevelID);
         this.txtFMemShopName.Value     = PubFunction.ShopIDToName(modelMem.MemShopID);
         this.txtFMemMobile.Value       = modelMem.MemMobile;
         this.txtFMemState.Value        = PubFunction.StateToName(modelMem.MemState);
         this.txtFMemBirthday.Value     = modelMem.MemBirthday.ToShortDateString();
         this.txtFMemSex.Value          = PubFunction.SexToName(modelMem.MemSex);
         this.txtFMemIdentityCard.Value = modelMem.MemIdentityCard;
         this.txtFMemPastTime.Value     = modelMem.MemPastTime.ToShortDateString();
         this.txtFMemEmail.Value        = modelMem.MemEmail;
         string address = "";
         if (!string.IsNullOrEmpty(modelMem.MemVillage))
         {
             this.GetAddressName(modelMem.MemVillage, ref address);
         }
         else if (!string.IsNullOrEmpty(modelMem.MemCounty))
         {
             this.GetAddressName(modelMem.MemCounty, ref address);
         }
         else if (!string.IsNullOrEmpty(modelMem.MemCity))
         {
             this.GetAddressName(modelMem.MemCity, ref address);
         }
         else if (!string.IsNullOrEmpty(modelMem.MemProvince))
         {
             this.GetAddressName(modelMem.MemProvince, ref address);
         }
         if (string.IsNullOrEmpty(modelMem.MemAddress))
         {
             modelMem.MemAddress = "无";
         }
         this.txtFMemAddress.Value    = address + modelMem.MemAddress;
         this.txtFMemCreateTime.Value = modelMem.MemCreateTime.ToShortDateString();
         this.txtFMemUserName.Value   = PubFunction.UserIDTOName(modelMem.MemUserID);
     }
 }
예제 #10
0
        protected string QueryCondition()
        {
            string        strQueryMem   = this.txtQueryMem.Value;
            string        strMemLevelID = this.sltMemLevelID.Value;
            string        strGift       = this.txtGift.Value;
            StringBuilder strSql        = new StringBuilder();

            strSql.Append(" 1=1 ");
            if (strQueryMem != "")
            {
                strSql.AppendFormat("and (MemCard like '%{0}%' or Mem.MemName like '%{0}%' or MemMobile like '%{0}%')", strQueryMem);
            }
            if (strMemLevelID != "")
            {
                strSql.AppendFormat("and Mem.MemLevelID={0}", int.Parse(strMemLevelID));
            }
            if (strGift != "")
            {
                DataTable dt = new GiftExchange().GetExchangeIDByGiftNameOrGiftCode(string.Format("(PointGift.GiftName like '%{0}%' or PointGift.GiftCode like '%{0}%')", strGift));
                if (dt.Rows.Count > 0)
                {
                    StringBuilder temp = new StringBuilder();
                    temp.Append("and ExchangeID in (" + dt.Rows[0][0]);
                    for (int i = 1; i < dt.Rows.Count; i++)
                    {
                        temp.Append("," + dt.Rows[i][0]);
                    }
                    temp.Append(")");
                    strSql.Append(temp.ToString());
                }
                else
                {
                    strSql.Append("and ExchangeID in (-1)");
                }
            }
            if (this.txtStartTime.Value != "")
            {
                strSql.AppendFormat("and ExchangeTime>='{0}' ", this.txtStartTime.Value);
            }
            if (this.txtEndTime.Value != "")
            {
                strSql.AppendFormat("and ExchangeTime<='{0}'", PubFunction.TimeEndDay(this.txtEndTime.Value));
            }
            return(strSql.ToString());
        }
예제 #11
0
    /// <summary>
    /// 绑定列表数据
    /// </summary>
    /// <param name="pageIndex"></param>
    private void BindNews(int pageIndex)
    {
        AdoHelper adoHelper = AdoHelper.CreateHelper("DB_Instance");
        string    filter    = SetFilter();
        string    sort      = "createtime desc";

        this.pageBar.PageIndex = pageIndex;
        int       pageSize = this.pageBar.PageSize;
        int       count    = 0;
        DataTable dtAll    = adoHelper.ExecuteSqlDataset("select * from T_Test_Queston where " + filter + " order by " + sort).Tables[0];
        DataTable dt       = PubFunction.LocalPaging(dtAll, "1=1", sort, pageSize, pageIndex, ref count);

        this.gvArticleList.DataSource = dt;
        this.gvArticleList.DataBind();
        this.pageBar.RecordCount = count;
        //保存状态
        SaveSessionStatus();
    }
예제 #12
0
        protected string QueryCondition()
        {
            string        strMemShopID = this.sltShop.Value;
            StringBuilder strSql       = new StringBuilder();

            strSql.Append(" SysShop.ShopID>0 and SysShop.ShopState=0 and SysShop.ShopType=3 ");
            if (strMemShopID != "")
            {
                string strwhere = PubFunction.GetMemListShopAuthority(int.Parse(strMemShopID), "SysShop.ShopID", " 1=1 ");
                strSql.AppendFormat(" and {0} ", strwhere);
            }
            else
            {
                string strwhere = PubFunction.GetMemListShopAuthority(this._UserShopID, "SysShop.ShopID", " 1=1 ");
                strSql.AppendFormat(" and {0} ", strwhere);
            }
            return(strSql.ToString());
        }
예제 #13
0
        protected string QueryCondition()
        {
            string        strMemShopID = this.sltShop.Value;
            StringBuilder strSql       = new StringBuilder();

            strSql.Append(" ShopID>1 and ShopType=3 ");
            if (this._UserShopID != 1)
            {
                string str = PubFunction.GetMemListShopAuthority(this._UserShopID, "ShopID", " 1=1 ");
                strSql.AppendFormat(" and {0} ", str);
            }
            else
            {
                string str = PubFunction.GetMemListShopAuthority(this._UserShopID, "ShopID", " 1=1 ");
                strSql.AppendFormat(" and {0} ", str);
            }
            return(strSql.ToString());
        }
예제 #14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         PubFunction.BindShopSelect(this._UserShopID, this.sltShop, this._UserShopID, this._UserShopID != 1);
         this.chkPrint.Checked          = this.curParameter.bolAutoPrint;
         this.sltShop.Value             = this._UserShopID.ToString();
         this.lblUSer.InnerText         = this._UserName;
         this.spGoodsAccounte.InnerText = this.curParameter.strGoodsInPrefix + DateTime.Now.ToString("yyMMddHHmmssffff");
         this.txtCreteTime.Value        = DateTime.Now.ToString("yyyy-MM-dd");
         PubFunction.Get_PrintTitle(ref this.lblPrintTitle, ref this.lblPrintFoot, this._UserShopID);
         if (this._UserShopID != 1)
         {
             this.sltShop.Attributes.Add("disabled", "disabled");
         }
         this.PointNum.Value = PubFunction.GetPointNum("SPRK");
     }
 }
예제 #15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         PubFunction.BindMemLevelSelect(this.sltMemLevelID, true);
         PubFunction.BindShopSelect(this._UserShopID, this.sltShop, true);
         if (string.IsNullOrEmpty(PubFunction.curParameter.EmailAdress) || string.IsNullOrEmpty(PubFunction.curParameter.EmailPwd) || string.IsNullOrEmpty(PubFunction.curParameter.EmailSMTP) || string.IsNullOrEmpty(PubFunction.curParameter.EnterpriseEmailPort.ToString()))
         {
             this.isEmail.Value = "1";
             this.btnChoose.Attributes.Add("disabled", "disabled");
             this.txtCustomEmail.Attributes.Add("disabled", "disabled");
             this.txtTitle.Attributes.Add("disabled", "disabled");
             this.txtEmailContent.Attributes.Add("disabled", "disabled");
             this.btnSendEmail.Attributes.Add("disabled", "disabled");
             this.btnReset.Attributes.Add("disabled", "disabled");
         }
     }
 }
예제 #16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         PubFunction.BindShopSelect(this._UserShopID, this.sltShop, true);
         this.txtStartTime.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).ToString("yyyy-MM-dd");
         this.txtEndTime.Value   = DateTime.Now.ToString("yyyy-MM-dd");
         if (PubFunction.curParameter.dataAuthority != 0)
         {
             if (this._UserShopID > 1)
             {
                 this.sltShop.Value = this._UserShopID.ToString();
             }
         }
         DataTable dt = this.Get_ParameterList(this.QueryCondition());
         this.BindList(dt);
     }
 }
예제 #17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         this.lblOrderAccount.InnerText    = this.curParameter.StorageTimingPrefix + DateTime.Now.ToString("yyMMddHHmmssffff");
         this.lblOrderCreateTime.InnerText = DateTime.Now.ToString();
         this.lblOrderUSer.InnerText       = this._UserName;
         PubFunction.Get_PrintTitle(ref this.lblPrintTitle, ref this.lblPrintFoot, this._UserShopID);
         this.lblIsSMS.Style.Add("display", (this.curParameter.bolMoneySms && this.curParameter.bolAutoSendSMSByTimingConsumption) ? "\"\"" : "none");
         this.chkIsSMS.Checked                = this.curParameter.bolSms;
         this.chkPrint.Checked                = this.curParameter.bolAutoPrint;
         this.chkAllowPwd.Checked             = this.curParameter.bolPwd;
         this.chkSMS.Checked                  = (this.curParameter.bolMoneySms && this.curParameter.IsAutoSendSMSByStorageTiming);
         this.ucMemberSearch.BolSenseICCard   = this.curParameter.bolSenseiccard;
         this.ucMemberSearch.BolContactICCard = this.curParameter.bolContacticcard;
         this.PointNum.Value                  = PubFunction.GetPointNum("HYCS");
     }
 }
예제 #18
0
 public ActionResult SetSelectBrandsInColum(int id, List <ReColumnBrand> Par)
 {
     db.m_objcontext.ExecuteStoreCommand("DELETE ReColumnBrands WHERE ColumnID = " + id);
     foreach (ReColumnBrand item in Par)
     {
         db.ReColumnBrands.Add(item);
     }
     db.SaveChanges();
     if (Request.IsAjaxRequest())
     {
         string jsonStr = PubFunction.BuildResult("OK");
         return(Content(jsonStr));
     }
     else
     {
         return(View());
     }
 }
예제 #19
0
        private void Get_ParameterList(string strSql)
        {
            string        strStartTime = this.txtStartTime.Value;
            string        strEntTime   = this.txtEndTime.Value + " 23:59:59";
            StringBuilder strTime      = new StringBuilder();

            if (strStartTime != "")
            {
                this.strwhere.AppendFormat(" and POINTCREATETIME>='{0}'", strStartTime);
                strTime.AppendFormat(" and PointLOG.POINTCREATETIME>='{0}' ", strStartTime);
            }
            if (strEntTime != "")
            {
                this.strwhere.AppendFormat(" and POINTCREATETIME<='{0}'", strEntTime);
                strTime.AppendFormat(" and PointLOG.POINTCREATETIME<='{0}'", strEntTime);
            }
            PointRate bllPointRate = new PointRate();
            int       Counts       = this.NetPagerParameter.RecordCount;

            strSql += "and MEM.MEMID<>0 AND MEM.MEMSHOPID=SYSSHOP.SHOPID";
            strSql += " AND MEM.MEMLEVELID=MEMLEVEL.LEVELID";
            strSql += " AND MEM.MEMUSERID=SYSUSER.USERID";
            if (RptPointRate.MemCardId != null)
            {
                strSql += string.Format(" and Mem.MemCard={0}", RptPointRate.MemCardId);
            }
            strSql = PubFunction.GetShopAuthority(this._UserShopID, "MemShopID", strSql);
            DataTable db = bllPointRate.GetListSP(this.NetPagerParameter.PageSize, this.NetPagerParameter.CurrentPageIndex, out Counts, strTime.ToString(), 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
            });
            this.rptRptPointRate.DataSource = db;
            this.rptRptPointRate.DataBind();
            PageBase.BindSerialRepeater(this.rptRptPointRate, this.NetPagerParameter.PageSize * (this.NetPagerParameter.CurrentPageIndex - 1));
        }
예제 #20
0
        protected string QueryCondition()
        {
            string        strQueryMem        = this.txtQueryMem.Value;
            string        strMemLevelID      = this.sltMemLevelID.Value;
            string        strMemShopID       = this.sltShop.Value;
            string        strTotalSymbols    = this.sltTotalMoney.Value;
            string        strTotalMoney      = (this.txtTotalMoney.Value.Trim() != "") ? this.txtTotalMoney.Value.Trim() : "0";
            decimal       dclTotalMoney      = decimal.Parse(strTotalMoney);
            string        strDiscountSymbols = this.sltDiscountMoney.Value;
            string        strDiscountMoney   = (this.txtDiscountMoney.Value.Trim() != "") ? this.txtDiscountMoney.Value.Trim() : "0";
            decimal       dclDiscountMoney   = decimal.Parse(strDiscountMoney);
            StringBuilder strSql             = new StringBuilder();

            strSql.Append("1=1");
            if (strQueryMem != "")
            {
                strSql.AppendFormat("and (MemCard = '{0}' or MemName like '%{0}%' or MemMobile = '{0}' or MemCardNumber = '{0}')", strQueryMem);
            }
            if (strMemLevelID != "")
            {
                strSql.AppendFormat("and Mem.MemLevelID={0}", int.Parse(strMemLevelID));
            }
            if (strMemShopID != "")
            {
                strSql.AppendFormat("and OrderShopID={0}", int.Parse(strMemShopID));
            }
            if (dclTotalMoney != 0m)
            {
                strSql.AppendFormat("and OrderTotalMoney" + strTotalSymbols + "{0}", dclTotalMoney);
            }
            if (dclDiscountMoney != 0m)
            {
                strSql.AppendFormat("and OrderDiscountMoney" + strDiscountSymbols + "{0}", dclDiscountMoney);
            }
            if (this.txtStartTime.Value != "")
            {
                strSql.AppendFormat("and OrderCreateTime>='{0}' ", this.txtStartTime.Value);
            }
            if (this.txtEndTime.Value != "")
            {
                strSql.AppendFormat("and OrderCreateTime<='{0}'", PubFunction.TimeEndDay(this.txtEndTime.Value));
            }
            return(strSql.ToString());
        }
예제 #21
0
        protected string QueryCondition()
        {
            string        strMemShopID = this.sltShop.Value;
            StringBuilder strSql       = new StringBuilder();

            strSql.Append(" SysShopCmsLog.UserID = SysUser.UserID AND SysShopCmsLog.OutShopID = SysShop.ShopID ");
            if (strMemShopID != "")
            {
                strSql.AppendFormat(" and OutShopID={0}", int.Parse(strMemShopID));
            }
            if (this.txtShopSmsAccount.Value.Trim() != "")
            {
                strSql.AppendFormat(" and ShopCmsAccount='{0}'", this.txtShopSmsAccount.Value.Trim());
            }
            if (this.sltCzlx.Value != "")
            {
                strSql.AppendFormat(" and ShopCmsType = '{0}'", this.sltCzlx.Value);
            }
            if (base.Request.QueryString["PID"] != null)
            {
                string pid = base.Request.QueryString["PID"].ToString();
                if (pid == "159")
                {
                    strSql.AppendFormat(" and SysShop.ShopType = 2", new object[0]);
                }
                if (pid == "160")
                {
                    strSql.AppendFormat(" and SysShop.ShopType = 3", new object[0]);
                }
                if (pid == "158")
                {
                    strSql.AppendFormat(" and SysShop.ShopType = 1", new object[0]);
                }
            }
            if (this.txtStartTime.Value != "")
            {
                strSql.AppendFormat("and CreateTime>='{0}' ", this.txtStartTime.Value);
            }
            if (this.txtEndTime.Value != "")
            {
                strSql.AppendFormat("and CreateTime<='{0}'", PubFunction.TimeEndDay(this.txtEndTime.Value));
            }
            return(strSql.ToString());
        }
예제 #22
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());
        }
예제 #23
0
        public ActionResult BuildProductsXML(string PIDArrStr)
        {
            if (string.IsNullOrEmpty(PIDArrStr))
            {
                Redirect("/Manager/ProductManager");
            }
            if (string.IsNullOrEmpty(PIDArrStr))
            {
                return(View());
            }
            string[] PIDArr    = PIDArrStr.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            int[]    tmpPIDArr = new int[PIDArr.Length];
            for (int i = 0; i < PIDArr.Length; i++)
            {
                tmpPIDArr[i] = int.Parse(PIDArr[i]);
            }
            Product[] productArr = (from product in db.Products
                                    where tmpPIDArr.Contains(product.PID)
                                    select product).ToArray();
            //生成所需的商品XML数据
            string FileName = "Product_" + Guid.NewGuid().ToString() + ".xlsx";
            string serverFP = PubFunction.GetUploadFilePathUsingDate();
            string localFP  = Server.MapPath(serverFP);

            if (!Directory.Exists(localFP))
            {
                Directory.CreateDirectory(localFP);
            }
            Dictionary <string, MemberToStringDG> dict = new Dictionary <string, MemberToStringDG>();

            dict.Add("ProductTags", new MemberToStringDG(MTSHelper.ListToString));
            dict.Add("SaleCountLST", new MemberToStringDG(MTSHelper.ListToString));
            byte[] tmpBuffer = PubFunction.SaveToExcel <Product>(productArr, dict);

            Response.Charset         = "UTF-8";
            Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8");
            Response.ContentType     = "application/octet-stream";

            Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode(FileName));
            Response.BinaryWrite(tmpBuffer);
            Response.Flush();
            Response.End();
            return(new EmptyResult());
        }
예제 #24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         if (base.Request.QueryString["MemCard"] != null)
         {
             this.MemCard.Value = base.Request.QueryString["MemCard"];
         }
         this.lblAccount.InnerText      = "zz" + DateTime.Now.ToString("yyMMddHHmmssffff");
         this.lblTransferTime.InnerText = DateTime.Now.ToString();
         this.lblTransferUSer.InnerText = PubFunction.UserIDTOName(this._UserID);
         PubFunction.Get_PrintTitle(ref this.lblPrintTitle, ref this.lblPrintFoot, this._UserShopID);
         this.chkSMS.Checked = (PubFunction.curParameter.bolMoneySms && this.curParameter.bolAutoSendSMSByMemRecharge);
         this.lblIsSMS.Style.Add("display", (this.curParameter.bolMoneySms && this.curParameter.bolAutoSendSMSByMemRecharge) ? "\"\"" : "none");
         this.chkIsSMS.Checked = PubFunction.curParameter.bolSms;
         this.ucMemberSearch.BolSenseICCard   = this.curParameter.bolSenseiccard;
         this.ucMemberSearch.BolContactICCard = this.curParameter.bolContacticcard;
     }
 }
예제 #25
0
        protected string QueryCondition()
        {
            string        strQueryMem     = this.txtQueryMem.Value;
            string        strMemLevelID   = this.sltMemLevelID.Value;
            string        strMemShopID    = this.sltShop.Value;
            string        strPointSymbols = this.sltPoint.Value;
            string        strPoint        = (this.txtPoint.Value.Trim() != "") ? this.txtPoint.Value.Trim() : "0";
            decimal       intPoint        = decimal.Parse(strPoint);
            StringBuilder strSql          = new StringBuilder();

            strSql.Append("1=1");
            if (strQueryMem != "")
            {
                strSql.AppendFormat("and (MemCard = '{0}' or MemName like '%{0}%' or MemMobile = '{0}' or MemCardNumber = '{0}' )", strQueryMem);
            }
            if (strMemLevelID != "")
            {
                strSql.AppendFormat("and Mem.MemLevelID={0}", int.Parse(strMemLevelID));
            }
            if (strMemShopID != "")
            {
                string strwhere = PubFunction.GetMemListShopAuthority(int.Parse(strMemShopID), "PointShopID", " 1=1 ");
                strSql.AppendFormat(" and {0}", strwhere);
            }
            else
            {
                string strwhere = PubFunction.GetMemListShopAuthority(this._UserShopID, "PointShopID", " 1=1 ");
                strSql.AppendFormat(" and {0}", strwhere);
            }
            if (intPoint != 0m)
            {
                strSql.AppendFormat("and PointNumber" + strPointSymbols + "{0}", intPoint);
            }
            if (this.txtStartTime.Value != "")
            {
                strSql.AppendFormat("and PointCreateTime>='{0}' ", this.txtStartTime.Value);
            }
            if (this.txtEndTime.Value != "")
            {
                strSql.AppendFormat("and PointCreateTime<='{0}'", PubFunction.TimeEndDay(this.txtEndTime.Value));
            }
            return(strSql.ToString());
        }
예제 #26
0
 protected void btnExtraParameter_Click(object sender, EventArgs e)
 {
     Chain.Model.SysParameter modelParameter = new Chain.Model.SysParameter();
     modelParameter.ParameterID   = 1;
     modelParameter.Sms           = this.chkSms.Checked;
     modelParameter.MoneySms      = this.chkMoneySms.Checked;
     modelParameter.IsSmsShopName = this.chkIsSmsShopName.Checked;
     modelParameter.SmsShopName   = this.txtSmsShopName.Text.Trim();
     modelParameter.SmsSeries     = this.txtNotificationSMS.Text.Trim();
     modelParameter.SmsSerialPwd  = ((this.txtNotificationSMSPwd.Text.Trim() == "") ? this.curParameter.strNotificationSMSPwd : this.txtNotificationSMSPwd.Text.Trim());
     modelParameter.MMS           = this.chkMMS.Checked;
     modelParameter.MMSSeries     = this.txtMMSSeries.Text.Trim();
     modelParameter.MMSSerialPwd  = ((this.txtMMSSeriesPwd.Text.Trim() == "") ? this.curParameter.strMMSSerialPwd : this.txtMMSSeriesPwd.Text.Trim());
     modelParameter.Tel           = this.chkTel.Checked;
     modelParameter.TelNoMember   = this.chkTelNoMember.Checked;
     modelParameter.IsAutoSendSMSByMemRegister          = this.ckbIsAutoSendSMSByMemRegister.Checked;
     modelParameter.IsAutoSendMMSByMemRegister          = this.ckbIsAutoSendMMSByMemRegister.Checked;
     modelParameter.IsAutoSendSMSByMemRecharge          = this.ckbIsAutoSendSMSByMemRecharge.Checked;
     modelParameter.IsAutoSendSMSByMemWithdraw          = this.ckbIsAutoSendSMSByMemWithdraw.Checked;
     modelParameter.IsAutoSendSMSByMemGiftExchange      = this.ckbIsAutoSendSMSByMemGiftExchange.Checked;
     modelParameter.IsAutoSendSMSByMemPointChange       = this.ckbIsAutoSendSMSByMemPointChange.Checked;
     modelParameter.IsAutoSendSMSByCommodityConsumption = this.ckbIsAutoSendSMSByCommodityConsumption.Checked;
     modelParameter.IsAutoSendSMSByFastConsumption      = this.ckbIsAutoSendSMSByFastConsumption.Checked;
     modelParameter.IsAutoSendSMSByMemRedTimes          = this.ckbIsAutoSendSMSByMemRedTimes.Checked;
     modelParameter.IsAutoSendSMSByTimingConsumption    = this.ckbIsAutoSendSMSByTimingConsumption.Checked;
     modelParameter.IsAutoSendSMSByStorageTiming        = this.ckbIsAutoSendSMSByStorageTiming.Checked;
     modelParameter.MarketingSMS          = this.chkMarketingSMS.Checked;
     modelParameter.MarketingSmsSeries    = this.txtMarketingSMS.Text.Trim();
     modelParameter.MarketingSmsSerialPwd = ((this.txtMarketingSMSPwd.Text.Trim() == "") ? this.curParameter.strMarketingSmsSerialPwd : this.txtMarketingSMSPwd.Text.Trim());
     Chain.BLL.SysParameter bllUpdateParameter = new Chain.BLL.SysParameter();
     if (bllUpdateParameter.UpdateExtraParameter(modelParameter))
     {
         PubFunction pub = new PubFunction();
         PubFunction.curParameter = pub.LoadSysParameter();
         this.curParameter        = PubFunction.curParameter;
         PubFunction.SaveSysLog(this._UserID, 3, "增值服务-参数设置", "增值服务的参数设置成功", this._UserShopID, DateTime.Now, PubFunction.ipAdress);
         base.OutputWarn("保存成功!");
     }
     else
     {
         base.OutputWarn("系统异常,未保存数据,请再次点击保存!");
     }
 }
예제 #27
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;
            }
        }
예제 #28
0
        public ActionResult LoginByQQ(string openID, string accessToken)
        {
            //判断该QQ是否已有账号关联
            User user = db.Users.FirstOrDefault(r => r.QQOpenID == openID);

            if (user != null)
            {
                LoginSuccess(user);
            }
            if (Request.IsAjaxRequest())
            {
                string jsonStr = PubFunction.BuildResult(user);
                return(Content(jsonStr));
            }
            else
            {
                return(View());
            }
        }
예제 #29
0
        public ActionResult LoginByWB(string wbId)
        {
            //判断该微博号是否已有账号关联
            User user = db.Users.FirstOrDefault(r => r.WBID == wbId);

            if (user != null)
            {
                LoginSuccess(user);
            }
            if (Request.IsAjaxRequest())
            {
                string jsonStr = PubFunction.BuildResult(user);
                return(Content(jsonStr));
            }
            else
            {
                return(View());
            }
        }
예제 #30
0
        protected string QueryCondition()
        {
            string        strQuery      = PubFunction.RemoveSpace(this.txtQuery.Value);
            string        strUserlID    = this.sltUserID.Value;
            string        strShopID     = this.sltShop.Value;
            int           intChangeType = int.Parse(this.sltChangeType.Value);
            StringBuilder strSql        = new StringBuilder();

            strSql.Append("1=1");
            if (strQuery != "")
            {
                strSql.AppendFormat(" and ((GoodsAccount like '%{0}%') or (id in( select goodslogid from goodslogdetail where \r\n                                    goodsid in(select goodsid from goods where name like '%{0}%'))))", strQuery);
            }
            if (strShopID != "")
            {
                strSql.AppendFormat(" and (GoodsLog.ShopID={0} or ChangeShopID={0})", int.Parse(strShopID));
            }
            if (strUserlID != "")
            {
                strSql.AppendFormat(" and GoodsLog.UserID={0}", int.Parse(strUserlID));
            }
            if (this.txtStartTime.Value != "")
            {
                strSql.AppendFormat(" and CreateTime>='{0}' ", this.txtStartTime.Value);
            }
            if (this.txtEndTime.Value != "")
            {
                try
                {
                    DateTime txtEndTimes = DateTime.Parse(Convert.ToDateTime(this.txtEndTime.Value).ToString("yyyy-MM-dd") + " 23:59:59");
                    strSql.AppendFormat(" and CreateTime<='{0}'", txtEndTimes);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            if (intChangeType != -1)
            {
                strSql.AppendFormat(" and Type = {0}", intChangeType);
            }
            return(strSql.ToString());
        }