public DataSet GetIssueBonus(long AgentID, DateTime TimeStamp, string Sign, int LotteryID, string IssueName) { new Log("Agent\\ElectronTicket").Write(String.Format("Method=GetIssueBonus\tAgentID={0}\tTimeStamp={1}\tSign={2}\tLotteryID={3}\tIssueName={4}", AgentID, TimeStamp, Sign, LotteryID, IssueName)); DataSet ds = new DataSet(); string UseLotteryList = ""; double Balance = 0; short State = 0; if (Valid(ref ds, ref UseLotteryList, ref Balance, ref State, AgentID, TimeStamp, Sign, LotteryID, IssueName) < 0) { return ds; } if (ValidLotteryID(ref ds, UseLotteryList, LotteryID) < 0) { return ds; } DataTable dt = new DAL.Tables.T_Isuses().Open("[ID], StartTime, EndTime, State, isOpened", "LotteryID = " + LotteryID.ToString() + "and [Name] = '" + Shove._Web.Utility.FilteSqlInfusion(IssueName) + "'", ""); if ((dt == null) || (dt.Rows.Count < 1)) { BuildReturnDataSetForError(-4, "奖期不存在", ref ds); new Log("Agent\\ElectronTicket").Write("奖期不存在"); return ds; } long IsuseID = Shove._Convert.StrToLong(dt.Rows[0]["ID"].ToString(), -1); DateTime StartTime = Shove._Convert.StrToDateTime(dt.Rows[0]["StartTime"].ToString(), "1980-1-1 0:0:0"); DateTime EndTime = Shove._Convert.StrToDateTime(dt.Rows[0]["EndTime"].ToString(), "1980-1-1 0:0:0"); short IsuseState = Shove._Convert.StrToShort(dt.Rows[0]["State"].ToString(), -1); bool isOpened = Shove._Convert.StrToBool(dt.Rows[0]["isOpened"].ToString(), false); if (IsuseID < 0) { BuildReturnDataSetForError(-4, "奖期不存在", ref ds); new Log("Agent\\ElectronTicket").Write("奖期不存在"); return ds; } DateTime Now = DateTime.Now; if ((Now < StartTime) || (IsuseState < 1)) { BuildReturnDataSetForError(-5, "奖期未开启", ref ds); new Log("Agent\\ElectronTicket").Write("奖期未开启"); return ds; } if (!isOpened) { BuildReturnDataSetForError(-18, "奖期尚未开奖", ref ds); new Log("Agent\\ElectronTicket").Write("奖期尚未开奖"); return ds; } BuildReturnDataSet(0, ref ds); DataTable dtSchemes = new DAL.Views.V_ElectronTicketAgentSchemes().Open("LotteryID, IsuseName as IssueName, SchemeNumber, WinMoney as Bonus, WinMoneyWithoutTax as BonusWithoutTax, WinLotteryNumber as BonusNumber, WinDescription as BonusDescription", "AgentID = " + AgentID.ToString() + " and LotteryID = " + LotteryID.ToString() + " and IsuseID = " + IsuseID.ToString() + " and WinMoney <> 0", "[ID]"); ds.Tables.Add(dtSchemes); return ds; }
public DataSet GetIssueBonus(long AgentID, DateTime TimeStamp, string Sign, int LotteryID, string IssueName) { new Log("Agent\\ElectronTicket").Write(String.Format("Method=GetIssueBonus\tAgentID={0}\tTimeStamp={1}\tSign={2}\tLotteryID={3}\tIssueName={4}", AgentID, TimeStamp, Sign, LotteryID, IssueName)); DataSet ds = new DataSet(); string UseLotteryList = ""; double Balance = 0; short State = 0; if (Valid(ref ds, ref UseLotteryList, ref Balance, ref State, AgentID, TimeStamp, Sign, LotteryID, IssueName) < 0) { return(ds); } if (ValidLotteryID(ref ds, UseLotteryList, LotteryID) < 0) { return(ds); } DataTable dt = new DAL.Tables.T_Isuses().Open("[ID], StartTime, EndTime, State, isOpened", "LotteryID = " + LotteryID.ToString() + "and [Name] = '" + Shove._Web.Utility.FilteSqlInfusion(IssueName) + "'", ""); if ((dt == null) || (dt.Rows.Count < 1)) { BuildReturnDataSetForError(-4, "奖期不存在", ref ds); new Log("Agent\\ElectronTicket").Write("奖期不存在"); return(ds); } long IsuseID = Shove._Convert.StrToLong(dt.Rows[0]["ID"].ToString(), -1); DateTime StartTime = Shove._Convert.StrToDateTime(dt.Rows[0]["StartTime"].ToString(), "1980-1-1 0:0:0"); DateTime EndTime = Shove._Convert.StrToDateTime(dt.Rows[0]["EndTime"].ToString(), "1980-1-1 0:0:0"); short IsuseState = Shove._Convert.StrToShort(dt.Rows[0]["State"].ToString(), -1); bool isOpened = Shove._Convert.StrToBool(dt.Rows[0]["isOpened"].ToString(), false); if (IsuseID < 0) { BuildReturnDataSetForError(-4, "奖期不存在", ref ds); new Log("Agent\\ElectronTicket").Write("奖期不存在"); return(ds); } DateTime Now = DateTime.Now; if ((Now < StartTime) || (IsuseState < 1)) { BuildReturnDataSetForError(-5, "奖期未开启", ref ds); new Log("Agent\\ElectronTicket").Write("奖期未开启"); return(ds); } if (!isOpened) { BuildReturnDataSetForError(-18, "奖期尚未开奖", ref ds); new Log("Agent\\ElectronTicket").Write("奖期尚未开奖"); return(ds); } BuildReturnDataSet(0, ref ds); DataTable dtSchemes = new DAL.Views.V_ElectronTicketAgentSchemes().Open("LotteryID, IsuseName as IssueName, SchemeNumber, WinMoney as Bonus, WinMoneyWithoutTax as BonusWithoutTax, WinLotteryNumber as BonusNumber, WinDescription as BonusDescription", "AgentID = " + AgentID.ToString() + " and LotteryID = " + LotteryID.ToString() + " and IsuseID = " + IsuseID.ToString() + " and WinMoney <> 0", "[ID]"); ds.Tables.Add(dtSchemes); return(ds); }
public DataSet GetIssueBonus(long AgentID, DateTime TimeStamp, string Sign, int LotteryID, string IssueName) { new Log(@"Agent\ElectronTicket").Write(string.Format("Method=GetIssueBonus\tAgentID={0}\tTimeStamp={1}\tSign={2}\tLotteryID={3}\tIssueName={4}", new object[] { AgentID, TimeStamp, Sign, LotteryID, IssueName })); DataSet returnDS = new DataSet(); string useLotteryList = ""; double balance = 0.0; short state = 0; if (this.Valid(ref returnDS, ref useLotteryList, ref balance, ref state, AgentID, TimeStamp, Sign, new object[] { LotteryID, IssueName }) >= 0) { if (this.ValidLotteryID(ref returnDS, useLotteryList, LotteryID) < 0) { return returnDS; } DataTable table = new Tables.T_Isuses().Open("[ID], StartTime, EndTime, State, isOpened", "LotteryID = " + LotteryID.ToString() + "and [Name] = '" + Utility.FilteSqlInfusion(IssueName) + "'", ""); if ((table == null) || (table.Rows.Count < 1)) { this.BuildReturnDataSetForError(-4, "奖期不存在", ref returnDS); new Log(@"Agent\ElectronTicket").Write("奖期不存在"); return returnDS; } long num3 = _Convert.StrToLong(table.Rows[0]["ID"].ToString(), -1L); DateTime time = _Convert.StrToDateTime(table.Rows[0]["StartTime"].ToString(), "1980-1-1 0:0:0"); _Convert.StrToDateTime(table.Rows[0]["EndTime"].ToString(), "1980-1-1 0:0:0"); short num4 = _Convert.StrToShort(table.Rows[0]["State"].ToString(), -1); bool flag = _Convert.StrToBool(table.Rows[0]["isOpened"].ToString(), false); if (num3 < 0L) { this.BuildReturnDataSetForError(-4, "奖期不存在", ref returnDS); new Log(@"Agent\ElectronTicket").Write("奖期不存在"); return returnDS; } if ((DateTime.Now < time) || (num4 < 1)) { this.BuildReturnDataSetForError(-5, "奖期未开启", ref returnDS); new Log(@"Agent\ElectronTicket").Write("奖期未开启"); return returnDS; } if (!flag) { this.BuildReturnDataSetForError(-18, "奖期尚未开奖", ref returnDS); new Log(@"Agent\ElectronTicket").Write("奖期尚未开奖"); return returnDS; } this.BuildReturnDataSet(0L, ref returnDS); DataTable table2 = new Views.V_ElectronTicketAgentSchemes().Open("LotteryID, IsuseName as IssueName, SchemeNumber, WinMoney as Bonus, WinMoneyWithoutTax as BonusWithoutTax, WinLotteryNumber as BonusNumber, WinDescription as BonusDescription", "AgentID = " + AgentID.ToString() + " and LotteryID = " + LotteryID.ToString() + " and IsuseID = " + num3.ToString() + " and WinMoney <> 0", "[ID]"); returnDS.Tables.Add(table2); } return returnDS; }
private void BindData() { string condition = "1=1"; if (!string.IsNullOrEmpty(this.tbIsuseName.Text.Trim())) { condition = condition + " and IsuseName= '" + Utility.FilteSqlInfusion(this.tbIsuseName.Text.Trim()) + "'"; } if (int.Parse(this.ddlLottery.SelectedItem.Value) > 0) { condition = condition + " and LotteryID= " + this.ddlLottery.SelectedItem.Value; } if (int.Parse(this.ddlState.SelectedItem.Value) > 0) { if (int.Parse(this.ddlState.SelectedItem.Value) == 2) { condition = condition + " and state > 1"; } else { condition = condition + " and state = 1"; } } if (!string.IsNullOrEmpty(this.tbStartTime.Text.Trim())) { DateTime.Parse("1981-01-01"); try { DateTime.Parse(this.tbStartTime.Text.Trim()); } catch { JavaScript.Alert(this.Page, "时间格式填写有错误!"); return; } condition = condition + " and DateTime > '" + this.tbStartTime.Text.Trim() + "'"; } if (!string.IsNullOrEmpty(this.tbEndTime.Text.Trim())) { DateTime.Parse("1981-01-01"); try { DateTime.Parse(this.tbEndTime.Text.Trim()); } catch { JavaScript.Alert(this.Page, "时间格式填写有错误!"); return; } condition = condition + " and DateTime < '" + this.tbEndTime.Text.Trim() + "'"; } if (!string.IsNullOrEmpty(this.tbSchemeNumber.Text.Trim())) { condition = "SchemeNumber= '" + Utility.FilteSqlInfusion(this.tbSchemeNumber.Text.Trim()) + "'"; } DataTable dt = new Views.V_ElectronTicketAgentSchemes().Open("ID, DateTime, SchemeNumber, Amount, LotteryName, PlayTypeName, State, Identifiers", condition, "DateTime"); if (dt != null) { PF.DataGridBindData(this.g, dt, this.gPager); } else { PF.GoError(4, "数据库繁忙,请重试", "Admin_SchemeAtTop"); } }
private void BindData() { string Condition = "WinMoney > 0"; if (!string.IsNullOrEmpty(tbIsuseName.Text.Trim())) { Condition += " and IsuseName= '" + Shove._Web.Utility.FilteSqlInfusion(tbIsuseName.Text.Trim()) + "'"; } if (int.Parse(ddlLottery.SelectedItem.Value) > 0) { Condition += " and LotteryID= " + Shove._Web.Utility.FilteSqlInfusion(ddlLottery.SelectedItem.Value); } if (int.Parse(ddlState.SelectedItem.Value) > 0) { if (int.Parse(ddlState.SelectedItem.Value) == 2) { Condition += " and state > 1"; } else { Condition += " and state = 1"; } } if (!string.IsNullOrEmpty(tbStartTime.Text.Trim())) { DateTime dtFrom = DateTime.Parse("1981-01-01"); try { dtFrom = DateTime.Parse(tbStartTime.Text.Trim()); } catch { Shove._Web.JavaScript.Alert(this.Page, "时间格式填写有错误!"); return; } Condition += " and DateTime > '" + tbStartTime.Text.Trim() + "'"; } if (!string.IsNullOrEmpty(tbEndTime.Text.Trim())) { DateTime dtFrom = DateTime.Parse("1981-01-01"); try { dtFrom = DateTime.Parse(tbEndTime.Text.Trim()); } catch { Shove._Web.JavaScript.Alert(this.Page, "时间格式填写有错误!"); return; } Condition += " and DateTime < '" + tbEndTime.Text.Trim() + "'"; } if (!string.IsNullOrEmpty(tbSchemeNumber.Text.Trim())) { Condition = "SchemeNumber= '" + Shove._Web.Utility.FilteSqlInfusion(tbSchemeNumber.Text.Trim()) + "'"; } DataTable dt = new DAL.Views.V_ElectronTicketAgentSchemes().Open("ID, DateTime, SchemeNumber, Amount, LotteryName, PlayTypeName, WinMoney, Identifiers", Condition, "DateTime"); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_SchemeAtTop"); return; } PF.DataGridBindData(g, dt, gPager); }
private void BindData() { string Condition = "1=1"; if (!string.IsNullOrEmpty(tbIsuseName.Text.Trim())) { Condition += " and IsuseName= '" + Shove._Web.Utility.FilteSqlInfusion(tbIsuseName.Text.Trim()) + "'"; } if (int.Parse(ddlLottery.SelectedItem.Value) > 0) { Condition += " and LotteryID= " + ddlLottery.SelectedItem.Value; } if (int.Parse(ddlState.SelectedItem.Value) > 0) { if (int.Parse(ddlState.SelectedItem.Value) == 2) { Condition += " and state > 1"; } else { Condition += " and state = 1"; } } if (!string.IsNullOrEmpty(tbStartTime.Text.Trim())) { DateTime dtFrom = DateTime.Parse("1981-01-01"); try { dtFrom = DateTime.Parse(tbStartTime.Text.Trim()); } catch { Shove._Web.JavaScript.Alert(this.Page, "时间格式填写有错误!"); return; } Condition += " and DateTime > '" + tbStartTime.Text.Trim() + "'"; } if (!string.IsNullOrEmpty(tbEndTime.Text.Trim())) { DateTime dtFrom = DateTime.Parse("1981-01-01"); try { dtFrom = DateTime.Parse(tbEndTime.Text.Trim()); } catch { Shove._Web.JavaScript.Alert(this.Page, "时间格式填写有错误!"); return; } Condition += " and DateTime < '" + tbEndTime.Text.Trim() + "'"; } if (!string.IsNullOrEmpty(tbSchemeNumber.Text.Trim())) { Condition = "SchemeNumber= '" + Shove._Web.Utility.FilteSqlInfusion(tbSchemeNumber.Text.Trim()) + "'"; } DataTable dt = new DAL.Views.V_ElectronTicketAgentSchemes().Open("ID, DateTime, SchemeNumber, Amount, LotteryName, PlayTypeName, State, Identifiers", Condition, "DateTime"); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_SchemeAtTop"); return; } PF.DataGridBindData(g, dt, gPager); }