Exemplo n.º 1
0
        public static DanhMucDonVi Insert(DanhMucDonVi Inserted)
        {
            DanhMucDonVi Item = new DanhMucDonVi();

            SqlParameter[] obj = new SqlParameter[12];
            obj[0]  = new SqlParameter("DM_LDM_Ma", Inserted.LDM_Ma);
            obj[1]  = new SqlParameter("DM_LDM_ID", Inserted.LDM_ID);
            obj[2]  = new SqlParameter("DM_Ten", Inserted.Ten);
            obj[3]  = new SqlParameter("DM_KyHieu", Inserted.KyHieu);
            obj[4]  = new SqlParameter("DM_Ma", Inserted.Ma);
            obj[5]  = new SqlParameter("DM_RowId", Inserted.RowId);
            obj[6]  = new SqlParameter("DM_NgayTao", Inserted.NgayTao);
            obj[7]  = new SqlParameter("DM_NguoiTao", Inserted.NguoiTao);
            obj[8]  = new SqlParameter("DM_NgayCapNhat", Inserted.NgayCapNhat);
            obj[9]  = new SqlParameter("DM_GiaTri", Inserted.GiaTri);
            obj[10] = new SqlParameter("DM_ThuTu", Inserted.ThuTu);
            obj[11] = new SqlParameter("DM_NguoiSua", Inserted.NguoiSua);

            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblDanhMucDonVi_Insert_InsertNormal_hoangda", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
Exemplo n.º 2
0
        public static DanhMucDonVi getFromReaderNoiGuiListDmGiaTri(IDataReader rd)
        {
            DanhMucDonVi Item = new DanhMucDonVi();

            Item.Ten    = (String)(rd["DM_Ten"]);
            Item.GiaTri = (String)(rd["DM_GiaTri"]);
            return(Item);
        }
Exemplo n.º 3
0
        //sp_tblDanhMucDonVi_Pager_Normal_hoangda
        #region Utilities
        public static DanhMucDonVi getFromReaderNoiGuiDm(IDataReader rd)
        {
            DanhMucDonVi Item = new DanhMucDonVi();

            Item.ID       = (Int32)(rd["DM_ID"]);
            Item.Ten      = (String)(rd["DM_Ten"]);
            Item.KyHieu   = (String)(rd["DM_KyHieu"]);
            Item.Ma       = (String)(rd["DM_Ma"]);
            Item.RowId    = (Guid)(rd["DM_RowId"]);
            Item.NguoiTao = (String)(rd["DM_NguoiTao"]);
            Item.GiaTri   = (String)(rd["DM_GiaTri"]);
            Item.ThuTu    = (Int32)(rd["DM_ThuTu"]);
            Item.NguoiSua = (String)(rd["DM_NguoiSua"]);
            return(Item);
        }
Exemplo n.º 4
0
        public static DanhMucDonVi SelectById(Int32 DM_ID)
        {
            DanhMucDonVi Item = new DanhMucDonVi();

            SqlParameter[] obj = new SqlParameter[1];
            obj[0] = new SqlParameter("DM_ID", DM_ID);
            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblDanhMucDonVi_Select_SelectById_hoangda", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
Exemplo n.º 5
0
        public static DanhMucDonVi QuickSave(string Ten, string KyHieu, string LDM_Ma)
        {
            DanhMucDonVi Item = new DanhMucDonVi();

            SqlParameter[] obj = new SqlParameter[3];
            obj[0] = new SqlParameter("Ten", Ten);
            obj[1] = new SqlParameter("KyHieu", KyHieu);
            obj[2] = new SqlParameter("LDM_Ma", LDM_Ma);
            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblDanhMucDonVi_Insert_QuickSave_linhnx", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
Exemplo n.º 6
0
        public static DanhMucDonVi getFromReader(IDataReader rd)
        {
            DanhMucDonVi Item = new DanhMucDonVi();

            if (rd.FieldExists("DM_ID"))
            {
                Item.ID = (Int32)(rd["DM_ID"]);
            }
            if (rd.FieldExists("DM_LDM_ID"))
            {
                Item.LDM_ID = (Int32)(rd["DM_LDM_ID"]);
            }
            if (rd.FieldExists("DM_LDM_Ma"))
            {
                Item.LDM_Ma = (String)(rd["DM_LDM_Ma"]);
            }
            if (rd.FieldExists("LDM_Ten"))
            {
                Item.LDM_Ten = (String)(rd["LDM_Ten"]);
            }
            if (rd.FieldExists("DM_Ten"))
            {
                Item.Ten = (String)(rd["DM_Ten"]);
            }
            if (rd.FieldExists("DM_KyHieu"))
            {
                Item.KyHieu = (String)(rd["DM_KyHieu"]);
            }
            if (rd.FieldExists("DM_Ma"))
            {
                Item.Ma = (String)(rd["DM_Ma"]);
            }
            if (rd.FieldExists("DM_RowId"))
            {
                Item.RowId = (Guid)(rd["DM_RowId"]);
            }
            if (rd.FieldExists("DM_NgayTao"))
            {
                Item.NgayTao = (DateTime)(rd["DM_NgayTao"]);
            }
            if (rd.FieldExists("DM_NguoiTao"))
            {
                Item.NguoiTao = (String)(rd["DM_NguoiTao"]);
            }
            if (rd.FieldExists("DM_NgayCapNhat"))
            {
                Item.NgayCapNhat = (DateTime)(rd["DM_NgayCapNhat"]);
            }
            if (rd.FieldExists("DM_GiaTri"))
            {
                Item.GiaTri = (String)(rd["DM_GiaTri"]);
            }
            if (rd.FieldExists("DM_ThuTu"))
            {
                Item.ThuTu = (Int32)(rd["DM_ThuTu"]);
            }
            if (rd.FieldExists("DM_NguoiSua"))
            {
                Item.NguoiSua = (String)(rd["DM_NguoiSua"]);
            }
            return(Item);
        }