/// <summary> /// 保存体彩设置 /// </summary> /// <param name="prs">体彩设置对象</param> /// <returns></returns> public int SaveSportsLotterySetting(SportsLotterySetting prs) { int i = -1; string sqlSportsLotterySetting = "update SportsLotterySettingTable set [IssueT]=@IssueT,[FootballLottery]=@FootballLottery,[Number]=@Number,[Lotto]=@Lotto,[MultiplyPrintingOne]=@MultiplyPrintingOne,[MultiplyPrintingTow]=@MultiplyPrintingTow,[MultiplyPrintingThree]=@MultiplyPrintingThree,[RowOfThree]=@RowOfThree,[Basketball]=@Basketball,[Other]=@Other,[OtherFootballLottery]=@OtherFootballLottery,[PagePrint]=@PagePrint,[PagePrintSetting]=@PagePrintSetting,[PagePrintDouble]=@PagePrintDouble,[SwitchDouble]=@SwitchDouble,Logo=1 where ID=2"; OleDbParameter[] oldepls = new OleDbParameter[] { new OleDbParameter("@IssueT", prs.IssueT), new OleDbParameter("@FootballLottery", prs.FootballLottery), new OleDbParameter("@Number", prs.Number), new OleDbParameter("@Lotto", prs.Lotto), new OleDbParameter("@MultiplyPrintingOne", prs.MultiplyPrintingOne), new OleDbParameter("@MultiplyPrintingTow", prs.MultiplyPrintingTow), new OleDbParameter("@MultiplyPrintingThree", prs.MultiplyPrintingThree), new OleDbParameter("@RowOfThree", prs.RowOfThree), new OleDbParameter("@Basketball", prs.Basketball), new OleDbParameter("@Other", prs.Other), new OleDbParameter("@OtherFootballLottery", prs.OtherFootballLottery), new OleDbParameter("@PagePrint", prs.PagePrint), new OleDbParameter("@PagePrintSetting", prs.PagePrintSetting), new OleDbParameter("@PagePrintDouble", prs.PagePrintDouble), new OleDbParameter("@SwitchDouble", prs.SwitchDouble) }; i = DAL.OLEDBHelp.GetExecute(sqlSportsLotterySetting, oldepls); return(i); }
/// <summary> /// 读取体彩设置 /// </summary> /// <param name="i">0:默认设置,1:还原上次保存的设置</param> /// <returns></returns> public SportsLotterySetting GetSportsLotterySetting(int i) { SportsLotterySetting ps = new SportsLotterySetting(); OleDbDataReader oleRead = null; if (i == 0) { oleRead = DAL.OLEDBHelp.GetReader("select * from SportsLotterySettingTable where ID=1"); } else if (i == 1) { oleRead = DAL.OLEDBHelp.GetReader("select * from SportsLotterySettingTable where ID=2"); } while (oleRead.Read()) { ps.IssueT = Convert.ToInt32(oleRead["IssueT"]); ps.FootballLottery = Convert.ToInt32(oleRead["FootballLottery"]); ps.Number = Convert.ToInt32(oleRead["Number"]); ps.Lotto = Convert.ToInt32(oleRead["Lotto"]); ps.MultiplyPrintingOne = Convert.ToInt32(oleRead["MultiplyPrintingOne"]); ps.MultiplyPrintingTow = Convert.ToInt32(oleRead["MultiplyPrintingTow"]); ps.MultiplyPrintingThree = Convert.ToInt32(oleRead["MultiplyPrintingThree"]); ps.RowOfThree = Convert.ToInt32(oleRead["RowOfThree"]); ps.Basketball = Convert.ToInt32(oleRead["Basketball"]); ps.Other = Convert.ToInt32(oleRead["Other"]); ps.OtherFootballLottery = Convert.ToInt32(oleRead["OtherFootballLottery"]); ps.PagePrint = Convert.ToInt32(oleRead["PagePrint"]); ps.PagePrintSetting = Convert.ToInt32(oleRead["PagePrintSetting"]); ps.PagePrintDouble = Convert.ToInt32(oleRead["PagePrintDouble"]); ps.SwitchDouble = Convert.ToInt32(oleRead["SwitchDouble"]); } return(ps); }
/// <summary> /// 是否成功保存体彩设置的方法 /// </summary> /// <param name="prs">体彩设置对象</param> /// <returns></returns> public int IsSaveSportsLotterySetting(SportsLotterySetting prs) { int j = -1; if (SaveSportsLotterySetting(prs) >= 0) { j = 1; } return(j); }
/// <summary> /// 体彩设置 /// </summary> public void GiveSportsLotterySetting() { if (bll.IsTypeSportsLotterySetting() == true) { //载入数据体彩设置 sls = bll.GetSportsLotterySetting(1); SetSportsLotterySetting(sls); } else { //默认体彩设置数据 sls = bll.GetSportsLotterySetting(0); SetSportsLotterySetting(sls); } }
/// <summary> /// 恢复体彩设置 /// </summary> /// <param name="prs"></param> public void SetSportsLotterySetting(SportsLotterySetting prs) { com_IssueT.SelectedIndex = prs.IssueT; com_FootballLottery.SelectedIndex = prs.FootballLottery; com_Number.SelectedIndex = prs.Number; com_Lotto.SelectedIndex = prs.Lotto; com_MultiplyPrintingOne.SelectedIndex = prs.MultiplyPrintingOne; com_MultiplyPrintingTow.SelectedIndex = prs.MultiplyPrintingTow; com_MultiplyPrintingThree.SelectedIndex = prs.MultiplyPrintingThree; che_RowOfThree.Checked = prs.RowOfThree == 1 ? true : false; che_Basketball.Checked = prs.Basketball == 1 ? true : false; che_Other.Checked = prs.Other == 1 ? true : false; che_OtherFootballLottery.Checked = prs.OtherFootballLottery == 1 ? true : false; che_PagePrint.Checked = prs.PagePrint == 1 ? true : false; com_PagePrintSetting.SelectedIndex = prs.PagePrintSetting; che_PagePrintDouble.Checked = prs.PagePrintDouble == 1 ? true : false; com_SwitchDouble.SelectedIndex = prs.SwitchDouble; }
/// <summary> /// 将体彩设置的信息存入对象 /// </summary> /// <returns></returns> public SportsLotterySetting SaveSportsLotterySettingObject() { sls = new SportsLotterySetting(); sls.IssueT = com_IssueT.SelectedIndex; sls.FootballLottery = com_FootballLottery.SelectedIndex; sls.Number = com_Number.SelectedIndex; sls.Lotto = com_Lotto.SelectedIndex; sls.MultiplyPrintingOne = com_MultiplyPrintingOne.SelectedIndex; sls.MultiplyPrintingTow = com_MultiplyPrintingTow.SelectedIndex; sls.MultiplyPrintingThree = com_MultiplyPrintingThree.SelectedIndex; sls.RowOfThree = che_RowOfThree.Checked == true ? 1 : 0; sls.Basketball = che_Basketball.Checked == true ? 1 : 0; sls.Other = che_Other.Checked == true ? 1 : 0; sls.OtherFootballLottery = che_OtherFootballLottery.Checked == true ? 1 : 0; sls.PagePrint = che_PagePrint.Checked == true ? 1 : 0; sls.PagePrintSetting = com_PagePrintSetting.SelectedIndex; sls.PagePrintDouble = che_PagePrintDouble.Checked == true ? 1 : 0; sls.SwitchDouble = com_SwitchDouble.SelectedIndex; return(sls); }