Exemple #1
0
        public static LinhVuc SelectById(Int32 LV_ID)
        {
            LinhVuc Item = new LinhVuc();

            SqlParameter[] obj = new SqlParameter[1];
            obj[0] = new SqlParameter("LV_ID", LV_ID);
            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblLinhVuc_Select_SelectById_linhnx", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
Exemple #2
0
        public static LinhVuc getFromReader(IDataReader rd)
        {
            LinhVuc Item = new LinhVuc();

            if (rd.FieldExists("LV_ID"))
            {
                Item.ID = (Int32)(rd["LV_ID"]);
            }
            if (rd.FieldExists("LV_Ten"))
            {
                Item.Ten = (String)(rd["LV_Ten"]);
            }
            if (rd.FieldExists("LV_RowId"))
            {
                Item.RowId = (Guid)(rd["LV_RowId"]);
            }
            if (rd.FieldExists("LV_NguoiTao"))
            {
                Item.NguoiTao = (String)(rd["LV_NguoiTao"]);
            }
            if (rd.FieldExists("LV_NguoiCapNhat"))
            {
                Item.NguoiCapNhat = (String)(rd["LV_NguoiCapNhat"]);
            }
            if (rd.FieldExists("LV_NgayTao"))
            {
                Item.NgayTao = (DateTime)(rd["LV_NgayTao"]);
            }
            if (rd.FieldExists("LV_NgayCapNhat"))
            {
                Item.NgayCapNhat = (DateTime)(rd["LV_NgayCapNhat"]);
            }
            if (rd.FieldExists("LV_ThuTu"))
            {
                Item.ThuTu = (Int32)(rd["LV_ThuTu"]);
            }
            if (rd.FieldExists("LV_Ma"))
            {
                Item.Ma = (String)(rd["LV_Ma"]);
            }
            if (rd.FieldExists("LV_KyHieu"))
            {
                Item.KyHieu = (String)(rd["LV_KyHieu"]);
            }
            return(Item);
        }