public static MauTaiLieuVanBan SelectById(Int32 MTLVB_ID) { MauTaiLieuVanBan Item = new MauTaiLieuVanBan(); SqlParameter[] obj = new SqlParameter[1]; obj[0] = new SqlParameter("MTLVB_ID", MTLVB_ID); using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblMauTaiLieuVanBan_Select_SelectById_linhnx", obj)) { while (rd.Read()) { Item = getFromReader(rd); } } return(Item); }
public static MauTaiLieuVanBan Insert(MauTaiLieuVanBan Inserted) { MauTaiLieuVanBan Item = new MauTaiLieuVanBan(); SqlParameter[] obj = new SqlParameter[3]; obj[0] = new SqlParameter("MTLVB_MTL_ID", Inserted.MTL_ID); obj[1] = new SqlParameter("MTLVB_VB_ID", Inserted.VB_ID); obj[2] = new SqlParameter("MTLVB_Loai", Inserted.Loai); using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblMauTaiLieuVanBan_Insert_InsertNormal_linhnx", obj)) { while (rd.Read()) { Item = getFromReader(rd); } } return(Item); }
public static MauTaiLieuVanBan getFromReader(IDataReader rd) { MauTaiLieuVanBan Item = new MauTaiLieuVanBan(); if (rd.FieldExists("MTLVB_ID")) { Item.ID = (Int32)(rd["MTLVB_ID"]); } if (rd.FieldExists("MTLVB_MTL_ID")) { Item.MTL_ID = (Int32)(rd["MTLVB_MTL_ID"]); } if (rd.FieldExists("MTLVB_VB_ID")) { Item.VB_ID = (Int32)(rd["MTLVB_VB_ID"]); } if (rd.FieldExists("MTLVB_Loai")) { Item.Loai = (Int32)(rd["MTLVB_Loai"]); } return(Item); }