private void Gan_Obj(CHITIET_HDB obj)
 {
     obj.Mavach    = cmbTenHH.SelectedValue.ToString();
     obj.Soluong   = int.Parse(txtSoluong.Text.Trim());
     obj.Dongiaban = float.Parse(cmbDongia.Text.Trim());
     obj.Giamgia   = float.Parse(txtgiamgia.Text.Trim());
     obj.Mahoadon  = cmbMaHD.SelectedValue.ToString();
     obj.Thanhtien = float.Parse(Lbthanhtien.Text.Trim());
 }
예제 #2
0
 public bool Up_Obj(CHITIET_HDB obj)
 {
     try
     {
         conn.OpenConn();
         //    DataTable dt = new DataTable();
         SqlCommand cmd = new SqlCommand("suacthoadonban", conn.SQL_CONN);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.Add(new SqlParameter("@mahoadon", obj.Mahoadon));
         cmd.Parameters.Add(new SqlParameter("@mavach", obj.Mavach));
         cmd.Parameters.AddWithValue("@soluong", Convert.ToInt32(obj.Soluong));
         cmd.Parameters.AddWithValue("@thanhtien", Convert.ToDouble(obj.Thanhtien));
         cmd.Parameters.AddWithValue("@dongiaban", Convert.ToDouble(obj.Dongiaban));
         cmd.Parameters.AddWithValue("@giamgia", Convert.ToDouble(obj.Giamgia));
         cmd.ExecuteNonQuery();
         conn.CloseConn();
         return(true);
     }
     catch (Exception ex1)
     {
         throw;
     }
 }
예제 #3
0
 public bool Up_Obj(CHITIET_HDB Obj)
 {
     return(obj_m.Up_Obj(Obj));
 }
예제 #4
0
 public bool Add_Obj(CHITIET_HDB Obj)
 {
     return(obj_m.Add_Obj(Obj));
 }