public static void Update(AwardDataSet dataSet) { using (var dx = new AwardDataSetTableAdapters.TableAdapterManager()) { dx.UpdateAll(dataSet); } }
private void bindingData(AwardDataSet.TmpAwardDataTable dt) { foreach (var item in dt) { //var city = item.TicketNO.Substring(0, 2); //if (city == "SZ") //{ switch (item.Level) { case "4": BuildTableRow(this.tableYG, item); break; case "3": BuildTableRow(this.tableSZ31, item); break; case "2": BuildTableRow(this.tableSZ2, item); break; case "1": BuildTableRow(this.tableSZ1, item); break; case "0": BuildTableRow(this.tableSZ0, item); break; } // } //if (city == "BJ") //{ // switch (item.Level) // { // case "3": // //switch (item.Remark) // //{ // // case "Batch1": // // BuildTableRow(this.tableBJ31, item); // // break; // // case "Batch2": // // BuildTableRow(this.tableBJ32, item); // // break; // // case "Batch3": // // BuildTableRow(this.tableBJ33, item); // // break; // //} // BuildTableRow(this.tableBJ31, item); // break; // case "2": // BuildTableRow(this.tableBJ2, item); // break; // case "1": // BuildTableRow(this.tableBJ1, item); // break; // case "0": // BuildTableRow(this.tableBJ0, item); // break; // } //} } }
public AwardMachine(AwardDataSet.TmpOptionDataTable option, AwardDataSet.TmpTicketDataTable ticket, AwardDataSet.TmpAwardDataTable award) { this.Option = option; this.Ticket = ticket; this.Award = award; this.updateCandidate(); }
private AwardDataSet.TmpAwardRow generateOneAwardByPlan(AwardDataSet.TmpOptionRow plan) { var item = this.Award.NewTmpAwardRow(); item.TicketNO = this.getLucky(); item.Level = plan.Level; item.UpdateTime = DateTime.Now; this.Award.AddTmpAwardRow(item); return item; }
public void AddAward(string ticketNO, string level, string remark) { var dst = new AwardDataSet(); var item = dst.TmpAward.NewTmpAwardRow(); item.TicketNO = ticketNO; item.Level = level; item.Remark = remark; item.UpdateTime = DateTime.Now; dst.TmpAward.AddTmpAwardRow(item); DataContext.Update(dst.TmpAward); }
protected void ButtonSingle_Click(object sender, EventArgs e) { var ticketNO =this.TextBoxSingle.Text.Trim(); if (ticketNO.Length <4) ticketNO=ticketNO.PadLeft(4,'0'); ticketNO = this.RadioButtonList1.SelectedValue + "-" + ticketNO; var dst = new AwardDataSet(); var item = dst.TmpTicket.NewTmpTicketRow(); item.TicketNO = ticketNO; dst.TmpTicket.AddTmpTicketRow(item); DataContext.Update(dst.TmpTicket); }
public static AwardEntity[] BuildAwardEntity(AwardDataSet.TmpAwardRow[] ongoing) { var result = new AwardEntity[ongoing.Length]; for (var i = 0; i < result.Length; i++) { var item = new AwardEntity(); item.TicketNO = ongoing[i].TicketNO; item.Level = ongoing[i].Level; item.Remark = ongoing[i].Remark; result[i] = item; } return result; }
protected void ButtonBatch_Click(object sender, EventArgs e) { var start = Int32.Parse(this.TextBoxStart.Text.Trim()); var end = Int32.Parse(this.TextBoxEnd.Text.Trim()); var dst = new AwardDataSet(); for (int i = start; i <= end; i++) { var item = dst.TmpTicket.NewTmpTicketRow(); var ticketNO = i.ToString(); if (ticketNO.Length < 4) ticketNO = ticketNO.PadLeft(4, '0'); ticketNO = this.RadioButtonList1.SelectedValue +"-"+ ticketNO; item.TicketNO = ticketNO; dst.TmpTicket.AddTmpTicketRow(item); } DataContext.Update(dst.TmpTicket); }
public static void BuildTableRow(HtmlTable table, AwardDataSet.TmpAwardRow item) { var tr = new HtmlTableRow(); var cell = new HtmlTableCell(); cell.InnerText = item.TicketNO; tr.Cells.Add(cell); table.Rows.Add(tr); }
public static void Update(AwardDataSet.TmpTicketDataTable ticket) { using (var dx = new AwardDataSetTableAdapters.TmpTicketTableAdapter()) { dx.Update(ticket); } }
public static void Update(AwardDataSet.TmpAwardDataTable award) { using (var dx = new AwardDataSetTableAdapters.TmpAwardTableAdapter()) { dx.Update(award); } }
private void bindingData(AwardDataSet.TmpAwardDataTable dt) { foreach (var item in dt) { var city = item.TicketNO.Substring(0, 2); if (city == "SZ") { switch (item.Level) { case "3": switch (item.Remark) { case "Batch1": BuildTableRow(this.tableSZ31, item); break; case "Batch2": BuildTableRow(this.tableSZ32, item); break; case "Batch3": BuildTableRow(this.tableSZ33, item); break; } break; case "2": BuildTableRow(this.tableSZ2, item); break; case "1": BuildTableRow(this.tableSZ1, item); break; case "0": BuildTableRow(this.tableSZ0, item); break; } } if (city == "BJ") { switch (item.Level) { case "3": switch (item.Remark) { case "Batch1": BuildTableRow(this.tableBJ31, item); break; case "Batch2": BuildTableRow(this.tableBJ32, item); break; case "Batch3": BuildTableRow(this.tableBJ33, item); break; } break; case "2": BuildTableRow(this.tableBJ2, item); break; case "1": BuildTableRow(this.tableBJ1, item); break; case "0": BuildTableRow(this.tableBJ0, item); break; } } } }