public DataTable LoaiThietBiDelete(ref string err, DTO_LoaiThietBi ltb) { DataTable _dt = new DataTable(); try { return(_dt = data.GetDataTable("sp_TypeINF_Delete", CommandType.StoredProcedure, ref err , new SqlParameter("@ID_INF", ltb.ID_INF1) )); } catch (Exception ex) { err = ex.Message; return(_dt); } }
public void CapNhatLoaiThietBi() { DataTable numberr; Dto_loaithietbi = new DTO_LoaiThietBi(); Dto_loaithietbi.ID_INF1 = Convert.ToInt32(lblid.Text); Dto_loaithietbi.NAMES_INF1 = txttenloaitb.Text.Trim(); Dto_loaithietbi.Num_now = Convert.ToInt32(txtsoluong.Text); Dto_loaithietbi.Exp_machine = Convert.ToInt32(txttangtrongnam.Text); Dto_loaithietbi.Day_inf = combongaythang.Value.ToShortDateString(); numberr = _db.LoaiThietBiUpdate(ref err, Dto_loaithietbi); if (numberr.Rows.Count > 0) { ToastNotification.Show(this, numberr.Rows[0]["ErrMsg"].ToString(), null, 2000, (eToastGlowColor)eToastGlowColor.Blue, (eToastPosition)eToastPosition.BottomCenter); } }
public void ThemLoaiThietBi() { DataTable numberr; Dto_loaithietbi = new DTO_LoaiThietBi() { ID_CLASS1 = Convert.ToInt32(cbphonghoc.SelectedValue), NAMES_INF1 = txttenloaitb.Text.Trim(), Num_now = Convert.ToInt32(txtsoluong.Text), Exp_machine = Convert.ToInt32(txttangtrongnam.Text), Day_inf = combongaythang.Value.ToShortDateString(), }; numberr = _db.LoaiThietBiInsert(ref err, Dto_loaithietbi); if (numberr.Rows.Count > 0) { ToastNotification.Show(this, numberr.Rows[0]["ErrMsg"].ToString(), null, 2000, (eToastGlowColor)eToastGlowColor.Blue, (eToastPosition)eToastPosition.BottomCenter); } }
public DataTable LoaiThietBiInsert(ref string err, DTO_LoaiThietBi ltb) { DataTable _dt = new DataTable(); try { return(_dt = data.GetDataTable("sp_TypeINF_Insert", CommandType.StoredProcedure, ref err , new SqlParameter("@ID_CLASS", ltb.ID_CLASS1) , new SqlParameter("@NAMES_INF", ltb.NAMES_INF1) , new SqlParameter("@NUM_NOW_INF", ltb.Num_now) , new SqlParameter("@EXP_MACHINE", ltb.Exp_machine) , new SqlParameter("@DAY_INF", ltb.Day_inf) )); } catch (Exception ex) { err = ex.Message; return(_dt); } }
public void XoaLoaiThietBi() { // try // { DataTable numberr; Dto_loaithietbi = new DTO_LoaiThietBi(); Dto_loaithietbi.ID_INF1 = Convert.ToInt32(lblid.Text); numberr = _db.LoaiThietBiDelete(ref err, Dto_loaithietbi); if (numberr.Rows.Count > 0) { ToastNotification.Show(this, numberr.Rows[0]["ErrMsg"].ToString(), null, 2000, (eToastGlowColor)eToastGlowColor.Blue, (eToastPosition)eToastPosition.BottomCenter); } else { ToastNotification.Show(this, "Không thể xóa, hãy xóa những thiết bị có chung nhóm thiết bị này!", null, 2000, (eToastGlowColor)eToastGlowColor.Red, (eToastPosition)eToastPosition.BottomCenter); } // } // catch (Exception e) // { // // } }