public void CompleteOrderRecord(DataGridView d1, string bilno, string billissuedate, string dealerid, string imagepath) { OrderLineItem = new LinkedList <CalendaringOrderLineItem>(); for (int i = 0; i < d1.RowCount - 1; i++) { bool x; if (d1.Rows[i].Cells[6].Value.ToString() == "Yes") { x = true; } else { x = false; } string date = d1.Rows[i].Cells[8].Value.ToString(); OrderLineItem.AddLast(new CalendaringOrderLineItem(bilno, int.Parse(d1.Rows[i].Cells[0].Value.ToString()), d1.Rows[i].Cells[3].Value.ToString(), d1.Rows[i].Cells[1].Value.ToString(), int.Parse(d1.Rows[i].Cells[4].Value.ToString()), double.Parse(d1.Rows[i].Cells[5].Value.ToString()), Double.Parse(d1.Rows[i].Cells[6].Value.ToString()), x, date, SaveImage(imagepath), d1.Rows[i].Cells[2].Value.ToString())); AddCodeName(d1.Rows[i].Cells[2].Value.ToString(), d1.Rows[i].Cells[3].Value.ToString()); } OrderTransaction = new CalendaringOrder(dealerid, bilno, billissuedate, totalamt); WriteOrder(); UpdateNewRemainingPayment(); totalamt = 0; }
public CalendaringOrder LoadCalendarOrderTransactionDetails(string billno) { con = new SqlConnection(); cmd = new SqlCommand(); cmd.CommandText = string.Format("select * from CalendaringOrder where dealeruserid='{0}' and [BillNo.]='{1}'", dealer.UserId, billno); con.ConnectionString = Connection; con.Open(); cmd.Connection = con; cmd.ExecuteNonQuery(); reader = cmd.ExecuteReader(); CalendaringOrder e2; if (reader.Read()) { e2 = new CalendaringOrder(reader[3].ToString(), reader[0].ToString(), reader[1].ToString(), double.Parse(reader[2].ToString())); //e2.BillNo = reader[0].ToString(); con.Close(); reader.Close(); return(e2); } else { MessageBox.Show(""); reader.Close(); con.Close(); return(null); } }
public CalendarBillView(CalendaringOrderLineItem[] order, CalendaringOrder Transaction) { InitializeComponent(); this.order = order; this.Transaction = Transaction; BillDataGridView.Rows.Clear(); //MessageBox.Show(""); }
public CalendaringOrder[] LoadPrevoiusCalendarDealerTransactions() { LinkedList <CalendaringOrder> e1 = new LinkedList <CalendaringOrder>(); con = new SqlConnection(); cmd = new SqlCommand(); cmd.CommandText = string.Format("select [BillNo.] from CalendaringOrder where dealeruserid='{0}'", dealer.UserId); con.ConnectionString = Connection; con.Open(); cmd.Connection = con; cmd.ExecuteNonQuery(); reader = cmd.ExecuteReader(); while (reader.Read()) { CalendaringOrder e2 = new CalendaringOrder(); e2.BillNo = reader[0].ToString(); e1.AddLast(e2); } con.Close(); return(e1.ToArray <CalendaringOrder>()); }