public void SaveMasterRec(inv_master_Retail inv) { using (MySqlConnection con = new MySqlConnection(LoginUser.cs)) { string sql = "INSERT INTO `tbl_purchase_order`(`User_ID`, `Supplier_ID`, `Date`) VALUES ('" + inv.UserID + "','" + inv.Supplier_ID + "','" + inv.InvDate + "')"; MySqlCommand cmd = new MySqlCommand(sql, con); con.Open(); cmd.ExecuteNonQuery(); } }
public void SaveMasterRec(inv_master_Retail inv) { using (MySqlConnection con = new MySqlConnection(LoginUser.cs)) { string sql = "INSERT INTO `tbl_invoice_master_retail`( `Date`, `Time`, `User_ID`) VALUES ('" + inv.InvDate + "','" + inv.Time + "','" + inv.UserID + "')"; MySqlCommand cmd = new MySqlCommand(sql, con); con.Open(); cmd.ExecuteNonQuery(); } }
private void btnSave_Click_1(object sender, EventArgs e) { LoginUser.IDGlobal = 2; inv_master_Retail invm = new inv_master_Retail(); invm.InvDate = Convert.ToDateTime(DateTime.Now.ToShortDateString()); invm.Time = Convert.ToDateTime(DateTime.Now.ToShortTimeString()); invm.UserID = LoginUser.IDGlobal; SaveMasterRec(invm); int InvNo = CreateInvTransList(); MessageBox.Show("Invoice No:" + InvNo.ToString() + "Saved successfuly"); invlist.Clear(); dataGridView1.Rows.Clear(); }
private void btn_Save_Click(object sender, EventArgs e) { LoginUser.IDGlobal = 2; inv_master_Retail invm = new inv_master_Retail(); invm.InvDate = Convert.ToDateTime(DateTime.Now.ToShortDateString()); invm.Time = Convert.ToDateTime(DateTime.Now.ToShortTimeString()); invm.UserID = LoginUser.IDGlobal; invm.Supplier_ID = Convert.ToInt32(cmb_Supplier.SelectedValue.ToString()); SaveMasterRec(invm); int InvNo = CreateInvTransList(); MessageBox.Show("Invoice No:" + InvNo.ToString() + "Saved successfuly"); invlist.Clear(); DataGrid_temp_Purchase_order.Rows.Clear(); }