Пример #1
0
    private string GetTotalMoney(string IsuseID)
    {
        string TotalMoneySSQ = "";

        string key = "Home_Room_Buy_GetTotalMoneySSQ_" + IsuseID;

        DataTable dtTotalMoneySSQ = Shove._Web.Cache.GetCacheAsDataTable(key);
        if (dtTotalMoneySSQ == null)
        {
            dtTotalMoneySSQ = new DAL.Tables.T_TotalMoney().Open("", "IsuseID=" + IsuseID, "");

            if (dtTotalMoneySSQ == null)
            {
                new Log("System").Write(this.GetType().FullName + "数据库繁忙,请重试(GetTotalMoneySSQ)");
                return "";
            }
            Shove._Web.Cache.SetCache(key, dtTotalMoneySSQ, 120);
        }
        if (dtTotalMoneySSQ.Rows.Count > 0)
        {
            TotalMoneySSQ = dtTotalMoneySSQ.Rows[0]["TotalMoney"].ToString();
        }

        return TotalMoneySSQ;
    }
Пример #2
0
 protected void btnEdit_Click(object sender, EventArgs e)
 {
     string name = "";
     try
     {
         name = Utility.FilteSqlInfusion(this.tbIsuse.Text.Trim());
     }
     catch
     {
     }
     if (name == "")
     {
         JavaScript.Alert(this.Page, "期号不能为空!");
     }
     else
     {
         DataTable table = new Tables.T_Isuses().Open("[ID]", "[Name]='" + name + "' and LotteryID=" + Utility.FilteSqlInfusion(this.tbLotteryID.Text) + " and [ID] <> " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "");
         if (table == null)
         {
             PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
         }
         else if (table.Rows.Count > 0)
         {
             JavaScript.Alert(this.Page, "期号已经存在,请不要输入重名期号!");
         }
         else
         {
             object obj2 = PF.ValidLotteryTime(this.tbStartTime.Text);
             if (obj2 == null)
             {
                 JavaScript.Alert(this.Page, "开始时间格式输入错误!");
             }
             else
             {
                 DateTime startTime = (DateTime)obj2;
                 obj2 = PF.ValidLotteryTime(this.tbEndTime.Text);
                 if (obj2 == null)
                 {
                     JavaScript.Alert(this.Page, "截止时间格式输入错误!");
                 }
                 else
                 {
                     DateTime endTime = (DateTime)obj2;
                     if (endTime <= startTime)
                     {
                         JavaScript.Alert(this.Page, "截止时间应该在开始时间之后!");
                     }
                     else
                     {
                         string additionasXml = "";
                         if ((((((this.tbLotteryID.Text != "1") || (this.BuildAdditionasXmlForSFC(ref additionasXml) >= 0)) && ((this.tbLotteryID.Text != "2") || (this.BuildAdditionasXmlForJQC(ref additionasXml) >= 0))) && ((this.tbLotteryID.Text != "15") || (this.BuildAdditionasXmlForLCBQC(ref additionasXml) >= 0))) && ((this.tbLotteryID.Text != "19") || (this.BuildAdditionasXmlForLCDC(ref additionasXml) >= 0))) && ((this.tbLotteryID.Text != "45") || (this.BuildAdditionasXmlForZCDC(ref additionasXml) >= 0)))
                         {
                             long isuseID = long.Parse(this.tbIsuseID.Text);
                             int returnValue = -1;
                             string returnDescription = "";
                             if (Procedures.P_IsuseEdit(isuseID, name, startTime, endTime, additionasXml, ref returnValue, ref returnDescription) < 0)
                             {
                                 PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
                             }
                             else if (returnValue < 0)
                             {
                                 PF.GoError(1, returnDescription, this.Page.GetType().BaseType.FullName);
                             }
                             else
                             {
                                 if (this.tbTestNumber.Text.Trim() != "")
                                 {
                                     Tables.T_TestNumber number = new Tables.T_TestNumber
                                     {
                                         TestNumber = { Value = this.tbTestNumber.Text.Trim() },
                                         IsuseID = { Value = isuseID.ToString() }
                                     };
                                     if (_Convert.StrToLong(this.hidID.Value, 0L) > 0L)
                                     {
                                         number.Update("ID=" + this.hidID.Value);
                                     }
                                     else
                                     {
                                         number.Insert();
                                     }
                                 }
                                 if (this.tbMoney.Text.Trim() != "")
                                 {
                                     Tables.T_TotalMoney money = new Tables.T_TotalMoney
                                     {
                                         TotalMoney = { Value = this.tbMoney.Text.Trim() },
                                         IsuseID = { Value = this.tbIsuseID.Text }
                                     };
                                     if (_Convert.StrToLong(this.moneyID.Value, 0L) > 0L)
                                     {
                                         money.Update("ID=" + this.moneyID.Value);
                                     }
                                     else
                                     {
                                         money.Insert();
                                     }
                                 }
                                 Shove._Web.Cache.ClearCache("LotteryCalendar");
                                 Shove._Web.Cache.ClearCache(DataCache.IsusesInfo + this.tbLotteryID.Text.Trim());
                                 base.Response.Redirect("Isuse.aspx?LotteryID=" + this.tbLotteryID.Text, true);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Пример #3
0
 private string GetTotalMoneySFC(string IsuseID)
 {
     string str = "";
     string key = "Home_Room_Buy_GetTotalMoneySFC_" + IsuseID;
     DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key);
     if (cacheAsDataTable == null)
     {
         cacheAsDataTable = new Tables.T_TotalMoney().Open("", "IsuseID=" + IsuseID, "");
         if (cacheAsDataTable == null)
         {
             new Log("System").Write(base.GetType().FullName + "数据库繁忙,请重试(GetTotalMoneySFC)");
             return "";
         }
         Shove._Web.Cache.SetCache(key, cacheAsDataTable, 120);
     }
     if (cacheAsDataTable.Rows.Count > 0)
     {
         str = cacheAsDataTable.Rows[0]["TotalMoney"].ToString();
     }
     return str;
 }
Пример #4
0
 private void BindData()
 {
     DataTable table = new Tables.T_Isuses().Open("", "[ID]=" + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "");
     if ((table == null) || (table.Rows.Count < 1))
     {
         PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
     }
     else
     {
         this.tbIsuse.Text = table.Rows[0]["Name"].ToString();
         this.tbStartTime.Text = _Convert.StrToDateTime(table.Rows[0]["StartTime"].ToString(), "0000-00-00 00:00:00").ToString("yyyy-MM-dd HH:mm:ss");
         this.tbEndTime.Text = _Convert.StrToDateTime(table.Rows[0]["EndTime"].ToString(), "0000-00-00 00:00:00").ToString("yyyy-MM-dd HH:mm:ss");
         if (this.tbLotteryID.Text == "1")
         {
             table = new Tables.T_IsuseForSFC().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "[No]");
             if ((table == null) || (table.Rows.Count < 14))
             {
                 PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
                 return;
             }
             for (int i = 0; i < 14; i++)
             {
                 int num2 = i + 1;
                 TextBox box = (TextBox)this.FindControl("tbSFC" + num2.ToString());
                 int num3 = i + 1;
                 TextBox box2 = (TextBox)this.FindControl("tbSFC" + num3.ToString() + "_1");
                 int num4 = i + 1;
                 TextBox box3 = (TextBox)this.FindControl("tbSFC" + num4.ToString() + "_2");
                 box.Text = table.Rows[i]["HostTeam"].ToString();
                 box2.Text = table.Rows[i]["QuestTeam"].ToString();
                 box3.Text = table.Rows[i]["DateTime"].ToString();
             }
         }
         if (this.tbLotteryID.Text == "2")
         {
             table = new Tables.T_IsuseForJQC().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "[No]");
             if ((table == null) || (table.Rows.Count < 8))
             {
                 PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
                 return;
             }
             for (int j = 0; j < 8; j++)
             {
                 int num6 = j + 1;
                 TextBox box4 = (TextBox)this.FindControl("tbJQC" + num6.ToString());
                 int num7 = j + 1;
                 TextBox box5 = (TextBox)this.FindControl("tbJQC" + num7.ToString() + "_2");
                 box4.Text = table.Rows[j]["Team"].ToString();
                 box5.Text = table.Rows[j]["DateTime"].ToString();
             }
         }
         if (this.tbLotteryID.Text == "15")
         {
             table = new Tables.T_IsuseForLCBQC().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "[No]");
             if ((table == null) || (table.Rows.Count < 6))
             {
                 PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
                 return;
             }
             for (int k = 0; k < 6; k++)
             {
                 int num9 = k + 1;
                 TextBox box6 = (TextBox)this.FindControl("tbLCBQC" + num9.ToString());
                 int num10 = k + 1;
                 TextBox box7 = (TextBox)this.FindControl("tbLCBQC" + num10.ToString() + "_1");
                 int num11 = k + 1;
                 TextBox box8 = (TextBox)this.FindControl("tbLCBQC" + num11.ToString() + "_2");
                 box6.Text = table.Rows[k]["HostTeam"].ToString();
                 box7.Text = table.Rows[k]["QuestTeam"].ToString();
                 box8.Text = table.Rows[k]["DateTime"].ToString();
             }
         }
         if (this.tbLotteryID.Text == "19")
         {
             table = new Tables.T_IsuseForLCDC().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "[No]");
             if ((table == null) || (table.Rows.Count < 1))
             {
                 PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
                 return;
             }
             for (int m = 0; m < 1; m++)
             {
                 int num13 = m + 1;
                 TextBox box9 = (TextBox)this.FindControl("tbLCDC" + num13.ToString());
                 int num14 = m + 1;
                 TextBox box10 = (TextBox)this.FindControl("tbLCDC" + num14.ToString() + "_1");
                 int num15 = m + 1;
                 TextBox box11 = (TextBox)this.FindControl("tbLCDC" + num15.ToString() + "_2");
                 box9.Text = table.Rows[m]["HostTeam"].ToString();
                 box10.Text = table.Rows[m]["QuestTeam"].ToString();
                 box11.Text = table.Rows[m]["DateTime"].ToString();
             }
         }
         if (this.tbLotteryID.Text == "45")
         {
             table = new Tables.T_IsuseForZCDC().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "[No]");
             if ((table == null) || (table.Rows.Count < 1))
             {
                 PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
                 return;
             }
             this.DataListZCDC.DataSource = table.DefaultView;
             this.DataListZCDC.DataBind();
         }
         DataTable table2 = new Tables.T_TestNumber().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "");
         DataTable table3 = new Tables.T_TotalMoney().Open("", "IsuseID= " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "");
         if (table2 == null)
         {
             PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
         }
         else if (table3 == null)
         {
             PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
         }
         else
         {
             if (table2.Rows.Count > 0)
             {
                 this.tbTestNumber.Text = table2.Rows[0]["TestNumber"].ToString();
                 this.hidID.Value = table2.Rows[0]["ID"].ToString();
             }
             if (table3.Rows.Count > 0)
             {
                 this.tbMoney.Text = table3.Rows[0]["TotalMoney"].ToString();
                 this.moneyID.Value = table3.Rows[0]["ID"].ToString();
             }
         }
     }
 }
Пример #5
0
    protected void btnAdd_Click(object sender, System.EventArgs e)
    {
        string Isuse = "";

        try
        {
            Isuse = Shove._Web.Utility.FilteSqlInfusion(tbIsuse.Text.Trim());
        }
        catch { }

        if (Isuse == "")
        {
            Shove._Web.JavaScript.Alert(this.Page, "期号不能为空!");

            return;
        }

        DataTable dt = new DAL.Tables.T_Isuses().Open("[ID]", "[Name] = '" + Isuse + "' and LotteryID = " + Shove._Web.Utility.FilteSqlInfusion(tbLotteryID.Text), "");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_IsuseAdd");

            return;
        }

        if (dt.Rows.Count > 0)
        {
            Shove._Web.JavaScript.Alert(this.Page, "期号已经存在,请不要输入重名期号!");

            return;
        }

        System.DateTime StartTime, EndTime;

        object time = PF.ValidLotteryTime(tbStartTime.Text);

        if (time == null)
        {
            Shove._Web.JavaScript.Alert(this.Page, "开始时间格式输入错误!");
            return;
        }

        StartTime = (DateTime)time;

        time = PF.ValidLotteryTime(tbEndTime.Text);

        if (time == null)
        {
            Shove._Web.JavaScript.Alert(this.Page, "截止时间格式输入错误!");
            return;
        }

        EndTime = (DateTime)time;

        if (EndTime <= StartTime)
        {
            Shove._Web.JavaScript.Alert(this.Page, "截止时间应该在开始时间之后!");

            return;
        }

        string AdditionasXml = "";

        if ((tbLotteryID.Text == SLS.Lottery.SFC.sID || tbLotteryID.Text == SLS.Lottery.ZCSFC.sID || tbLotteryID.Text == SLS.Lottery.ZCRJC.sID) && (BuildAdditionasXmlForSFC(ref AdditionasXml) < 0))
        {
            return;
        }

        if ((tbLotteryID.Text == SLS.Lottery.JQC.sID) && (BuildAdditionasXmlForJQC(ref AdditionasXml) < 0))
        {
            return;
        }

        if ((tbLotteryID.Text == SLS.Lottery.LCBQC.sID) && (BuildAdditionasXmlForLCBQC(ref AdditionasXml) < 0))
        {
            return;
        }

        if ((tbLotteryID.Text == SLS.Lottery.LCDC.sID) && (BuildAdditionasXmlForLCDC(ref AdditionasXml) < 0))
        {
            return;
        }

        if ((tbLotteryID.Text == SLS.Lottery.ZCDC.sID) && (BuildAdditionasXmlForZCDC(ref AdditionasXml) < 0))
        {
            return;
        }

        int LotteryID = int.Parse(tbLotteryID.Text);

        long NewIsuseID = -1;
        string ReturnDescription = "";

        int Result = DAL.Procedures.P_IsuseAdd(LotteryID, Isuse, StartTime, EndTime, AdditionasXml, ref NewIsuseID, ref ReturnDescription);

        if (Result < 0)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_IsuseAdd");

            return;
        }

        if (NewIsuseID < 0)
        {
            PF.GoError(ErrorNumber.Unknow, ReturnDescription, "Admin_IsuseAdd");

            return;
        }

        DAL.Tables.T_TotalMoney dtTotalMoney = new DAL.Tables.T_TotalMoney();

        dtTotalMoney.IsuseID.Value = NewIsuseID;
        dtTotalMoney.TotalMoney.Value = this.tbMoney.Text;

        if (dtTotalMoney.Insert() < 0)
        {
            Shove._Web.JavaScript.Alert(this.Page, "添加奖池奖金失败!");
            return;
        }

        if (cbAutoNext10Isuse.Visible && cbAutoNext10Isuse.Checked && (AdditionasXml == ""))
        {
            string IsuseYear = Isuse.Substring(0, Isuse.Length - 3);
            int IsuseNum = Shove._Convert.StrToInt(Isuse.Substring(Isuse.Length - 3, 3), 0);

            for (int i = 1; i <= 9; i++)
            {
                IsuseNum++;
                string NextIsuse = IsuseYear + IsuseNum.ToString().PadLeft(3, '0');
                StartTime = StartTime.AddDays(1);
                EndTime = EndTime.AddDays(1);
                int Results = -1;
                Results = DAL.Procedures.P_IsuseAdd(LotteryID, NextIsuse, StartTime, EndTime, "", ref NewIsuseID, ref ReturnDescription);
                if (Result < 0)
                {
                    break;
                }

                if (NewIsuseID < 0)
                {
                    continue;
                }
            }
        }
        Shove._Web.Cache.ClearCache(CacheKey.LotteryCalendar);
        Shove._Web.Cache.ClearCache(DataCache.IsusesInfo + tbLotteryID.Text.Trim());
        this.Response.Redirect("Isuse.aspx?LotteryID=" + tbLotteryID.Text, true);
    }
Пример #6
0
    protected void btnMultiAdd_Click(object sender, System.EventArgs e)
    {
        int LotteryID = int.Parse(tbLotteryID.Text);
        string Isuse = "";
        if (LotteryID != SLS.Lottery.SSQ.ID && LotteryID != SLS.Lottery.TCCJDLT.ID)
        {
            btnMultiAdd.Visible = false;
            btnMultiAdd.Enabled = false;
            return;
        }
        try
        {
            Isuse = Shove._Web.Utility.FilteSqlInfusion(tbIsuse.Text.Trim());
        }
        catch { }

        if (Isuse == "")
        {
            Shove._Web.JavaScript.Alert(this.Page, "期号不能为空!");

            return;
        }
        System.DateTime StartTime, EndTime;

        object time = PF.ValidLotteryTime(tbStartTime.Text);

        if (time == null)
        {
            Shove._Web.JavaScript.Alert(this.Page, "开始时间格式输入错误!");
            return;
        }
        DayOfWeek dow = ((DateTime)time).DayOfWeek;
        switch(LotteryID)
        {
            case SLS.Lottery.TCCJDLT.ID:
                if (dow != DayOfWeek.Monday && dow != DayOfWeek.Wednesday && dow != DayOfWeek.Saturday)
                {
                    Shove._Web.JavaScript.Alert(this.Page, "开始时间输入不正确(周一、三、六)!");
                    return;
                }
                break;
            case SLS.Lottery.SSQ.ID:
                if (dow != DayOfWeek.Tuesday && dow != DayOfWeek.Thursday && dow != DayOfWeek.Sunday)
                {
                    Shove._Web.JavaScript.Alert(this.Page, "开始时间输入不正确(周二、四、日)!");
                    return;
                }
                break;
            default:
                Shove._Web.JavaScript.Alert(this.Page, "开始时间输入不正确!");
                return;
        }
        
        StartTime = (DateTime)time;
        EndTime = StartTime;
        switch (LotteryID)
        {
            case SLS.Lottery.TCCJDLT.ID:
                if (EndTime.DayOfWeek == DayOfWeek.Wednesday)
                    EndTime = EndTime.AddDays(3);
                else
                    EndTime = EndTime.AddDays(2);
                break;
            case SLS.Lottery.SSQ.ID:
                if (EndTime.DayOfWeek == DayOfWeek.Thursday)
                    EndTime = EndTime.AddDays(3);
                else
                    EndTime = EndTime.AddDays(2);
                break;
        }
        int x = 0;
        if (!int.TryParse(tbMultiDays.Text, out x))
        {
            Shove._Web.JavaScript.Alert(this.Page, "增加天数格式输入错误!");
            return;
        }
        long NewIsuseID = -1;
        string ReturnDescription = "";

        DataTable dt;
        for (int i = 0; i < x; i++)
        {
            dt = new DAL.Tables.T_Isuses().Open("[ID]", "[Name] = '" + Isuse + "' and LotteryID = " + Shove._Web.Utility.FilteSqlInfusion(tbLotteryID.Text), "");
            if (dt == null)
            {
                PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_IsuseAdd");
                i = i - 1;
            }
            else if (dt.Rows.Count == 0)
            {
                int Result = DAL.Procedures.P_IsuseAdd(LotteryID, Isuse, StartTime, EndTime, "", ref NewIsuseID, ref ReturnDescription);

                if (Result < 0)
                {
                    PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_IsuseAdd");
                    return;
                }
                else if (NewIsuseID < 0)
                {
                    PF.GoError(ErrorNumber.Unknow, ReturnDescription, "Admin_IsuseAdd");
                    return;
                }
                else
                {
                    DAL.Tables.T_TotalMoney dtTotalMoney = new DAL.Tables.T_TotalMoney();
                    dtTotalMoney.IsuseID.Value = NewIsuseID;
                    dtTotalMoney.TotalMoney.Value = "";

                    if (dtTotalMoney.Insert() < 0)
                    {
                        Shove._Web.JavaScript.Alert(this.Page, "添加奖池奖金失败!");
                        return;
                    }
                }
            }
            Isuse = (int.Parse(Isuse) + 1).ToString();
            StartTime = EndTime;
            switch (LotteryID)
            {
                case SLS.Lottery.TCCJDLT.ID:
                    if (EndTime.DayOfWeek == DayOfWeek.Wednesday)
                        EndTime = EndTime.AddDays(1);
                    break;
                case SLS.Lottery.SSQ.ID:
                    if (EndTime.DayOfWeek == DayOfWeek.Thursday)
                        EndTime = EndTime.AddDays(1);
                    break;
            }
            EndTime = EndTime.AddDays(2);
            NewIsuseID = -1;
            ReturnDescription = "";
        }
        Shove._Web.Cache.ClearCache(CacheKey.LotteryCalendar);
        Shove._Web.Cache.ClearCache(DataCache.IsusesInfo + tbLotteryID.Text.Trim());
        this.Response.Redirect("Isuse.aspx?LotteryID=" + tbLotteryID.Text, true);
    }
Пример #7
0
    private void BindData()
    {
        DataTable dt = new DAL.Tables.T_Isuses().Open("", "[ID]=" + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "");

        if ((dt == null) || (dt.Rows.Count < 1))
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);

            return;
        }

        tbIsuse.Text = dt.Rows[0]["Name"].ToString();
        tbStartTime.Text = Shove._Convert.StrToDateTime(dt.Rows[0]["StartTime"].ToString(), "0000-00-00 00:00:00").ToString("yyyy-MM-dd HH:mm:ss");
        tbEndTime.Text = Shove._Convert.StrToDateTime(dt.Rows[0]["EndTime"].ToString(), "0000-00-00 00:00:00").ToString("yyyy-MM-dd HH:mm:ss");

        if (tbLotteryID.Text == SLS.Lottery.SFC.sID || tbLotteryID.Text == SLS.Lottery.ZCSFC.sID || tbLotteryID.Text == SLS.Lottery.ZCRJC.sID)
        {
            dt = new DAL.Tables.T_IsuseForSFC().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "[No]");

            if (dt == null)
            {
                PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);

                return;
            }

            if (dt.Rows.Count != 14)
            {
                return;
            }

            for (int i = 0; i < 14; i++)
            {
                TextBox tb = (TextBox)this.FindControl("tbSFC" + (i + 1).ToString());
                TextBox tb_1 = (TextBox)this.FindControl("tbSFC" + (i + 1).ToString() + "_1");
                TextBox tb_2 = (TextBox)this.FindControl("tbSFC" + (i + 1).ToString() + "_2");

                tb.Text = dt.Rows[i]["HostTeam"].ToString();
                tb_1.Text = dt.Rows[i]["QuestTeam"].ToString();
                tb_2.Text = dt.Rows[i]["DateTime"].ToString();
            }
        }

        if (tbLotteryID.Text == SLS.Lottery.JQC.sID)
        {
            dt = new DAL.Tables.T_IsuseForJQC().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "[No]");

            if ((dt == null) || (dt.Rows.Count < 8))
            {
                PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);

                return;
            }

            for (int i = 0; i < 8; i++)
            {
                TextBox tb = (TextBox)this.FindControl("tbJQC" + (i + 1).ToString());
                TextBox tb_2 = (TextBox)this.FindControl("tbJQC" + (i + 1).ToString() + "_2");

                tb.Text = dt.Rows[i]["Team"].ToString();
                tb_2.Text = dt.Rows[i]["DateTime"].ToString();
            }
        }

        if (tbLotteryID.Text == SLS.Lottery.LCBQC.sID)
        {
            dt = new DAL.Tables.T_IsuseForLCBQC().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "[No]");

            if ((dt == null) || (dt.Rows.Count < 6))
            {
                PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);

                return;
            }

            for (int i = 0; i < 6; i++)
            {
                TextBox tb = (TextBox)this.FindControl("tbLCBQC" + (i + 1).ToString());
                TextBox tb_1 = (TextBox)this.FindControl("tbLCBQC" + (i + 1).ToString() + "_1");
                TextBox tb_2 = (TextBox)this.FindControl("tbLCBQC" + (i + 1).ToString() + "_2");

                tb.Text = dt.Rows[i]["HostTeam"].ToString();
                tb_1.Text = dt.Rows[i]["QuestTeam"].ToString();
                tb_2.Text = dt.Rows[i]["DateTime"].ToString();
            }
        }

        if (tbLotteryID.Text == SLS.Lottery.LCDC.sID)
        {
            dt = new DAL.Tables.T_IsuseForLCDC().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "[No]");

            if ((dt == null) || (dt.Rows.Count < 1))
            {
                PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);

                return;
            }

            for (int i = 0; i < 1; i++)
            {
                TextBox tb = (TextBox)this.FindControl("tbLCDC" + (i + 1).ToString());
                TextBox tb_1 = (TextBox)this.FindControl("tbLCDC" + (i + 1).ToString() + "_1");
                TextBox tb_2 = (TextBox)this.FindControl("tbLCDC" + (i + 1).ToString() + "_2");

                tb.Text = dt.Rows[i]["HostTeam"].ToString();
                tb_1.Text = dt.Rows[i]["QuestTeam"].ToString();
                tb_2.Text = dt.Rows[i]["DateTime"].ToString();
            }
        }     

        DataTable dtTestNumber = new DAL.Tables.T_TestNumber().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "");

        DataTable dtTotalMoney = new DAL.Tables.T_TotalMoney().Open("", "IsuseID= " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text) , "");


        if (dtTestNumber == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);

            return;
        }
        if (dtTotalMoney == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite,"数据库繁忙,请重试",this.Page.GetType().BaseType.FullName);
            return;
        }
        if (dtTestNumber.Rows.Count > 0)
        {
            tbTestNumber.Text = dtTestNumber.Rows[0]["TestNumber"].ToString();
            hidID.Value = dtTestNumber.Rows[0]["ID"].ToString();
        }
        if (dtTotalMoney.Rows.Count > 0)
        {
            tbMoney.Text = dtTotalMoney.Rows[0]["TotalMoney"].ToString();
            moneyID.Value = dtTotalMoney.Rows[0]["ID"].ToString();
        }
    }
Пример #8
0
    protected void btnEdit_Click(object sender, System.EventArgs e)
    {
        string Isuse = "";

        try
        {
            Isuse = Shove._Web.Utility.FilteSqlInfusion(tbIsuse.Text.Trim());
        }
        catch
        { }

        if (Isuse == "")
        {
            Shove._Web.JavaScript.Alert(this.Page, "期号不能为空!");

            return;
        }

        DataTable dt = new DAL.Tables.T_Isuses().Open("[ID]", "[Name]='" + Isuse + "' and LotteryID=" + Shove._Web.Utility.FilteSqlInfusion(tbLotteryID.Text) + " and [ID] <> " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);

            return;
        }

        if (dt.Rows.Count > 0)
        {
            Shove._Web.JavaScript.Alert(this.Page, "期号已经存在,请不要输入重名期号!");

            return;
        }

        System.DateTime StartTime, EndTime;

        object time = PF.ValidLotteryTime(tbStartTime.Text);
        if (time == null)
        {
            Shove._Web.JavaScript.Alert(this.Page, "开始时间格式输入错误!");
            return;
        }

        StartTime = (DateTime)time;

        time = PF.ValidLotteryTime(tbEndTime.Text);

        if (time == null)
        {
            Shove._Web.JavaScript.Alert(this.Page, "截止时间格式输入错误!");

            return;
        }

        EndTime = (DateTime)time;

        if (EndTime <= StartTime)
        {
            Shove._Web.JavaScript.Alert(this.Page, "截止时间应该在开始时间之后!");

            return;
        }

        string AdditionasXml = "";

        if ((tbLotteryID.Text == SLS.Lottery.SFC.sID || tbLotteryID.Text == SLS.Lottery.ZCSFC.sID || tbLotteryID.Text == SLS.Lottery.ZCRJC.sID) && (BuildAdditionasXmlForSFC(ref AdditionasXml) < 0))
        {
            return;
        }

        if ((tbLotteryID.Text == SLS.Lottery.JQC.sID) && (BuildAdditionasXmlForJQC(ref AdditionasXml) < 0))
        {
            return;
        }

        if ((tbLotteryID.Text == SLS.Lottery.LCBQC.sID) && (BuildAdditionasXmlForLCBQC(ref AdditionasXml) < 0))
        {
            return;
        }

        if ((tbLotteryID.Text == SLS.Lottery.LCDC.sID) && (BuildAdditionasXmlForLCDC(ref AdditionasXml) < 0))
        {
            return;
        }

        if ((tbLotteryID.Text == SLS.Lottery.ZCDC.sID) && (BuildAdditionasXmlForZCDC(ref AdditionasXml) < 0))
        {
            return;
        }

        long IsuseID = long.Parse(tbIsuseID.Text);

        int ReturnValue = -1;
        string ReturnDescription = "";

        int Result = DAL.Procedures.P_IsuseEdit(IsuseID, Isuse, StartTime, EndTime, AdditionasXml, ref ReturnValue, ref ReturnDescription);

        if (Result < 0)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);

            return;
        }

        if (ReturnValue < 0)
        {
            PF.GoError(ErrorNumber.Unknow, ReturnDescription, this.Page.GetType().BaseType.FullName);

            return;
        }

        if (tbTestNumber.Text.Trim() != "")
        {
            DAL.Tables.T_TestNumber t_TestNumber = new DAL.Tables.T_TestNumber();

            t_TestNumber.TestNumber.Value = tbTestNumber.Text.Trim();
            t_TestNumber.IsuseID.Value = IsuseID.ToString();

            if (Shove._Convert.StrToLong(hidID.Value, 0) > 0)
            {
                t_TestNumber.Update("ID=" + hidID.Value);
            }
            else
            {
                t_TestNumber.Insert();
            }
        }

        if (tbMoney.Text.Trim() != "")
        {
            DAL.Tables.T_TotalMoney t_TotalMoney = new DAL.Tables.T_TotalMoney();
            t_TotalMoney.TotalMoney.Value = tbMoney.Text.Trim();
            t_TotalMoney.IsuseID.Value = tbIsuseID.Text;

            if (Shove._Convert.StrToLong(moneyID.Value, 0) > 0)
            {
                t_TotalMoney.Update("ID=" + moneyID.Value);
            }
            else
            {
                t_TotalMoney.Insert();
            }
        }
        Shove._Web.Cache.ClearCache(CacheKey.LotteryCalendar);
        Shove._Web.Cache.ClearCache(DataCache.IsusesInfo + tbLotteryID.Text.Trim());
        this.Response.Redirect("Isuse.aspx?LotteryID=" + tbLotteryID.Text, true);
    }