示例#1
0
        public static VanBanDi getFromReaderTiny(IDataReader rd)
        {
            VanBanDi Item = new VanBanDi();

            Item.ID             = (Int32)(rd["VBD_ID"]);
            Item.SoKyHieuSo     = (String)(rd["VBD_SoKyHieuSo"]);
            Item.SoKyHieuChu    = (String)(rd["VBD_SoKyHieuChu"]);
            Item.NgayVanBan     = (DateTime)(rd["VBD_NgayVanBan"]);
            Item.LoaiVanBan_Ten = (String)(rd["VBD_LoaiVanBan_Ten"]);
            Item.MEM_Ten        = (String)(rd["VBD_MEM_Ten"]);
            return(Item);
        }
示例#2
0
        public static VanBanDi getFromReaderDraff2(IDataReader rd)
        {
            VanBanDi Item = new VanBanDi();

            Item.ID          = (Int32)(rd["VBD_ID"]);
            Item.CapDo_ID    = (Int32)(rd["VBD_CapDo_ID"]);
            Item.RowId       = (Guid)(rd["VBD_RowId"]);
            Item.NguoiTao    = (String)(rd["VBD_NguoiTao"]);
            Item.NguoiSua    = (String)(rd["VBD_NguoiSua"]);
            Item.NgayTao     = (DateTime)(rd["VBD_NgayTao"]);
            Item.NgayCapNhat = (DateTime)(rd["VBD_NgayCapNhat"]);
            return(Item);
        }
示例#3
0
        public static VanBanDi Update(VanBanDi Updated)
        {
            VanBanDi Item = new VanBanDi();

            SqlParameter[] obj = new SqlParameter[28];
            obj[0] = new SqlParameter("VBD_ID", Updated.ID);
            obj[1] = new SqlParameter("VBD_CapDo_ID", Updated.CapDo_ID);
            obj[2] = new SqlParameter("VBD_CapDo_Ten", Updated.CapDo_Ten);
            obj[3] = new SqlParameter("VBD_LoaiVanBan_ID", Updated.LoaiVanBan_ID);
            obj[4] = new SqlParameter("VBD_LoaiVanBan_Ten", Updated.LoaiVanBan_Ten);
            obj[5] = new SqlParameter("VBD_SoKyHieuSo", Updated.SoKyHieuSo);
            obj[6] = new SqlParameter("VBD_SoKyHieuChu", Updated.SoKyHieuChu);
            string htl = string.Format("{0:dd/MM/yy}", Updated.NgayVanBan);

            if (htl != "01/01/01")
            {
                obj[7] = new SqlParameter("VBD_NgayVanBan", Updated.NgayVanBan);
            }
            else
            {
                obj[7] = new SqlParameter("VBD_NgayVanBan", Updated.NgayVanBan);
            }
            obj[8]  = new SqlParameter("VBD_TrichYeu", Updated.TrichYeu);
            obj[9]  = new SqlParameter("VBD_DonViThao_ID", Updated.DonViThao_ID);
            obj[10] = new SqlParameter("VBD_DonViThao_Ten", Updated.DonViThao_Ten);
            obj[11] = new SqlParameter("VBD_TrangThai", Updated.TrangThai);
            obj[12] = new SqlParameter("VBD_NguoiThao", Updated.NguoiThao);
            obj[13] = new SqlParameter("VBD_NoiNhan_ID", Updated.NoiNhan_ID);
            obj[14] = new SqlParameter("VBD_NoiNhan_Ten", Updated.NoiNhan_Ten);
            obj[15] = new SqlParameter("VBD_MEM_ID", Updated.MEM_ID);
            obj[16] = new SqlParameter("VBD_MEM_Ten", Updated.MEM_Ten);
            obj[17] = new SqlParameter("VBD_MEM_Loai", Updated.MEM_Loai);
            obj[18] = new SqlParameter("VBD_SoTrang", Updated.SoTrang);
            obj[19] = new SqlParameter("VBD_GhiChu", Updated.GhiChu);
            obj[21] = new SqlParameter("VBD_VaoSo", Updated.VaoSo);
            obj[22] = new SqlParameter("VBD_RowId", Updated.RowId);
            obj[23] = new SqlParameter("VBD_NguoiTao", Updated.NguoiTao);
            obj[24] = new SqlParameter("VBD_NguoiSua", Updated.NguoiSua);
            obj[25] = new SqlParameter("VBD_NgayTao", Updated.NgayTao);
            obj[26] = new SqlParameter("VBD_NgayCapNhat", Updated.NgayCapNhat);
            obj[27] = new SqlParameter("VBD_MEM_Loai_Ten", Updated.MEM_Loai_Ten);

            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblVanBanDi_Update_UpdateNormal_linhnx", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
示例#4
0
        public static VanBanDi SelectDraffById(Int32 VBD_ID)
        {
            VanBanDi Item = new VanBanDi();

            SqlParameter[] obj = new SqlParameter[1];
            obj[0] = new SqlParameter("VBD_ID", VBD_ID);
            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblVanBanDi_Select_SelectById_linhnx", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
示例#5
0
        public static VanBanDi getFromReaderDraff(IDataReader rd)
        {
            VanBanDi Item = new VanBanDi();

            Item.ID          = (Int32)(rd["VBD_ID"]);
            Item.CapDo_ID    = (Int32)(rd["VBD_CapDo_ID"]);
            Item.RowId       = (Guid)(rd["VBD_RowId"]);
            Item.NguoiTao    = (String)(rd["VBD_NguoiTao"]);
            Item.NguoiSua    = (String)(rd["VBD_NguoiSua"]);
            Item.NgayTao     = (DateTime)(rd["VBD_NgayTao"]);
            Item.NgayCapNhat = (DateTime)(rd["VBD_NgayCapNhat"]);
            Item.TT_So       = (Int32)(rd["VBD_TT_So"]);
            if (rd.FieldExists("VBD_TT_DonVi_So"))
            {
                Item.TT_DonVi_So = (Int32)(rd["VBD_TT_DonVi_So"]);
            }
            return(Item);
        }
示例#6
0
        public static VanBanDi InsertDraff(VanBanDi Inserted)
        {
            VanBanDi Item = new VanBanDi();

            SqlParameter[] obj = new SqlParameter[6];
            obj[0] = new SqlParameter("VBD_RowId", Inserted.RowId);
            obj[1] = new SqlParameter("VBD_NguoiTao", Inserted.NguoiTao);
            obj[2] = new SqlParameter("VBD_NguoiSua", Inserted.NguoiSua);
            obj[3] = new SqlParameter("VBD_NgayTao", Inserted.NgayTao);
            obj[4] = new SqlParameter("VBD_NgayCapNhat", Inserted.NgayCapNhat);
            obj[5] = new SqlParameter("VBD_TT_So", Inserted.TT_So);
            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblVanBanDi_Insert_InsertDraff_hungpm", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReaderDraff(rd);
                }
            }
            return(Item);
        }
示例#7
0
        public static VanBanDi Insert(VanBanDi Inserted)
        {
            VanBanDi Item = new VanBanDi();

            SqlParameter[] obj = new SqlParameter[27];
            obj[0]  = new SqlParameter("VBD_CapDo_ID", Inserted.CapDo_ID);
            obj[1]  = new SqlParameter("VBD_CapDo_Ten", Inserted.CapDo_Ten);
            obj[2]  = new SqlParameter("VBD_LoaiVanBan_ID", Inserted.LoaiVanBan_ID);
            obj[3]  = new SqlParameter("VBD_LoaiVanBan_Ten", Inserted.LoaiVanBan_Ten);
            obj[4]  = new SqlParameter("VBD_SoKyHieuSo", Inserted.SoKyHieuSo);
            obj[5]  = new SqlParameter("VBD_SoKyHieuChu", Inserted.SoKyHieuChu);
            obj[6]  = new SqlParameter("VBD_NgayVanBan", Inserted.NgayVanBan);
            obj[7]  = new SqlParameter("VBD_TrichYeu", Inserted.TrichYeu);
            obj[8]  = new SqlParameter("VBD_DonViThao_ID", Inserted.DonViThao_ID);
            obj[9]  = new SqlParameter("VBD_DonViThao_Ten", Inserted.DonViThao_Ten);
            obj[10] = new SqlParameter("VBD_HanTraLoi", Inserted.HanTraLoi);
            obj[11] = new SqlParameter("VBD_NguoiThao", Inserted.NguoiThao);
            obj[12] = new SqlParameter("VBD_NoiNhan_ID", Inserted.NoiNhan_ID);
            obj[13] = new SqlParameter("VBD_NoiNhan_Ten", Inserted.NoiNhan_Ten);
            obj[14] = new SqlParameter("VBD_MEM_ID", Inserted.MEM_ID);
            obj[15] = new SqlParameter("VBD_MEM_Ten", Inserted.MEM_Ten);
            obj[16] = new SqlParameter("VBD_MEM_Loai", Inserted.MEM_Loai);
            obj[17] = new SqlParameter("VBD_SoTrang", Inserted.SoTrang);
            obj[18] = new SqlParameter("VBD_GhiChu", Inserted.GhiChu);
            obj[20] = new SqlParameter("VBD_VaoSo", Inserted.VaoSo);
            obj[21] = new SqlParameter("VBD_RowId", Inserted.RowId);
            obj[22] = new SqlParameter("VBD_NguoiTao", Inserted.NguoiTao);
            obj[23] = new SqlParameter("VBD_NguoiSua", Inserted.NguoiSua);
            obj[24] = new SqlParameter("VBD_NgayTao", Inserted.NgayTao);
            obj[25] = new SqlParameter("VBD_NgayCapNhat", Inserted.NgayCapNhat);
            obj[26] = new SqlParameter("VBD_MEM_Loai_Ten", Inserted.MEM_Loai_Ten);

            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblVanBanDi_Insert_InsertNormal_linhnx", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
示例#8
0
        public static VanBanDi getFromReaderPager(IDataReader rd)
        {
            VanBanDi Item = new VanBanDi();

            Item.ID               = (Int32)(rd["VBD_ID"]);
            Item.CapDo_Ten        = (String)(rd["VBD_CapDo_Ten"]);
            Item.LoaiVanBan_Ten   = (String)(rd["VBD_LoaiVanBan_Ten"]);
            Item.SoKyHieuSo       = (String)(rd["VBD_SoKyHieuSo"]);
            Item.SoKyHieuChu      = (String)(rd["VBD_SoKyHieuChu"]);
            Item.NgayVanBan       = (DateTime)(rd["VBD_NgayVanBan"]);
            Item.TrichYeu         = (String)(rd["VBD_TrichYeu"]);
            Item.DonViThao_Ten    = (String)(rd["VBD_DonViThao_Ten"]);
            Item.NguoiThao        = (String)(rd["VBD_NguoiThao"]);
            Item.NoiNhan_Ten      = (String)(rd["VBD_NoiNhan_Ten"]);
            Item.MEM_Ten          = (String)(rd["VBD_MEM_Ten"]);
            Item.RowId            = (Guid)(rd["VBD_RowId"]);
            Item.TrangThai        = (byte)(rd["VBD_TrangThai"]);
            Item.NgayVanBan_Thang = (String)(rd["VBD_NgayVanBan_Thang"]);
            Item.NgayVanBan_Tuan  = (String)(rd["VBD_NgayVanBan_Tuan"]);
            return(Item);
        }
示例#9
0
        public static VanBanDi SelectByIdView(Int32 VBD_ID)
        {
            VanBanDi Item = new VanBanDi();

            SqlParameter[] obj = new SqlParameter[1];
            obj[0] = new SqlParameter("VBD_ID", VBD_ID);
            List <Files> filelist = new List <Files>();

            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblVanBanDi_Select_SelectByIdView_linhnx", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                    Files item = new Files();
                    item.Ten      = rd["F_Ten"].ToString();
                    item.ID       = Convert.ToInt32(rd["F_ID"]);
                    item.NguoiTao = rd["F_NguoiTao"].ToString();
                    filelist.Add(item);
                }
            }
            Item.Filelist = filelist;
            return(Item);
        }
示例#10
0
        public static VanBanDi getFromReader(IDataReader rd)
        {
            VanBanDi Item = new VanBanDi();

            if (rd.FieldExists("VBD_ID"))
            {
                Item.ID = (Int32)(rd["VBD_ID"]);
            }
            if (rd.FieldExists("VBD_CapDo_ID"))
            {
                Item.CapDo_ID = (Int32)(rd["VBD_CapDo_ID"]);
            }
            if (rd.FieldExists("VBD_CapDo_Ten"))
            {
                Item.CapDo_Ten = (String)(rd["VBD_CapDo_Ten"]);
            }
            if (rd.FieldExists("VBD_LoaiVanBan_ID"))
            {
                Item.LoaiVanBan_ID = (Int32)(rd["VBD_LoaiVanBan_ID"]);
            }
            if (rd.FieldExists("VBD_LoaiVanBan_Ten"))
            {
                Item.LoaiVanBan_Ten = (String)(rd["VBD_LoaiVanBan_Ten"]);
            }
            if (rd.FieldExists("VBD_SoKyHieuSo"))
            {
                Item.SoKyHieuSo = (String)(rd["VBD_SoKyHieuSo"]);
            }
            if (rd.FieldExists("VBD_SoKyHieuChu"))
            {
                Item.SoKyHieuChu = (String)(rd["VBD_SoKyHieuChu"]);
            }
            if (rd.FieldExists("VBD_NgayVanBan"))
            {
                Item.NgayVanBan = (DateTime)(rd["VBD_NgayVanBan"]);
            }
            if (rd.FieldExists("VBD_TrichYeu"))
            {
                Item.TrichYeu = (String)(rd["VBD_TrichYeu"]);
            }
            if (rd.FieldExists("VBD_DonViThao_ID"))
            {
                Item.DonViThao_ID = (Int32)(rd["VBD_DonViThao_ID"]);
            }
            if (rd.FieldExists("VBD_DonViThao_Ten"))
            {
                Item.DonViThao_Ten = (String)(rd["VBD_DonViThao_Ten"]);
            }
            if (rd.FieldExists("VBD_HanTraLoi"))
            {
                Item.HanTraLoi = (DateTime)(rd["VBD_HanTraLoi"]);
            }
            if (rd.FieldExists("VBD_NguoiThao"))
            {
                Item.NguoiThao = (String)(rd["VBD_NguoiThao"]);
            }
            if (rd.FieldExists("VBD_NoiNhan_ID"))
            {
                Item.NoiNhan_ID = (Int32)(rd["VBD_NoiNhan_ID"]);
            }
            if (rd.FieldExists("VBD_NoiNhan_Ten"))
            {
                Item.NoiNhan_Ten = (String)(rd["VBD_NoiNhan_Ten"]);
            }
            if (rd.FieldExists("VBD_MEM_ID"))
            {
                Item.MEM_ID = (Int32)(rd["VBD_MEM_ID"]);
            }
            if (rd.FieldExists("VBD_MEM_Ten"))
            {
                Item.MEM_Ten = (String)(rd["VBD_MEM_Ten"]);
            }
            if (rd.FieldExists("VBD_MEM_Loai"))
            {
                Item.MEM_Loai = (Int32)(rd["VBD_MEM_Loai"]);
            }
            if (rd.FieldExists("VBD_MEM_Loai_Ten"))
            {
                Item.MEM_Loai_Ten = (String)(rd["VBD_MEM_Loai_Ten"]);
            }
            if (rd.FieldExists("VBD_SoTrang"))
            {
                Item.SoTrang = (Int32)(rd["VBD_SoTrang"]);
            }
            if (rd.FieldExists("VBD_GhiChu"))
            {
                Item.GhiChu = (String)(rd["VBD_GhiChu"]);
            }
            if (rd.FieldExists("VBD_TrangThai"))
            {
                Item.TrangThai = (Byte)(rd["VBD_TrangThai"]);
            }
            if (rd.FieldExists("VBD_VaoSo"))
            {
                Item.VaoSo = (Boolean)(rd["VBD_VaoSo"]);
            }
            if (rd.FieldExists("VBD_RowId"))
            {
                Item.RowId = (Guid)(rd["VBD_RowId"]);
            }
            if (rd.FieldExists("VBD_NguoiTao"))
            {
                Item.NguoiTao = (String)(rd["VBD_NguoiTao"]);
            }
            if (rd.FieldExists("VBD_NguoiSua"))
            {
                Item.NguoiSua = (String)(rd["VBD_NguoiSua"]);
            }
            if (rd.FieldExists("VBD_NgayTao"))
            {
                Item.NgayTao = (DateTime)(rd["VBD_NgayTao"]);
            }
            if (rd.FieldExists("VBD_NgayCapNhat"))
            {
                Item.NgayCapNhat = (DateTime)(rd["VBD_NgayCapNhat"]);
            }
            if (rd.FieldExists("VBD_TT_So"))
            {
                Item.TT_So = (Int32)(rd["VBD_TT_So"]);
            }
            if (rd.FieldExists("VBD_TT_NgayTrinh"))
            {
                Item.TT_NgayTrinh = (DateTime)(rd["VBD_TT_NgayTrinh"]);
            }
            if (rd.FieldExists("VBD_TT_LDVP_NgayTrinh"))
            {
                Item.TT_LDVP_NgayTrinh = (DateTime)(rd["VBD_TT_LDVP_NgayTrinh"]);
            }
            if (rd.FieldExists("VBD_TT_LDVP_YKien"))
            {
                Item.TT_LDVP_YKien = (String)(rd["VBD_TT_LDVP_YKien"]);
            }
            if (rd.FieldExists("VBD_TT_LDVP_ID"))
            {
                Item.TT_LDVP_ID = (Int32)(rd["VBD_TT_LDVP_ID"]);
            }
            if (rd.FieldExists("VBD_TT_LDVP_Username"))
            {
                Item.TT_LDVP_Username = (String)(rd["VBD_TT_LDVP_Username"]);
            }
            if (rd.FieldExists("VBD_TT_LDVP_Ten"))
            {
                Item.TT_LDVP_Ten = (String)(rd["VBD_TT_LDVP_Ten"]);
            }
            if (rd.FieldExists("VBD_TT_LDVP_Loai_Ten"))
            {
                Item.TT_LDVP_Loai_Ten = (String)(rd["VBD_TT_LDVP_Loai_Ten"]);
            }
            if (rd.FieldExists("VBD_TT_LDB_NgayTrinh"))
            {
                Item.TT_LDB_NgayTrinh = (DateTime)(rd["VBD_TT_LDB_NgayTrinh"]);
            }
            if (rd.FieldExists("VBD_TT_LDB_YKien"))
            {
                Item.TT_LDB_YKien = (String)(rd["VBD_TT_LDB_YKien"]);
            }
            if (rd.FieldExists("VBD_TT_LDB_ID"))
            {
                Item.TT_LDB_ID = (Int32)(rd["VBD_TT_LDB_ID"]);
            }
            if (rd.FieldExists("VBD_TT_LDB_Username"))
            {
                Item.TT_LDB_Username = (String)(rd["VBD_TT_LDB_Username"]);
            }
            if (rd.FieldExists("VBD_TT_LDB_Ten"))
            {
                Item.TT_LDB_Ten = (String)(rd["VBD_TT_LDB_Ten"]);
            }
            if (rd.FieldExists("VBD_TT_LDB_Loai_Ten"))
            {
                Item.TT_LDB_Loai_Ten = (String)(rd["VBD_TT_LDB_Loai_Ten"]);
            }
            if (rd.FieldExists("VBD_TT_LDB_NgayKy"))
            {
                Item.TT_LDB_NgayKy = (DateTime)(rd["VBD_TT_LDB_NgayKy"]);
            }
            if (rd.FieldExists("VBD_TT_NgayChuyenPhatHanh"))
            {
                Item.TT_NgayChuyenPhatHanh = (DateTime)(rd["VBD_TT_NgayChuyenPhatHanh"]);
            }
            if (rd.FieldExists("VBD_TT_LyDoTraLai"))
            {
                Item.TT_LyDoTraLai = (String)(rd["VBD_TT_LyDoTraLai"]);
            }
            if (rd.FieldExists("VBD_TT_NgayTraLai"))
            {
                Item.TT_NgayTraLai = (DateTime)(rd["VBD_TT_NgayTraLai"]);
            }
            if (rd.FieldExists("VBD_NgayVanBan_Tuan"))
            {
                Item.NgayVanBan_Tuan = (String)(rd["VBD_NgayVanBan_Tuan"]);
            }
            if (rd.FieldExists("VBD_NgayVanBan_Thang"))
            {
                Item.NgayVanBan_Thang = (String)(rd["VBD_NgayVanBan_Thang"]);
            }
            return(Item);
        }