Пример #1
0
 private Chain.Model.SysUser Decode(string Code, out DateTime CheckTime)
 {
     Chain.Model.SysUser model = new Chain.Model.SysUser();
     CheckTime = DateTime.Now.AddDays(-1.0);
     Code      = DESEncrypt.Decrypt(Code);
     string[] temp = Code.Split(new char[]
     {
         '|'
     });
     Chain.Model.SysUser result;
     if (temp.Length == 6)
     {
         model.UserID      = Convert.ToInt32(temp[0]);
         model.UserAccount = temp[1];
         model.UserName    = temp[2];
         model.UserGroupID = Convert.ToInt32(temp[3]);
         model.UserShopID  = Convert.ToInt32(temp[4]);
         CheckTime         = Convert.ToDateTime(temp[5]);
         result            = model;
     }
     else
     {
         result = null;
     }
     return(result);
 }
Пример #2
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.BLL.OrderLog  bllExchange = new Chain.BLL.OrderLog();
             DataTable           dt;
             if (modelUser.UserShopID != 1)
             {
                 dt = bllExchange.GetList(100, " OrderLog.OrderShopID= " + modelUser.UserShopID, " OrderCreateTime desc").Tables[0];
             }
             else
             {
                 dt = bllExchange.GetList(100, "1=1", "OrderCreateTime desc").Tables[0];
             }
             this.rptExchange.DataSource = dt;
             this.rptExchange.DataBind();
             if (dt.Rows.Count < 10 || base.Request.QueryString["type"] == "all")
             {
                 this.moreExpense.Attributes.Add("style", "display:none");
             }
             else
             {
                 this.moreExpense.Attributes.Add("style", "");
             }
         }
         else
         {
             base.Response.Redirect("login.aspx");
         }
     }
 }
Пример #3
0
        private bool CheckLoginStatus()
        {
            string code = this.GetCookie("LoginState");

            if (string.IsNullOrEmpty(code) && HttpContext.Current.Session["LoginState"] != null)
            {
                code = HttpContext.Current.Session["LoginState"].ToString();
            }
            bool result;

            if (!string.IsNullOrEmpty(code))
            {
                Chain.Model.SysUser model = this.Decode(code, out this._lastUpdateTime);
                if (model != null && this._lastUpdateTime > DateTime.Now.AddHours(-6.0))
                {
                    this.IsLoggedOn = true;
                    this.LoginUser  = model;
                    if (this._lastUpdateTime.AddMinutes(30.0) < DateTime.Now)
                    {
                        this._lastUpdateTime = DateTime.Now;
                        code = this.Encode(model, this._lastUpdateTime);
                        this.LoginIn(code);
                    }
                    result = true;
                    return(result);
                }
            }
            result = false;
            return(result);
        }
Пример #4
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";
         }
     }
 }
Пример #5
0
        private string Encode(Chain.Model.SysUser User, DateTime UpdateTime)
        {
            string code = string.Format("{0}|{1}|{2}|{3}|{4}|{5}", new object[]
            {
                User.UserID,
                User.UserAccount,
                User.UserName,
                User.UserGroupID,
                User.UserShopID,
                UpdateTime
            });

            return(DESEncrypt.Encrypt(code));
        }
Пример #6
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");
         }
     }
 }
Пример #7
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");
     }
 }
Пример #8
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");
     }
 }
Пример #9
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");
         }
     }
 }
Пример #10
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);
        }
Пример #11
0
    public static void PointRateUpdate(Chain.Model.Mem mem, int point, int pointType, int mymemID, Chain.Model.SysUser User, string OrderAccount)
    {
        if (MEMPointUpdate.NowRateLevel <= MEMPointUpdate.RateLevel && mem.MemRecommendID != 0)
        {
            Chain.Model.Mem TEMPMEM = MEMPointUpdate.bll.GetModel(mem.MemRecommendID);
            if (TEMPMEM != null)
            {
                int temp = 0;
                if (MEMPointUpdate.RateType)
                {
                    temp = Convert.ToInt32(decimal.Truncate(point * (MEMPointUpdate.MEMRate[MEMPointUpdate.NowRateLevel - 1] / 100m)));
                }
                else
                {
                    temp = Convert.ToInt32(MEMPointUpdate.MEMRate[MEMPointUpdate.NowRateLevel - 1]);
                }
                if (PubFunction.IsShopPoint(User.UserShopID, ref temp))
                {
                    TEMPMEM.MemPoint += temp;
                    int flag = MEMPointUpdate.bll.Update(TEMPMEM);
                    MEMPointUpdate.sumPoint += temp;
                    if (flag == 1)
                    {
                        PubFunction.UpdateMemLevel(TEMPMEM);
                        Chain.Model.PointLog modelPoint = new Chain.Model.PointLog();
                        modelPoint.PointMemID      = TEMPMEM.MemID;
                        modelPoint.PointNumber     = temp;
                        modelPoint.PointChangeType = 9;
                        modelPoint.PointShopID     = TEMPMEM.MemShopID;
                        modelPoint.PointCreateTime = DateTime.Now;
                        modelPoint.PointUserID     = TEMPMEM.MemUserID;
                        modelPoint.PointOrderCode  = MEMPointUpdate.PointOrderCode;
                        modelPoint.PointGiveMemID  = mymemID;
                        switch (pointType)
                        {
                        case -1:
                            modelPoint.PointRemark = string.Concat(new object[]
                            {
                                "卡号:",
                                MEMPointUpdate.MEMCard,
                                ",姓名:",
                                MEMPointUpdate.MEMName,
                                "的会员商品消费退货,获得积分:[",
                                temp,
                                "]"
                            });
                            break;

                        case 0:
                        case 4:
                            break;

                        case 1:
                            modelPoint.PointRemark = string.Concat(new object[]
                            {
                                "卡号:",
                                MEMPointUpdate.MEMCard,
                                ",姓名:",
                                MEMPointUpdate.MEMName,
                                "的会员商品消费,获得积分:[",
                                temp,
                                "]"
                            });
                            break;

                        case 2:
                            modelPoint.PointRemark = string.Concat(new object[]
                            {
                                "卡号:",
                                MEMPointUpdate.MEMCard,
                                ",姓名:",
                                MEMPointUpdate.MEMName,
                                "的会员快速消费,获得积分:[",
                                temp,
                                "]"
                            });
                            break;

                        case 3:
                            modelPoint.PointRemark = string.Concat(new object[]
                            {
                                "卡号:",
                                MEMPointUpdate.MEMCard,
                                ",姓名:",
                                MEMPointUpdate.MEMName,
                                "的会员充次,获得积分:[",
                                temp,
                                "]"
                            });
                            break;

                        case 5:
                            modelPoint.PointRemark = string.Concat(new object[]
                            {
                                "卡号:",
                                MEMPointUpdate.MEMCard,
                                ",姓名:",
                                MEMPointUpdate.MEMName,
                                "的会员注册,获得积分:[",
                                temp,
                                "]"
                            });
                            break;

                        case 6:
                            modelPoint.PointRemark = string.Concat(new object[]
                            {
                                "卡号:",
                                MEMPointUpdate.MEMCard,
                                ",姓名:",
                                MEMPointUpdate.MEMName,
                                "的会员手动增加积分,获得积分:[",
                                temp,
                                "]"
                            });
                            break;

                        default:
                            switch (pointType)
                            {
                            case 14:
                                modelPoint.PointRemark = string.Concat(new object[]
                                {
                                    "卡号:",
                                    MEMPointUpdate.MEMCard,
                                    ",姓名:",
                                    MEMPointUpdate.MEMName,
                                    "的会员充时增加积分,获得积分:[",
                                    temp,
                                    "]"
                                });
                                break;

                            case 15:
                                modelPoint.PointRemark = string.Concat(new object[]
                                {
                                    "卡号:",
                                    MEMPointUpdate.MEMCard,
                                    ",姓名:",
                                    MEMPointUpdate.MEMName,
                                    "的会员充值增加积分,获得积分:[",
                                    temp,
                                    "]"
                                });
                                break;
                            }
                            break;
                        }
                        Chain.BLL.PointLog bllPoint = new Chain.BLL.PointLog();
                        bllPoint.Add(modelPoint);
                        PubFunction.SaveSysLog(TEMPMEM.MemUserID, 3, "会员积分提成", "会员" + TEMPMEM.MemName + "积分提成成功", TEMPMEM.MemShopID, DateTime.Now, PubFunction.ipAdress);
                    }
                    MEMPointUpdate.NowRateLevel++;
                    MEMPointUpdate.PointRateUpdate(TEMPMEM, point, pointType, mymemID, User, OrderAccount);
                }
            }
        }
    }