protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { this.spOrderAccount.InnerText = this.curParameter.strGoodsExpensePrefix + DateTime.Now.ToString("yyMMddHHmmssffff"); if (base.Request.QueryString["MemCard"] != null) { this.MemCard.Value = base.Request.QueryString["MemCard"]; } this.ucMemberSearch.BolSenseICCard = this.curParameter.bolSenseiccard; this.ucMemberSearch.BolContactICCard = this.curParameter.bolContacticcard; if (base.Request.QueryString["OID"] != null) { this.txtOrderID.Value = base.Request.QueryString["OID"]; Chain.Model.OrderLog modelOrder = new Chain.BLL.OrderLog().GetModel(int.Parse(base.Request.QueryString["OID"])); this.txtOrderID.Value = modelOrder.OrderID.ToString(); this.spOrderAccount.InnerText = modelOrder.OrderAccount; } this.chkSMS.Checked = (this.curParameter.bolMoneySms && this.curParameter.bolAutoSendSMSByCommodityConsumption); this.chkPrint.Checked = this.curParameter.bolAutoPrint; this.lblExpenseUSer.InnerText = this._UserName; this.ShopID.Value = this._UserShopID.ToString(); this.txtExpenseTime.Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); this.chkAllowPwd.Checked = this.curParameter.bolPwd; this.chkStaff.Checked = this.curParameter.bolStaff; this.txtStaffType.Value = this.curParameter.bolStaffType.ToString(); PubFunction.Get_PrintTitle(ref this.lblPrintTitle, ref this.lblPrintFoot, this._UserShopID); PubFunction.BindStaff(this._UserShopID, this.sltStaff, true); this.PointNum.Value = PubFunction.GetPointNum("SPXF"); } }
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"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { Chain.BLL.SysNotice bllNotice = new Chain.BLL.SysNotice(); DataTable dtNotice = bllNotice.GetList(5, "", "SysNoticeTime desc").Tables[0]; this.rptNotice.DataSource = dtNotice; this.rptNotice.DataBind(); this.txtMemStartTime.Value = DateTime.Now.AddDays(-20.0).ToString("yyyy-MM-dd"); this.txtMemEndTime.Value = DateTime.Now.ToString("yyyy-MM-dd"); int shopID = this.UserModel.UserShopID; this.sltShop.Value = shopID.ToString(); Chain.Model.SysShop modelShop = new Chain.BLL.SysShop().GetModel(this.UserModel.UserShopID); if (modelShop.ShopImageUrl != null && modelShop.ShopImageUrl.ToString() != "") { this.spShopPhoto.Src = modelShop.ShopImageUrl; } this.spShopName.InnerHtml = modelShop.ShopName; this.spShopContactMan.InnerHtml = modelShop.ShopContactMan; this.spShopTel.InnerHtml = modelShop.ShopTelephone; this.spShopAddress.InnerHtml = this.BindAddress(this.UserModel.UserShopID); Chain.BLL.SysGroup bllGroup = new Chain.BLL.SysGroup(); Chain.Model.SysGroup modelGroup = bllGroup.GetModel(this.UserModel.UserGroupID); this.spGroupName.InnerHtml = modelGroup.GroupName; Chain.BLL.Mem bllMem = new Chain.BLL.Mem(); Chain.BLL.MemRecharge bllMemRecharge = new Chain.BLL.MemRecharge(); Chain.BLL.OrderLog bllOrderLog = new Chain.BLL.OrderLog(); Chain.BLL.MemCount bllMemCount = new Chain.BLL.MemCount(); string strMemToday = "CONVERT(varchar(10),MemCreateTime,120) = CONVERT(varchar(10),GETDATE(),120) AND MemID > 0"; string strMemYesterday = "CONVERT(varchar(10),MemCreateTime,120) = CONVERT(varchar(10), DATEADD(day,-1,GETDATE()),120) AND MemID > 0"; string strMoneyToday = "CONVERT(varchar(10),RechargeCreateTime,120) = CONVERT(varchar(10),GETDATE(),120)"; string strMoneyYesterday = "CONVERT(varchar(10),RechargeCreateTime,120) = CONVERT(varchar(10), DATEADD(day,-1,GETDATE()),120)"; string strGetMoneyToday = "CONVERT(varchar(10),OrderCreateTime,120) = CONVERT(varchar(10),GETDATE(),120)"; string strGetMoneyYesterday = "CONVERT(varchar(10),OrderCreateTime,120) = CONVERT(varchar(10), DATEADD(day,-1,GETDATE()),120)"; string strGetCountMoneyToday = "CONVERT(varchar(10),CountCreateTime,120) = CONVERT(varchar(10),GETDATE(),120)"; string strGetCountMoneyYesterday = "CONVERT(varchar(10),CountCreateTime,120) = CONVERT(varchar(10), DATEADD(day,-1,GETDATE()),120)"; if (modelShop.ShopID > 1) { strMemToday += string.Format(" AND MemShopID = {0}", shopID); strMemYesterday += string.Format(" AND MemShopID = {0}", shopID); strMoneyToday += string.Format(" AND RechargeShopID = {0}", shopID); strMoneyYesterday += string.Format(" AND RechargeShopID = {0}", shopID); strGetMoneyToday += string.Format(" AND OrderShopID = {0}", shopID); strGetMoneyYesterday += string.Format(" AND OrderShopID = {0}", shopID); strGetCountMoneyToday += string.Format(" AND CountShopID = {0}", shopID); strGetCountMoneyYesterday += string.Format(" AND CountShopID = {0}", shopID); } this.spMemToday.InnerHtml = bllMem.GetRecordCount(strMemToday).ToString(); this.spMemYesterday.InnerHtml = bllMem.GetRecordCount(strMemYesterday).ToString(); int memtoday = int.Parse(this.spMemToday.InnerHtml); int memyesterday = int.Parse(this.spMemYesterday.InnerHtml); decimal rate; if (memtoday > memyesterday) { this.imgMemberRate.Src = "images/icon (18).png"; if (memyesterday != 0) { rate = memtoday - memyesterday / memyesterday; } else { rate = 1m; } } else { if (memyesterday != 0) { rate = memyesterday - memtoday / memyesterday; } else { rate = 0m; } this.imgMemberRate.Src = "images/icon (1).png"; } this.spMemberRate.InnerHtml = (rate * 100m).ToString("F1") + "%"; this.spMoneyToday.InnerHtml = bllMemRecharge.GetRecMoney(strMoneyToday).ToString("F2"); this.spMoneyYesterday.InnerHtml = bllMemRecharge.GetRecMoney(strMoneyYesterday).ToString("F2"); decimal moneytoday = decimal.Parse(this.spMoneyToday.InnerHtml); decimal moneyyesterday = decimal.Parse(this.spMoneyYesterday.InnerHtml); if (moneytoday > moneyyesterday) { this.imgMoneyRate.Src = "images/icon (18).png"; if (moneyyesterday != 0m) { rate = moneytoday - moneyyesterday / moneyyesterday; } else { rate = 1m; } } else { if (moneyyesterday != 0m) { rate = moneyyesterday - moneytoday / moneyyesterday; } else { rate = 0m; } this.imgMoneyRate.Src = "images/icon (1).png"; } this.spMoneyRate.InnerHtml = (rate * 100m).ToString("F1") + "%"; this.spGetMoneyToday.InnerHtml = (bllOrderLog.GetTotalCash(strGetMoneyToday) + bllMemCount.GetTotalCash(strGetCountMoneyToday) + Convert.ToDecimal(this.spMoneyToday.InnerHtml)).ToString("F2"); this.spGetMoneyYesterday.InnerHtml = (bllOrderLog.GetTotalCash(strGetMoneyYesterday) + bllMemCount.GetTotalCash(strGetCountMoneyYesterday) + Convert.ToDecimal(this.spMoneyYesterday.InnerHtml)).ToString("F2"); decimal cashtoday = decimal.Parse(this.spGetMoneyToday.InnerHtml); decimal cashyesterday = decimal.Parse(this.spGetMoneyYesterday.InnerHtml); if (moneytoday > cashyesterday) { this.imgCashRate.Src = "images/icon (18).png"; if (cashyesterday != 0m) { rate = cashtoday - cashyesterday / cashyesterday; } else { rate = 1m; } } else { if (cashyesterday != 0m) { rate = cashyesterday - cashtoday / cashyesterday; } else { rate = 0m; } this.imgCashRate.Src = "images/icon (1).png"; } this.spCashRate.InnerHtml = (rate * 100m).ToString("F1") + "%"; } }
protected void Page_Load(object sender, EventArgs e) { this.shopID = this._UserShopID; this.UserGroupID = this._UserGroupID; this.userid = this._UserID; this.txtMemStartTime.Value = DateTime.Now.AddDays(-20.0).ToString("yyyy-MM-dd"); this.txtMemEndTime.Value = DateTime.Now.ToString("yyyy-MM-dd"); this.strOrder = " SysNoticeTime desc"; this.sltShop.Value = this.shopID.ToString(); Chain.BLL.SysNotice bllNotice = new Chain.BLL.SysNotice(); DataTable dtNotice = bllNotice.GetList(5, this.strSql, this.strOrder).Tables[0]; this.rpNotice.DataSource = dtNotice; this.rpNotice.DataBind(); Chain.BLL.Mem bllMem = new Chain.BLL.Mem(); Chain.BLL.OrderLog bllLog = new Chain.BLL.OrderLog(); Chain.BLL.SysShop bllShop = new Chain.BLL.SysShop(); Chain.Model.SysShop modelShop = bllShop.GetModel(this.shopID); this.lblShopName.Text = modelShop.ShopName; this.lblShopAddress.Text = modelShop.ShopAddress; this.lblShopMem.Text = modelShop.ShopContactMan; this.lblShopPhone.Text = modelShop.ShopTelephone; if (this.shopID != 1 && PubFunction.curParameter.bolShopPointManage) { this.lblPointCount.Text = modelShop.PointCount.ToString(); } else { this.lblPoint.Visible = false; } if (this.shopID != 1 && PubFunction.curParameter.bolShopSmsManage) { this.lblSmsCount.Text = modelShop.SmsCount.ToString(); } else { this.lblSms.Visible = false; } Chain.Model.SysGroup modelSysGroup = new Chain.BLL.SysGroup().GetModel(this.UserGroupID); this.lbGroupName.Text = modelSysGroup.GroupName; Chain.BLL.MemRecharge bllMemRecharge = new Chain.BLL.MemRecharge(); Chain.BLL.OrderLog bllOrderLog = new Chain.BLL.OrderLog(); Chain.BLL.MemCount bllMemCount = new Chain.BLL.MemCount(); string strMemToday = "CONVERT(varchar(10),MemCreateTime,120) = CONVERT(varchar(10),GETDATE(),120) AND MemID > 0"; string strMemYesterday = "CONVERT(varchar(10),MemCreateTime,120) = CONVERT(varchar(10), DATEADD(day,-1,GETDATE()),120) AND MemID > 0"; string strMoneyToday = "CONVERT(varchar(10),RechargeCreateTime,120) = CONVERT(varchar(10),GETDATE(),120)"; string strMoneyYesterday = "CONVERT(varchar(10),RechargeCreateTime,120) = CONVERT(varchar(10), DATEADD(day,-1,GETDATE()),120)"; string strGetMoneyToday = "CONVERT(varchar(10),OrderCreateTime,120) = CONVERT(varchar(10),GETDATE(),120)"; string strGetMoneyYesterday = "CONVERT(varchar(10),OrderCreateTime,120) = CONVERT(varchar(10), DATEADD(day,-1,GETDATE()),120)"; string strGetCountMoneyToday = "CONVERT(varchar(10),CountCreateTime,120) = CONVERT(varchar(10),GETDATE(),120)"; string strGetCountMoneyYesterday = "CONVERT(varchar(10),CountCreateTime,120) = CONVERT(varchar(10), DATEADD(day,-1,GETDATE()),120)"; if (modelShop.ShopID > 1) { strMemToday += string.Format(" AND MemShopID = {0}", this.shopID); strMemYesterday += string.Format(" AND MemShopID = {0}", this.shopID); strMoneyToday += string.Format(" AND RechargeShopID = {0}", this.shopID); strMoneyYesterday += string.Format(" AND RechargeShopID = {0}", this.shopID); strGetMoneyToday += string.Format(" AND OrderShopID = {0}", this.shopID); strGetMoneyYesterday += string.Format(" AND OrderShopID = {0}", this.shopID); strGetCountMoneyToday += string.Format(" AND CountShopID = {0}", this.shopID); strGetCountMoneyYesterday += string.Format(" AND CountShopID = {0}", this.shopID); } this.ltlMemToday.Text = bllMem.GetRecordCount(strMemToday).ToString(); this.ltlMemYesterday.Text = bllMem.GetRecordCount(strMemYesterday).ToString(); this.lblrMoneyToday.Text = bllMemRecharge.GetRecMoney(strMoneyToday).ToString("F2"); this.lblrMoneyYesterday.Text = bllMemRecharge.GetRecMoney(strMoneyYesterday).ToString("F2"); this.lblGetMoneyToday.Text = (bllOrderLog.GetTotalCash(strGetMoneyToday) + bllMemCount.GetTotalCash(strGetCountMoneyToday) + Convert.ToDecimal(this.lblrMoneyToday.Text)).ToString("F2"); this.lblGetMoneyYesterday.Text = (bllOrderLog.GetTotalCash(strGetMoneyYesterday) + bllMemCount.GetTotalCash(strGetCountMoneyYesterday) + Convert.ToDecimal(this.lblrMoneyYesterday.Text)).ToString("F2"); this.GetSysRemind(); }