コード例 #1
0
        public static LoaiDanhMucDonVi Update(LoaiDanhMucDonVi Updated)
        {
            LoaiDanhMucDonVi Item = new LoaiDanhMucDonVi();

            SqlParameter[] obj = new SqlParameter[10];
            obj[0] = new SqlParameter("LDM_ID", Updated.ID);
            obj[1] = new SqlParameter("LDM_Ten", Updated.Ten);
            obj[2] = new SqlParameter("LDM_Ma", Updated.Ma);
            obj[3] = new SqlParameter("LDM_KyHieu", Updated.KyHieu);
            obj[4] = new SqlParameter("LDM_RowId", Updated.RowId);
            obj[5] = new SqlParameter("LDM_NgayTao", Updated.NgayTao);
            obj[6] = new SqlParameter("LDM_NguoiTao", Updated.NguoiTao);
            obj[7] = new SqlParameter("LDM_NgayCapNhat", Updated.NgayCapNhat);
            obj[8] = new SqlParameter("LDM_ThuTu", Updated.ThuTu);
            obj[9] = new SqlParameter("LDM_NguoiSua", Updated.NguoiSua);

            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblLoaiDanhMucDonVi_Update_UpdateNormal_hoangda", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
コード例 #2
0
        public static LoaiDanhMucDonVi SelectById(Int32 LDM_ID)
        {
            LoaiDanhMucDonVi Item = new LoaiDanhMucDonVi();

            SqlParameter[] obj = new SqlParameter[1];
            obj[0] = new SqlParameter("LDM_ID", LDM_ID);
            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblLoaiDanhMucDonVi_Select_SelectById_hoangda", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
コード例 #3
0
        public static LoaiDanhMucDonVi getFromReader(IDataReader rd)
        {
            LoaiDanhMucDonVi Item = new LoaiDanhMucDonVi();

            if (rd.FieldExists("LDM_ID"))
            {
                Item.ID = (Int32)(rd["LDM_ID"]);
            }
            if (rd.FieldExists("LDM_Ten"))
            {
                Item.Ten = (String)(rd["LDM_Ten"]);
            }
            if (rd.FieldExists("LDM_Ma"))
            {
                Item.Ma = (String)(rd["LDM_Ma"]);
            }
            if (rd.FieldExists("LDM_KyHieu"))
            {
                Item.KyHieu = (String)(rd["LDM_KyHieu"]);
            }
            if (rd.FieldExists("LDM_RowId"))
            {
                Item.RowId = (Guid)(rd["LDM_RowId"]);
            }
            if (rd.FieldExists("LDM_NgayTao"))
            {
                Item.NgayTao = (DateTime)(rd["LDM_NgayTao"]);
            }
            if (rd.FieldExists("LDM_NguoiTao"))
            {
                Item.NguoiTao = (String)(rd["LDM_NguoiTao"]);
            }
            if (rd.FieldExists("LDM_NgayCapNhat"))
            {
                Item.NgayCapNhat = (DateTime)(rd["LDM_NgayCapNhat"]);
            }
            if (rd.FieldExists("LDM_ThuTu"))
            {
                Item.ThuTu = (Int32)(rd["LDM_ThuTu"]);
            }
            if (rd.FieldExists("LDM_NguoiSua"))
            {
                Item.NguoiSua = (String)(rd["LDM_NguoiSua"]);
            }
            return(Item);
        }