public static VanBanBh Update(VanBanBh Updated) { VanBanBh Item = new VanBanBh(); SqlParameter[] obj = new SqlParameter[37]; obj[0] = new SqlParameter("VB_ID", Updated.ID); obj[1] = new SqlParameter("VB_LV_ID", Updated.LV_ID); obj[2] = new SqlParameter("VB_LV_Ten", Updated.LV_Ten); obj[3] = new SqlParameter("VB_LOAI_ID", Updated.LOAI_ID); obj[4] = new SqlParameter("VB_LOAI_Ten", Updated.LOAI_Ten); obj[5] = new SqlParameter("VB_Ma", Updated.Ma); obj[6] = new SqlParameter("VB_NoiGui", Updated.NoiGui); obj[7] = new SqlParameter("VB_DiaChi", Updated.DiaChi); obj[8] = new SqlParameter("VB_CMT", Updated.CMT); obj[9] = new SqlParameter("VB_NgayCap", Updated.NgayCap); obj[10] = new SqlParameter("VB_DienThoai", Updated.DienThoai); obj[11] = new SqlParameter("VB_Fax", Updated.Fax); obj[12] = new SqlParameter("VB_Email", Updated.Email); obj[13] = new SqlParameter("VB_NoiDung", Updated.NoiDung); obj[14] = new SqlParameter("VB_RowId", Updated.RowId); obj[15] = new SqlParameter("VB_TrangThai", Updated.TrangThai); obj[16] = new SqlParameter("VB_NguoiTao", Updated.NguoiTao); obj[17] = new SqlParameter("VB_NgayTao", Updated.NgayTao); obj[18] = new SqlParameter("VB_NguoiCapNhat", Updated.NguoiCapNhat); obj[19] = new SqlParameter("VB_NgayCapNhat", Updated.NgayCapNhat); obj[20] = new SqlParameter("VB_NgayHenTra", Updated.NgayHenTra); obj[21] = new SqlParameter("VB_NgayTiepNhan", Updated.NgayTiepNhan); obj[22] = new SqlParameter("VB_NguoiNop", Updated.NguoiNop); obj[23] = new SqlParameter("VB_MCCM_NgayNhan", Updated.MCCM_NgayNhan); obj[24] = new SqlParameter("VB_MCCM_CQ_ID", Updated.MCCM_CQ_ID); obj[25] = new SqlParameter("VB_MCCM_CQ_Ten", Updated.MCCM_CQ_Ten); obj[26] = new SqlParameter("VB_MCCM_MEM_ID", Updated.MCCM_MEM_ID); obj[27] = new SqlParameter("VB_MCCM_MEM_Username", Updated.MCCM_MEM_Username); obj[28] = new SqlParameter("VB_MCCM_MEM_Ten", Updated.MCCM_MEM_Ten); obj[29] = new SqlParameter("VB_CMMC_NgayNhan", Updated.CMMC_NgayNhan); obj[30] = new SqlParameter("VB_CMMC_MEM_ID", Updated.CMMC_MEM_ID); obj[31] = new SqlParameter("VB_CMMC_MEM_Username", Updated.CMMC_MEM_Username); obj[32] = new SqlParameter("VB_CMMC_MEM_Ten", Updated.CMMC_MEM_Ten); obj[33] = new SqlParameter("VB_MCNN_NgayTra", Updated.MCNN_NgayTra); obj[34] = new SqlParameter("VB_MCNN_NguoiNhan", Updated.MCNN_NguoiNhan); obj[35] = new SqlParameter("VB_ThoiHan", Updated.ThoiHan); obj[36] = new SqlParameter("VB_KetQua", Updated.KetQua); using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblVanBanBh_Update_UpdateNormal_linhnx", obj)) { while (rd.Read()) { Item = getFromReader(rd); } } return(Item); }
public static VanBanBh SelectById(Int32 VB_ID) { VanBanBh Item = new VanBanBh(); SqlParameter[] obj = new SqlParameter[1]; obj[0] = new SqlParameter("VB_ID", VB_ID); using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblVanBanBh_Select_SelectById_linhnx", obj)) { while (rd.Read()) { Item = getFromReader(rd); } } return(Item); }
public static VanBanBh InsertDraff(VanBanBh Inserted) { VanBanBh Item = new VanBanBh(); SqlParameter[] obj = new SqlParameter[4]; obj[0] = new SqlParameter("VB_NgayTao", Inserted.NgayTao); obj[1] = new SqlParameter("VB_NguoiTao", Inserted.NguoiTao); obj[2] = new SqlParameter("VB_NgayCapNhat", Inserted.NgayCapNhat); obj[3] = new SqlParameter("VB_RowId", Inserted.RowId); using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblVanBanBh_Insert_InsertDraff_linhnx", obj)) { while (rd.Read()) { Item = getFromReader(rd); } } return(Item); }
public static VanBanBh getFromReader(IDataReader rd) { VanBanBh Item = new VanBanBh(); if (rd.FieldExists("VB_ID")) { Item.ID = (Int32)(rd["VB_ID"]); } if (rd.FieldExists("VB_LV_ID")) { Item.LV_ID = (Int32)(rd["VB_LV_ID"]); } if (rd.FieldExists("VB_LV_Ten")) { Item.LV_Ten = (String)(rd["VB_LV_Ten"]); } if (rd.FieldExists("VB_LOAI_ID")) { Item.LOAI_ID = (Int32)(rd["VB_LOAI_ID"]); } if (rd.FieldExists("VB_LOAI_Ten")) { Item.LOAI_Ten = (String)(rd["VB_LOAI_Ten"]); } if (rd.FieldExists("VB_Ma")) { Item.Ma = (String)(rd["VB_Ma"]); } if (rd.FieldExists("VB_NoiGui")) { Item.NoiGui = (String)(rd["VB_NoiGui"]); } if (rd.FieldExists("VB_DiaChi")) { Item.DiaChi = (String)(rd["VB_DiaChi"]); } if (rd.FieldExists("VB_CMT")) { Item.CMT = (String)(rd["VB_CMT"]); } if (rd.FieldExists("VB_NgayCap")) { Item.NgayCap = (DateTime)(rd["VB_NgayCap"]); } if (rd.FieldExists("VB_DienThoai")) { Item.DienThoai = (String)(rd["VB_DienThoai"]); } if (rd.FieldExists("VB_Fax")) { Item.Fax = (String)(rd["VB_Fax"]); } if (rd.FieldExists("VB_Email")) { Item.Email = (String)(rd["VB_Email"]); } if (rd.FieldExists("VB_NoiDung")) { Item.NoiDung = (String)(rd["VB_NoiDung"]); } if (rd.FieldExists("VB_RowId")) { Item.RowId = (Guid)(rd["VB_RowId"]); } if (rd.FieldExists("VB_TrangThai")) { Item.TrangThai = (Int32)(rd["VB_TrangThai"]); } if (rd.FieldExists("VB_NguoiTao")) { Item.NguoiTao = (String)(rd["VB_NguoiTao"]); } if (rd.FieldExists("VB_NgayTao")) { Item.NgayTao = (DateTime)(rd["VB_NgayTao"]); } if (rd.FieldExists("VB_NguoiCapNhat")) { Item.NguoiCapNhat = (String)(rd["VB_NguoiCapNhat"]); } if (rd.FieldExists("VB_NgayCapNhat")) { Item.NgayCapNhat = (DateTime)(rd["VB_NgayCapNhat"]); } if (rd.FieldExists("VB_NgayHenTra")) { Item.NgayHenTra = (DateTime)(rd["VB_NgayHenTra"]); } if (rd.FieldExists("VB_NgayTiepNhan")) { Item.NgayTiepNhan = (DateTime)(rd["VB_NgayTiepNhan"]); } if (rd.FieldExists("VB_NguoiNop")) { Item.NguoiNop = (String)(rd["VB_NguoiNop"]); } if (rd.FieldExists("VB_MCCM_NgayNhan")) { Item.MCCM_NgayNhan = (DateTime)(rd["VB_MCCM_NgayNhan"]); } if (rd.FieldExists("VB_MCCM_CQ_ID")) { Item.MCCM_CQ_ID = (Int32)(rd["VB_MCCM_CQ_ID"]); } if (rd.FieldExists("VB_MCCM_CQ_Ten")) { Item.MCCM_CQ_Ten = (String)(rd["VB_MCCM_CQ_Ten"]); } if (rd.FieldExists("VB_MCCM_MEM_ID")) { Item.MCCM_MEM_ID = (Int32)(rd["VB_MCCM_MEM_ID"]); } if (rd.FieldExists("VB_MCCM_MEM_Username")) { Item.MCCM_MEM_Username = (String)(rd["VB_MCCM_MEM_Username"]); } if (rd.FieldExists("VB_MCCM_MEM_Ten")) { Item.MCCM_MEM_Ten = (String)(rd["VB_MCCM_MEM_Ten"]); } if (rd.FieldExists("VB_CMMC_NgayNhan")) { Item.CMMC_NgayNhan = (DateTime)(rd["VB_CMMC_NgayNhan"]); } if (rd.FieldExists("VB_CMMC_MEM_ID")) { Item.CMMC_MEM_ID = (Int32)(rd["VB_CMMC_MEM_ID"]); } if (rd.FieldExists("VB_CMMC_MEM_Username")) { Item.CMMC_MEM_Username = (String)(rd["VB_CMMC_MEM_Username"]); } if (rd.FieldExists("VB_CMMC_MEM_Ten")) { Item.CMMC_MEM_Ten = (String)(rd["VB_CMMC_MEM_Ten"]); } if (rd.FieldExists("VB_MCNN_NgayTra")) { Item.MCNN_NgayTra = (DateTime)(rd["VB_MCNN_NgayTra"]); } if (rd.FieldExists("VB_MCNN_NguoiNhan")) { Item.MCNN_NguoiNhan = (String)(rd["VB_MCNN_NguoiNhan"]); } if (rd.FieldExists("VB_ThoiHan")) { Item.ThoiHan = (Int16)(rd["VB_ThoiHan"]); } if (rd.FieldExists("VB_KetQua")) { Item.KetQua = (Int16)(rd["VB_KetQua"]); } return(Item); }