Exemplo n.º 1
0
        protected string BindPrizeName(object prizeLevel, object rotateID)
        {
            string result = "";

            Chain.BLL.SysRotate   bllSysRotate   = new Chain.BLL.SysRotate();
            Chain.Model.SysRotate modelSysRotate = bllSysRotate.GetModel(int.Parse(rotateID.ToString()));
            if (modelSysRotate != null)
            {
                string text = prizeLevel.ToString();
                if (text != null)
                {
                    if (!(text == "一等奖"))
                    {
                        if (!(text == "二等奖"))
                        {
                            if (!(text == "三等奖"))
                            {
                                if (!(text == "四等奖"))
                                {
                                    if (!(text == "五等奖"))
                                    {
                                        if (text == "六等奖")
                                        {
                                            result = modelSysRotate.SixPrizeName;
                                        }
                                    }
                                    else
                                    {
                                        result = modelSysRotate.FivePrizeName;
                                    }
                                }
                                else
                                {
                                    result = modelSysRotate.FourPrizeName;
                                }
                            }
                            else
                            {
                                result = modelSysRotate.ThreePrizeName;
                            }
                        }
                        else
                        {
                            result = modelSysRotate.TwoPrizeName;
                        }
                    }
                    else
                    {
                        result = modelSysRotate.OnePrizeName;
                    }
                }
            }
            return(result);
        }
Exemplo n.º 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Chain.BLL.SysRotate   blSysRotate    = new Chain.BLL.SysRotate();
            Chain.Model.SysRotate modelSysRotate = new Chain.Model.SysRotate();
            int intUserID = this._UserID;

            modelSysRotate.RotateName         = this.txtRotateName.Value;
            modelSysRotate.RotateRemark       = this.txtRotateRemark.Value;
            modelSysRotate.StartTime          = DateTime.Parse(DateTime.Parse(this.txtStartTime.Value).ToString("yyyy-MM-dd HH:mm"));
            modelSysRotate.EndTime            = DateTime.Parse(DateTime.Parse(this.txtEndTime.Value).ToString("yyyy-MM-dd HH:mm"));
            modelSysRotate.RotateCount        = 0;
            modelSysRotate.PersonTotalCount   = 0;
            modelSysRotate.PersonDayCount     = 0;
            modelSysRotate.OnePrizeName       = this.txtOnePrizeName.Value;
            modelSysRotate.OnePrizeCount      = int.Parse(this.txtOnePrizeCount.Value);
            modelSysRotate.TwoPrizeName       = this.txtTwoPrizeName.Value;
            modelSysRotate.TwoPrizeCount      = int.Parse(this.txtTwoPrizeCount.Value);
            modelSysRotate.ThreePrizeName     = this.txtThreePrizeName.Value;
            modelSysRotate.ThreePrizeCount    = int.Parse(this.txtThreePrizeCount.Value);
            modelSysRotate.FourPrizeName      = this.txtFourPrizeName.Value;
            modelSysRotate.FourPrizeCount     = int.Parse(this.txtFourPrizeCount.Value);
            modelSysRotate.FivePrizeName      = this.txtFivePrizeName.Value;
            modelSysRotate.FivePrizeCount     = int.Parse(this.txtFivePrizeCount.Value);
            modelSysRotate.SixPrizeName       = this.txtSixPrizeName.Value;
            modelSysRotate.SixPrizeCount      = int.Parse(this.txtSixPrizeCount.Value);
            modelSysRotate.OneRate            = decimal.Parse(this.txtOneRate.Value);
            modelSysRotate.TwoRate            = decimal.Parse(this.txtTwoRate.Value);
            modelSysRotate.ThreeRate          = decimal.Parse(this.txtThreeRate.Value);
            modelSysRotate.FourRate           = decimal.Parse(this.txtFourRate.Value);
            modelSysRotate.FiveRate           = decimal.Parse(this.txtFiveRate.Value);
            modelSysRotate.SixRate            = decimal.Parse(this.txtSixRate.Value);
            modelSysRotate.RotateRegion       = this.txtRotateRegion.Value;
            modelSysRotate.CreateTime         = DateTime.Now;
            modelSysRotate.CreateUserID       = intUserID;
            modelSysRotate.OnePrizeWinCount   = 0;
            modelSysRotate.TwoPrizeWinCount   = 0;
            modelSysRotate.ThreePrizeWinCount = 0;
            modelSysRotate.FourPrizeWinCount  = 0;
            modelSysRotate.FivePrizeWinCount  = 0;
            modelSysRotate.SixPrizeWinCount   = 0;
            modelSysRotate.ImageUrl           = this.txtRotatePhoto.Value;
            modelSysRotate.OneMobile          = this.txtOneMobile.Value;
            modelSysRotate.TwoMobile          = this.txtTwoMobile.Value;
            modelSysRotate.ThreeMobile        = this.txtThreeMobile.Value;
            modelSysRotate.FourMobile         = this.txtFourMobile.Value;
            modelSysRotate.FiveMobile         = this.txtFiveMobile.Value;
            modelSysRotate.SixMobile          = this.txtSixMobile.Value;
            modelSysRotate.OnePrizeWinCount   = int.Parse(this.txtOneWinCount.Value);
            modelSysRotate.TwoPrizeWinCount   = int.Parse(this.txtTwoWinCount.Value);
            modelSysRotate.ThreePrizeWinCount = int.Parse(this.txtThreeWinCount.Value);
            modelSysRotate.FourPrizeWinCount  = int.Parse(this.txtFourWinCount.Value);
            modelSysRotate.FivePrizeWinCount  = int.Parse(this.txtFiveWinCount.Value);
            modelSysRotate.SixPrizeWinCount   = int.Parse(this.txtSixWinCount.Value);
            modelSysRotate.OneName            = this.txtOneName.Value;
            modelSysRotate.TwoName            = this.txtTwoName.Value;
            modelSysRotate.ThreeName          = this.txtThreeName.Value;
            modelSysRotate.FourName           = this.txtFourName.Value;
            modelSysRotate.FiveName           = this.txtFiveName.Value;
            modelSysRotate.SixName            = this.txtSixName.Value;
            if (this.cbkIsWinOne.Checked)
            {
                modelSysRotate.IsWinOne = 1;
            }
            else
            {
                modelSysRotate.IsWinOne = 0;
            }
            int flag;

            if (this.txtRotateID.Value != "")
            {
                modelSysRotate.RotateID = int.Parse(this.txtRotateID.Value);
                flag = blSysRotate.Update(modelSysRotate);
            }
            else
            {
                flag = blSysRotate.Add(modelSysRotate);
            }
            if (flag > 0)
            {
                base.MessagePageShowError("保存成功!");
                base.Response.Redirect("SysRotateList.aspx?PID=144");
            }
            else
            {
                base.MessagePageShowError("保存失败!");
            }
        }
Exemplo n.º 3
0
 private void BinRotateInfo(int RotateID, int MemID)
 {
     Chain.Model.SysRotate modelSysRotate = this.bllSysRotate.GetModel(RotateID);
     if (modelSysRotate.RotateID != 0)
     {
         if (modelSysRotate.ImageUrl != null && modelSysRotate.ImageUrl.ToString() != "")
         {
             this.spImageUrl.InnerHtml = modelSysRotate.ImageUrl;
         }
         this.spPersonTotalCount.InnerHtml = modelSysRotate.PersonTotalCount.ToString();
         this.spPersonDayCount.InnerHtml   = modelSysRotate.PersonDayCount.ToString();
         this.spRotateCount.InnerHtml      = modelSysRotate.RotateCount.ToString();
         this.spStartTime.InnerHtml        = modelSysRotate.StartTime.ToString("yyyy-MM-dd");
         this.spEndTime.InnerHtml          = modelSysRotate.EndTime.ToString("yyyy-MM-dd");
         this.spRotateDesc.InnerHtml       = modelSysRotate.RotateRemark.ToString();
         this.spOneName.InnerHtml          = modelSysRotate.OneName;
         this.spTwoName.InnerHtml          = modelSysRotate.TwoName;
         this.spThreeName.InnerHtml        = modelSysRotate.ThreeName;
         this.spFourName.InnerHtml         = modelSysRotate.FourName;
         this.spFiveName.InnerHtml         = modelSysRotate.FiveName;
         this.spSixName.InnerHtml          = modelSysRotate.SixName;
         this.spOnePrizeName.InnerHtml     = modelSysRotate.OnePrizeName;
         this.spTwoPrizeName.InnerHtml     = modelSysRotate.TwoPrizeName;
         this.spThreePrizeName.InnerHtml   = modelSysRotate.ThreePrizeName;
         this.spFourPrizeName.InnerHtml    = modelSysRotate.FourPrizeName;
         this.spFivePrizeName.InnerHtml    = modelSysRotate.FivePrizeName;
         this.spSixPrizeName.InnerHtml     = modelSysRotate.SixPrizeName;
         this.spOneRate.InnerHtml          = modelSysRotate.OneRate.ToString();
         this.spTwoRate.InnerHtml          = modelSysRotate.TwoRate.ToString();
         this.spThreeRate.InnerHtml        = modelSysRotate.ThreeRate.ToString();
         this.spFourRate.InnerHtml         = modelSysRotate.FourRate.ToString();
         this.spFiveRate.InnerHtml         = modelSysRotate.FiveRate.ToString();
         this.spSixRate.InnerHtml          = modelSysRotate.SixRate.ToString();
         this.spIsWinOne.InnerHtml         = modelSysRotate.IsWinOne.ToString();
         Chain.BLL.SysRotateCount bllSysRotateCount = new Chain.BLL.SysRotateCount();
         DataTable dt = bllSysRotateCount.GetList(" RotateID=" + RotateID).Tables[0];
         this.txtMemTotalCount.Value = "0";
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             string  starttime  = DateTime.Parse(dt.Rows[i]["StartTime"].ToString()).ToString("yyyy-MM-dd");
             string  endtime    = DateTime.Parse(dt.Rows[i]["endTime"].ToString()).ToString("yyyy-MM-dd");
             int     count      = int.Parse(dt.Rows[i]["RotateCount"].ToString());
             int     memID      = int.Parse(this.txtMemID.Value);
             decimal costamount = decimal.Parse(dt.Rows[i]["CostAmount"].ToString());
             decimal amount     = bllSysRotateCount.GetMemCountCostAmount(starttime, endtime, MemID);
             decimal amount2    = bllSysRotateCount.GetMemOrderLogCostAmount(starttime, endtime, MemID);
             decimal amount3    = bllSysRotateCount.GetMemStorageTimingCostAmount(starttime, endtime, MemID);
             decimal amount4    = amount + amount2 + amount3;
             if (amount4 >= costamount)
             {
                 this.txtMemTotalCount.Value = count.ToString();
                 break;
             }
         }
         Chain.BLL.SysRotatePrizeLog bllSysRotatePrizeLog = new Chain.BLL.SysRotatePrizeLog();
         int getcount = bllSysRotatePrizeLog.GetRecordCount(string.Concat(new object[]
         {
             "MemID=",
             int.Parse(this.txtMemID.Value),
             "  and RotateID=",
             int.Parse(this.txtRotateID.Value)
         }));
         int hasWinCount = bllSysRotatePrizeLog.GetRecordCount(string.Concat(new object[]
         {
             "MemID=",
             int.Parse(this.txtMemID.Value),
             " and PrizeLevel<>'未中奖' and RotateID=",
             int.Parse(this.txtRotateID.Value)
         }));
         this.spWinCount.InnerHtml = hasWinCount.ToString();
         if (this.txtMemTotalCount.Value != "0")
         {
             this.spNoUseCount.InnerHtml = (int.Parse(this.txtMemTotalCount.Value) - getcount).ToString();
         }
         if (modelSysRotate.OneMobile != null && modelSysRotate.OneMobile.ToString() != "")
         {
             string[] strOneMobileList = modelSysRotate.OneMobile.Trim(new char[]
             {
                 ','
             }).Split(new char[]
             {
                 ','
             });
             for (int a = 0; a < strOneMobileList.Length; a++)
             {
                 int strMemID = new Chain.BLL.Mem().GetMemIDByMobile(strOneMobileList[a]);
                 if (strMemID == MemID)
                 {
                     this.spIsOne.InnerHtml = "1";
                     break;
                 }
             }
         }
         if (modelSysRotate.TwoMobile != null && modelSysRotate.TwoMobile.ToString() != "")
         {
             string[] strTwoMobileList = modelSysRotate.TwoMobile.Trim(new char[]
             {
                 ','
             }).Split(new char[]
             {
                 ','
             });
             for (int b = 0; b < strTwoMobileList.Length; b++)
             {
                 int strMemID = new Chain.BLL.Mem().GetMemIDByMobile(strTwoMobileList[b]);
                 if (strMemID == MemID)
                 {
                     this.spIsTwo.InnerHtml = "1";
                     break;
                 }
             }
         }
         if (modelSysRotate.ThreeMobile != null && modelSysRotate.ThreeMobile.ToString() != "")
         {
             string[] strThreeMobileList = modelSysRotate.ThreeMobile.Trim(new char[]
             {
                 ','
             }).Split(new char[]
             {
                 ','
             });
             for (int c = 0; c < strThreeMobileList.Length; c++)
             {
                 int strMemID = new Chain.BLL.Mem().GetMemIDByMobile(strThreeMobileList[c]);
                 if (strMemID == MemID)
                 {
                     this.spIsThree.InnerHtml = "1";
                     break;
                 }
             }
         }
         if (modelSysRotate.FourMobile != null && modelSysRotate.FourMobile.ToString() != "")
         {
             string[] strFourMobileList = modelSysRotate.FourMobile.Trim(new char[]
             {
                 ','
             }).Split(new char[]
             {
                 ','
             });
             for (int d = 0; d < strFourMobileList.Length; d++)
             {
                 int strMemID = new Chain.BLL.Mem().GetMemIDByMobile(strFourMobileList[d]);
                 if (strMemID == MemID)
                 {
                     this.spIsFour.InnerHtml = "1";
                     break;
                 }
             }
         }
         if (modelSysRotate.FiveMobile != null && modelSysRotate.FiveMobile.ToString() != "")
         {
             string[] strFiveMobileList = modelSysRotate.FiveMobile.Trim(new char[]
             {
                 ','
             }).Split(new char[]
             {
                 ','
             });
             for (int e = 0; e < strFiveMobileList.Length; e++)
             {
                 int strMemID = new Chain.BLL.Mem().GetMemIDByMobile(strFiveMobileList[e]);
                 if (strMemID == MemID)
                 {
                     this.spIsFive.InnerHtml = "1";
                     break;
                 }
             }
         }
         if (modelSysRotate.SixMobile != null && modelSysRotate.SixMobile.ToString() != "")
         {
             string[] strSixMobileList = modelSysRotate.SixMobile.Trim(new char[]
             {
                 ','
             }).Split(new char[]
             {
                 ','
             });
             for (int f = 0; f < strSixMobileList.Length; f++)
             {
                 int strMemID = new Chain.BLL.Mem().GetMemIDByMobile(strSixMobileList[f]);
                 if (strMemID == MemID)
                 {
                     this.spIsSix.InnerHtml = "1";
                     break;
                 }
             }
         }
     }
 }
Exemplo n.º 4
0
 private void GetSysRotate()
 {
     if (base.Request.QueryString["rotateID"] != null)
     {
         int rotateID = int.Parse(base.Request.QueryString["rotateID"]);
         Chain.BLL.SysRotate   bllSysRotate   = new Chain.BLL.SysRotate();
         Chain.Model.SysRotate modelSysRotate = bllSysRotate.GetModel(rotateID);
         this.txtRotateName.Value      = modelSysRotate.RotateName;
         this.txtRotateID.Value        = modelSysRotate.RotateID.ToString();
         this.txtRotateRemark.Value    = modelSysRotate.RotateRemark;
         this.txtStartTime.Value       = modelSysRotate.StartTime.ToString("yyyy-MM-dd HH:mm");
         this.txtEndTime.Value         = modelSysRotate.EndTime.ToString("yyyy-MM-dd HH:mm");
         this.txtOnePrizeCount.Value   = modelSysRotate.OnePrizeCount.ToString();
         this.txtOnePrizeName.Value    = modelSysRotate.OnePrizeName;
         this.txtTwoPrizeCount.Value   = modelSysRotate.TwoPrizeCount.ToString();
         this.txtTwoPrizeName.Value    = modelSysRotate.TwoPrizeName;
         this.txtThreePrizeCount.Value = modelSysRotate.ThreePrizeCount.ToString();
         this.txtThreePrizeName.Value  = modelSysRotate.ThreePrizeName;
         this.txtFourPrizeCount.Value  = modelSysRotate.FourPrizeCount.ToString();
         this.txtFourPrizeName.Value   = modelSysRotate.FourPrizeName;
         this.txtFivePrizeCount.Value  = modelSysRotate.FivePrizeCount.ToString();
         this.txtFivePrizeName.Value   = modelSysRotate.FivePrizeName;
         this.txtSixPrizeCount.Value   = modelSysRotate.SixPrizeCount.ToString();
         this.txtSixPrizeName.Value    = modelSysRotate.SixPrizeName;
         this.txtOneRate.Value         = modelSysRotate.OneRate.ToString();
         this.txtTwoRate.Value         = modelSysRotate.TwoRate.ToString();
         this.txtThreeRate.Value       = modelSysRotate.ThreeRate.ToString();
         this.txtFourRate.Value        = modelSysRotate.FourRate.ToString();
         this.txtFiveRate.Value        = modelSysRotate.FiveRate.ToString();
         this.txtSixRate.Value         = modelSysRotate.SixRate.ToString();
         this.txtRotateRegion.Value    = modelSysRotate.RotateRegion;
         this.imgRotatePhoto.Src       = modelSysRotate.ImageUrl;
         this.txtRotatePhoto.Value     = modelSysRotate.ImageUrl;
         this.txtOneMobile.Value       = modelSysRotate.OneMobile;
         this.txtTwoMobile.Value       = modelSysRotate.TwoMobile;
         this.txtThreeMobile.Value     = modelSysRotate.ThreeMobile;
         this.txtFourMobile.Value      = modelSysRotate.FourMobile;
         this.txtFiveMobile.Value      = modelSysRotate.FiveMobile;
         this.txtSixMobile.Value       = modelSysRotate.SixMobile;
         this.txtOneWinCount.Value     = modelSysRotate.OnePrizeWinCount.ToString();
         this.txtTwoWinCount.Value     = modelSysRotate.TwoPrizeWinCount.ToString();
         this.txtThreeWinCount.Value   = modelSysRotate.ThreePrizeWinCount.ToString();
         this.txtFourWinCount.Value    = modelSysRotate.FourPrizeWinCount.ToString();
         this.txtFiveWinCount.Value    = modelSysRotate.FivePrizeWinCount.ToString();
         this.txtSixWinCount.Value     = modelSysRotate.SixPrizeWinCount.ToString();
         this.txtOneName.Value         = modelSysRotate.OneName;
         this.txtTwoName.Value         = modelSysRotate.TwoName;
         this.txtThreeName.Value       = modelSysRotate.ThreeName;
         this.txtFourName.Value        = modelSysRotate.FourName;
         this.txtFiveName.Value        = modelSysRotate.FiveName;
         this.txtSixName.Value         = modelSysRotate.SixName;
         if (modelSysRotate.IsWinOne == 1)
         {
             this.cbkIsWinOne.Checked = true;
         }
         else
         {
             this.cbkIsWinOne.Checked = false;
         }
     }
 }