Пример #1
0
        public void GetRecharge()
        {
            string flag = "";

            try
            {
                int       pageIndex     = (this.Request["pageIndex"] == null) ? 2 : int.Parse(this.Request["pageIndex"]);
                int       pageSize      = (this.Request["pageSize"] == null) ? 5 : int.Parse(this.Request["pageSize"]);
                string    MemWeiXinCard = this.Request["MemWeiXinCard"];
                string    strWhere      = "MemWeiXinCard='" + MemWeiXinCard + "' and MemRecharge.RechargeShopID = SysShop.ShopID and MemRecharge.RechargeMemID = Mem.MemID and Mem.MemLevelID=MemLevel.LevelID and MemRecharge.RechargeUserID = SysUser.UserID";
                int       count;
                DataTable dt = new Chain.BLL.MemRecharge().GetListSP(pageSize, pageIndex, out count, new string[]
                {
                    strWhere
                }).Tables[0];
                flag = JsonPlus.ToJson(dt, "RechargeType,RechargeAccount,RechargeMoney,RechargeOrdMoney,RechargeGive,RechargeCreateTime");
            }
            catch
            {
            }
            this.Response.Write(flag);
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            WxPayData notifyData = new Notify(this.Page).GetNotifyData();

            if (!notifyData.IsSet("transaction_id"))
            {
                WxPayData res = new WxPayData();
                res.SetValue("return_code", "FAIL");
                res.SetValue("return_msg", "支付结果中微信订单号不存在");
                Log.Error(base.GetType().ToString(), "The Pay result is error : " + res.ToXml());
                this.Page.Response.Write(res.ToXml());
                this.Page.Response.End();
            }
            string transaction_id = notifyData.GetValue("transaction_id").ToString();
            string out_trade_no   = notifyData.GetValue("out_trade_no").ToString();

            if (!this.QueryOrder(transaction_id))
            {
                WxPayData res = new WxPayData();
                res.SetValue("return_code", "FAIL");
                res.SetValue("return_msg", "订单查询失败");
                Log.Error(base.GetType().ToString(), "Order query failure : " + res.ToXml());
                this.Page.Response.Write(res.ToXml());
                this.Page.Response.End();
            }
            else
            {
                string   attach = notifyData.GetValue("attach").ToString();
                string[] data   = attach.Split(new char[]
                {
                    ','
                });
                Chain.BLL.PointLog bllPoint = new Chain.BLL.PointLog();
                int     intUserID           = 1;
                int     intUserShopID       = 1;
                int     intMemID            = int.Parse(data[0]);
                decimal money           = decimal.Parse(data[1]);
                decimal giveMoney       = decimal.Parse(data[2]);
                string  rechargeAccount = data[3];
                int     point           = int.Parse(data[4]);
                int     count           = new Chain.BLL.MemRecharge().GetRecordCount("RechargeAccount='" + rechargeAccount + "'");
                if (count <= 0)
                {
                    if (money + giveMoney <= 0m)
                    {
                        this.Context.Response.Write("-6");
                    }
                    else
                    {
                        string               strRemark   = "无";
                        DateTime             createTime  = DateTime.Now;
                        Chain.BLL.Mem        bllMem      = new Chain.BLL.Mem();
                        Chain.Model.Mem      modelMem    = bllMem.GetModel(intMemID);
                        Chain.BLL.PointLog   bllPoingLog = new Chain.BLL.PointLog();
                        Chain.Model.PointLog mdPoint     = new Chain.Model.PointLog();
                        string               Remark      = string.Concat(new object[]
                        {
                            "会员微信充值,充值金额:[",
                            money.ToString(),
                            "],赠送:[",
                            giveMoney,
                            "],备注:",
                            strRemark
                        });
                        decimal sumMoney = money + giveMoney;
                        Chain.Model.MemRecharge mdRechange = new Chain.Model.MemRecharge();
                        mdRechange.RechargeMemID       = intMemID;
                        mdRechange.RechargeAccount     = rechargeAccount;
                        mdRechange.RechargeMoney       = money + giveMoney;
                        mdRechange.RechargeShopID      = intUserShopID;
                        mdRechange.RechargeUserID      = intUserID;
                        mdRechange.RechargeCreateTime  = createTime;
                        mdRechange.RechargeIsApprove   = true;
                        mdRechange.RechargeRemark      = strRemark;
                        mdRechange.RechargePoint       = point;
                        mdRechange.RechargeType        = 6;
                        mdRechange.RechargeGive        = giveMoney;
                        mdRechange.RechargeCardBalance = modelMem.MemMoney + sumMoney;
                        int flag = new Chain.BLL.MemRecharge().Add(mdRechange);
                        modelMem.MemMoney += sumMoney;
                        modelMem.MemPoint += point;
                        bllMem.Update(modelMem);
                        Chain.Model.MoneyChangeLog moneyChangeLogModel = new Chain.Model.MoneyChangeLog();
                        moneyChangeLogModel.MoneyChangeMemID      = modelMem.MemID;
                        moneyChangeLogModel.MoneyChangeUserID     = intUserID;
                        moneyChangeLogModel.MoneyChangeType       = 1;
                        moneyChangeLogModel.MoneyChangeAccount    = rechargeAccount;
                        moneyChangeLogModel.MoneyChangeMoney      = sumMoney;
                        moneyChangeLogModel.MemMoney              = modelMem.MemMoney;
                        moneyChangeLogModel.MoneyChangeCreateTime = DateTime.Now;
                        moneyChangeLogModel.MoneyChangeGiveMoney  = giveMoney;
                        new Chain.BLL.MoneyChangeLog().Add(moneyChangeLogModel);
                        mdPoint.PointMemID      = modelMem.MemID;
                        mdPoint.PointNumber     = point;
                        mdPoint.PointChangeType = 15;
                        mdPoint.PointRemark     = string.Concat(new object[]
                        {
                            "会员充值,充值金额:[",
                            money,
                            "],获得积分:[",
                            point,
                            "]"
                        });
                        mdPoint.PointShopID     = intUserShopID;
                        mdPoint.PointCreateTime = DateTime.Now;
                        mdPoint.PointUserID     = intUserID;
                        mdPoint.PointOrderCode  = rechargeAccount;
                        bllPoint.Add(mdPoint);
                        if (PubFunction.curParameter.bolShopPointManage)
                        {
                            PubFunction.SetShopPoint(intUserID, intUserShopID, point, "会员充值扣除店铺积分", 2);
                        }
                        MEMPointUpdate.MEMPointRate(modelMem, point, rechargeAccount, 15, intUserID, intUserShopID);
                        modelMem = new Chain.BLL.Mem().GetModel(modelMem.MemID);
                        PubFunction.UpdateMemLevel(modelMem);
                        WxPayData res = new WxPayData();
                        res.SetValue("return_code", "SUCCESS");
                        res.SetValue("return_msg", "OK");
                        Log.Info(base.GetType().ToString(), "order query success : " + res.ToXml());
                        this.Page.Response.Write(res.ToXml());
                        this.Page.Response.End();
                    }
                }
            }
        }
Пример #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         try
         {
             SortedDictionary <string, object> m_values = new SortedDictionary <string, object>();
             Stream        s       = base.Request.InputStream;
             byte[]        buffer  = new byte[1024];
             StringBuilder builder = new StringBuilder();
             int           count;
             while ((count = s.Read(buffer, 0, 1024)) > 0)
             {
                 builder.Append(Encoding.UTF8.GetString(buffer, 0, count));
             }
             s.Flush();
             s.Close();
             s.Dispose();
             XmlDocument xmlDoc = new XmlDocument();
             xmlDoc.LoadXml(builder.ToString());
             XmlNode     xmlNode = xmlDoc.FirstChild;
             XmlNodeList nodes   = xmlNode.ChildNodes;
             foreach (XmlNode xn in nodes)
             {
                 XmlElement xe = (XmlElement)xn;
                 m_values[xe.Name] = xe.InnerText;
             }
             if (!(m_values["return_code"].ToString() != "SUCCESS"))
             {
                 string   out_trade_no   = m_values["out_trade_no"].ToString();
                 string   appid          = m_values["appid"].ToString();
                 string   mch_id         = m_values["mch_id"].ToString();
                 string   transaction_id = m_values["transaction_id"].ToString();
                 string   nonce_str      = m_values["nonce_str"].ToString();
                 string   sign           = m_values["sign"].ToString();
                 string   time_end       = m_values["time_end"].ToString();
                 string   attach         = m_values["attach"].ToString();
                 string[] sz             = attach.Split(new char[]
                 {
                     ','
                 });
                 string type = sz[0];
                 string text = type;
                 if (text != null)
                 {
                     if (text == "Membersrecharge")
                     {
                         Chain.BLL.MemRecharge bllMemRecharge = new Chain.BLL.MemRecharge();
                         DataSet ds = bllMemRecharge.GetList(string.Format(" RechargeAccount='{0}'", out_trade_no));
                         if (ds.Tables[0].Rows.Count > 0)
                         {
                             base.Response.Write(this.ToXml("SUCCESS", ""));
                             base.Response.End();
                         }
                         else
                         {
                             CheckOrder checkorder = new CheckOrder();
                             Sign       signss     = new Sign();
                             Chain.Model.SysParameter modelSysParameter = new Chain.BLL.SysParameter().GetModel(1);
                             string  ordertrackingsign = signss.OrderTrackingSign(appid, mch_id, nonce_str, out_trade_no, transaction_id, modelSysParameter.Api);
                             XmlNode xmNode            = checkorder.GetCheckOrder(appid, mch_id, transaction_id, out_trade_no, nonce_str, ordertrackingsign);
                             string  trade_state       = xmNode["trade_state"].InnerText.ToUpper();
                             if (!(trade_state != "SUCCESS"))
                             {
                                 int total_fee  = Convert.ToInt32(sz[2]);
                                 int total_fees = Convert.ToInt32(m_values["total_fee"]);
                                 if (total_fee == total_fees)
                                 {
                                     text = type;
                                     if (text != null)
                                     {
                                         if (!(text == "Membersrecharge"))
                                         {
                                             if (text == "ShopMembersRecharge")
                                             {
                                                 base.Response.Write(this.ToXml("SUCCESS", ""));
                                                 base.Response.End();
                                             }
                                         }
                                         else
                                         {
                                             this.Membersrecharge(sz[1], sz[2], sz[3], sz[4], out_trade_no, time_end);
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         catch (Exception)
         {
         }
     }
 }
Пример #4
0
 private void Membersrecharge(string memid, string total_fee, string jf, string GiveMoney, string out_trade_no, string time_end)
 {
     try
     {
         int     id        = int.Parse(memid);
         int     jifen     = int.Parse(jf);
         decimal givemoney = decimal.Parse(GiveMoney);
         decimal totalfee  = decimal.Parse(total_fee) / 100m;
         time_end = string.Format("{0}-{1}-{2} {3}:{4}:{5}", new object[]
         {
             time_end.Substring(0, 4),
             time_end.Substring(4, 2),
             time_end.Substring(6, 2),
             time_end.Substring(8, 2),
             time_end.Substring(10, 2),
             time_end.Substring(12, 2)
         });
         DateTime        timeend = DateTime.Parse(time_end);
         Chain.Model.Mem mem     = new Chain.Model.Mem();
         Chain.BLL.Mem   bllMem  = new Chain.BLL.Mem();
         mem           = bllMem.GetModel(id);
         mem.MemPoint += jifen;
         mem.MemMoney += totalfee + givemoney;
         bllMem.Update(mem);
         Chain.BLL.MemRecharge bllMemRecharge = new Chain.BLL.MemRecharge();
         bllMemRecharge.Add(new Chain.Model.MemRecharge
         {
             RechargeMemID       = id,
             RechargeAccount     = out_trade_no,
             RechargeMoney       = totalfee,
             RechargeShopID      = 1,
             RechargeUserID      = 1,
             RechargeCreateTime  = timeend,
             RechargeIsApprove   = true,
             RechargeRemark      = "会员微信充值",
             RechargePoint       = jifen,
             RechargeType        = 6,
             RechargeGive        = givemoney,
             RechargeCardBalance = mem.MemMoney
         });
         Chain.Model.MoneyChangeLog moneyChangeLogModel = new Chain.Model.MoneyChangeLog();
         moneyChangeLogModel.MoneyChangeMemID      = id;
         moneyChangeLogModel.MoneyChangeUserID     = 1;
         moneyChangeLogModel.MoneyChangeType       = 1;
         moneyChangeLogModel.MoneyChangeAccount    = out_trade_no;
         moneyChangeLogModel.MoneyChangeMoney      = totalfee + givemoney;
         moneyChangeLogModel.MemMoney              = mem.MemMoney;
         moneyChangeLogModel.MoneyChangeCreateTime = timeend;
         moneyChangeLogModel.MoneyChangeGiveMoney  = 0m;
         new Chain.BLL.MoneyChangeLog().Add(moneyChangeLogModel);
         if (jifen > 0)
         {
             Chain.Model.PointLog mdPoint = new Chain.Model.PointLog();
             mdPoint.PointMemID      = id;
             mdPoint.PointNumber     = jifen;
             mdPoint.PointChangeType = 15;
             mdPoint.PointRemark     = string.Concat(new object[]
             {
                 "会员充值,充值金额:[",
                 totalfee,
                 "],获得积分:[",
                 jifen,
                 "]"
             });
             mdPoint.PointShopID     = 1;
             mdPoint.PointCreateTime = timeend;
             mdPoint.PointUserID     = 1;
             mdPoint.PointOrderCode  = out_trade_no;
             new Chain.BLL.PointLog().Add(mdPoint);
             MEMPointUpdate.MEMPointRate(mem, jifen, out_trade_no, 15, 1, 1);
             PubFunction.UpdateMemLevel(mem);
         }
     }
     catch
     {
         return;
     }
     base.Response.Write(this.ToXml("SUCCESS", ""));
     base.Response.End();
 }
Пример #5
0
 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") + "%";
     }
 }
Пример #6
0
 protected void btnMemImport_Click(object sender, EventArgs e)
 {
     lock (DataExcelIn._syncObj)
     {
         this.strSavePath = this.strPath.Value;
         if (File.Exists(this.strSavePath))
         {
             if (this.bolMainIndex)
             {
                 string    errstr = "";
                 DataTable dtMem  = DataExcelInfo.CheckMemDataExcel(this.strSavePath, ref errstr);
                 if (!string.IsNullOrEmpty(errstr))
                 {
                     File.Delete(this.strSavePath);
                     base.OutputWarn(errstr);
                 }
                 else if (DataExcelInfo.MemImport(dtMem, this.curParameter.bolPwd, this._UserID))
                 {
                     base.OutputWarn("恭喜您,导入会员成功!");
                     Chain.BLL.Mem   memBll   = new Chain.BLL.Mem();
                     Chain.Model.Mem memModel = new Chain.Model.Mem();
                     for (int rowIndex = 0; rowIndex < dtMem.Rows.Count; rowIndex++)
                     {
                         decimal memMoney = Convert.ToDecimal(dtMem.Rows[rowIndex]["MemMoney"]);
                         if (memMoney != 0m)
                         {
                             memModel = memBll.GetModelByMemCard(dtMem.Rows[rowIndex]["MemCard"].ToString());
                             Chain.Model.MoneyChangeLog moneyChangeLogModel = new Chain.Model.MoneyChangeLog();
                             moneyChangeLogModel.MoneyChangeMemID      = memModel.MemID;
                             moneyChangeLogModel.MoneyChangeUserID     = this._UserID;
                             moneyChangeLogModel.MoneyChangeType       = 6;
                             moneyChangeLogModel.MoneyChangeAccount    = "";
                             moneyChangeLogModel.MoneyChangeMoney      = memModel.MemMoney;
                             moneyChangeLogModel.MemMoney              = memModel.MemMoney;
                             moneyChangeLogModel.MoneyChangeCreateTime = DateTime.Now;
                             moneyChangeLogModel.MoneyChangeGiveMoney  = memModel.MemMoney;
                             new Chain.BLL.MoneyChangeLog().Add(moneyChangeLogModel);
                             Chain.Model.MemRecharge modelRecharge = new Chain.Model.MemRecharge();
                             modelRecharge.RechargeMemID       = memModel.MemID;
                             modelRecharge.RechargeType        = 1;
                             modelRecharge.RechargeMoney       = 0m;
                             modelRecharge.RechargeGive        = memModel.MemMoney;
                             modelRecharge.RechargeRemark      = "会员登记赠送金额,初始金额:" + memModel.MemMoney.ToString();
                             modelRecharge.RechargeShopID      = this._UserShopID;
                             modelRecharge.RechargeCreateTime  = DateTime.Now;
                             modelRecharge.RechargeAccount     = PubFunction.curParameter.strMemRechargePrefix + DateTime.Now.ToString("yyMMddHHmmssffff");
                             modelRecharge.RechargeUserID      = this._UserID;
                             modelRecharge.RechargeCardBalance = memModel.MemMoney;
                             modelRecharge.RechargeIsApprove   = true;
                             Chain.BLL.MemRecharge bllRecharge = new Chain.BLL.MemRecharge();
                             bllRecharge.Add(modelRecharge);
                         }
                     }
                     this.strSavePath  = "";
                     this.bolMainIndex = false;
                 }
                 else
                 {
                     File.Delete(this.strSavePath);
                     base.OutputWarn("导入会员失败,请再次检验并改正会员数据!");
                 }
             }
             else
             {
                 File.Delete(this.strSavePath);
                 base.OutputWarn("您导入的会员数据还没有检验成功,请通过检验再导入会员数据。");
             }
         }
         else
         {
             base.OutputWarn("您还没有检验会员数据,请先检验数据");
         }
     }
 }
Пример #7
0
        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();
        }