コード例 #1
0
        public static bool delete_PRO_BangKhaiNhanSu(AppEntities db, int ID, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_PRO_BangKhaiNhanSu.Find(ID);

            if (dbitem != null)
            {
                db.tbl_PRO_BangKhaiNhanSu.Remove(dbitem);


                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "DTO_PRO_BangKhaiNhanSu", DateTime.Now, Username);



                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("delete_PRO_BangKhaiNhanSu", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #2
0
        public static DTO_CUS_SYS_PermissionList post_CUS_SYS_PermissionList(AppEntities db, int PartnerID, DTO_CUS_SYS_PermissionList item, string Username)
        {
            tbl_CUS_SYS_PermissionList dbitem = new tbl_CUS_SYS_PermissionList();

            if (item != null)
            {
                dbitem.IDRole  = item.IDRole;
                dbitem.IDForm  = item.IDForm;
                dbitem.Value   = item.Value;
                dbitem.Visible = item.Visible;

                dbitem.IDPartner = PartnerID;


                try
                {
                    db.tbl_CUS_SYS_PermissionList.Add(dbitem);
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, dbitem.IDPartner, "DTO_CUS_SYS_PermissionList", DateTime.Now, Username);



                    item.ID = dbitem.ID;

                    item.IDPartner = dbitem.IDPartner;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("post_CUS_SYS_PermissionList", e);
                    item = null;
                }
            }
            return(item);
        }
コード例 #3
0
        public static bool put_SYS_Var(AppEntities db, int ID, DTO_SYS_Var item, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_SYS_Var.Find(ID);

            if (dbitem != null)
            {
                dbitem.Code       = item.Code;
                dbitem.ValueOfVar = item.ValueOfVar;
                dbitem.TypeOfVar  = item.TypeOfVar;

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;

                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "DTO_SYS_Var", DateTime.Now, Username);

                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("put_SYS_Var", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #4
0
        public static bool put_CUS_SYS_PermissionListDetailData(AppEntities db, int PartnerID, int ID, DTO_CUS_SYS_PermissionListDetailData item, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_CUS_SYS_PermissionListDetailData.Find(ID);

            if (dbitem != null)
            {
                dbitem.IDPermission = item.IDPermission;
                dbitem.Type         = item.Type;
                dbitem.Value        = item.Value;
                dbitem.Sort         = item.Sort;
                dbitem.IsDisabled   = item.IsDisabled;
                dbitem.IsDeleted    = item.IsDeleted;

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;

                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, dbitem.IDPartner, "DTO_CUS_SYS_PermissionListDetailData", dbitem.ModifiedDate, Username);


                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("put_CUS_SYS_PermissionListDetailData", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #5
0
        public static string delete_CUS_DOC_FolderCustom(AppEntities db, int ID, string Username)
        {
            string result = string.Empty;
            var    dbitem = db.tbl_CUS_DOC_Folder.Find(ID);

            if (dbitem != null)
            {
                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;
                dbitem.IsDeleted    = true;

                if (dbitem.IDLinhVuc > 0)
                {
                    result = "Không được xóa thư mục Lĩnh vực";
                }

                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, dbitem.IDPartner, "DTO_CUS_DOC_Folder", dbitem.ModifiedDate, Username);
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("delete_CUS_DOC_Folder", e);
                    result = e.InnerException.Message;
                }
            }
            return(result);
        }
コード例 #6
0
        public static DTO_PRO_BenhNhan save_PRO_BenhNhan(AppEntities db, DTO_PRO_BenhNhan item, string Username)
        {
            tbl_PRO_BenhNhan dbitem = new tbl_PRO_BenhNhan();

            if (item != null)
            {
                tbl_CUS_HRM_BenhNhan dbitem1 = new tbl_CUS_HRM_BenhNhan();
                dbitem1.MaBenhNhan = item.MaBenhNhan;
                dbitem1.HoTen      = item.MaBenhNhan;
                dbitem1.GioiTinh   = item.GioiTinh;
                dbitem1.IsDisabled = item.IsDisabled;
                dbitem1.IsDeleted  = item.IsDeleted;

                dbitem1.CreatedBy   = Username;
                dbitem1.CreatedDate = DateTime.Now;

                dbitem1.ModifiedBy   = Username;
                dbitem1.ModifiedDate = DateTime.Now;

                db.tbl_CUS_HRM_BenhNhan.Add(dbitem1);
                db.SaveChanges();

                BS_CUS_Version.update_CUS_Version(db, null, "DTO_CUS_HRM_BenhNhan", DateTime.Now, Username);

                dbitem.IDDeTai    = item.IDDeTai;
                dbitem.IDBenhNhan = dbitem1.ID;
                dbitem.IsDisabled = item.IsDisabled;
                dbitem.IsDeleted  = item.IsDeleted;

                dbitem.CreatedBy   = Username;
                dbitem.CreatedDate = DateTime.Now;

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;


                try
                {
                    db.tbl_PRO_BenhNhan.Add(dbitem);
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "DTO_PRO_BenhNhan", DateTime.Now, Username);


                    item.ID = dbitem.ID;

                    item.CreatedBy   = dbitem.CreatedBy;
                    item.CreatedDate = dbitem.CreatedDate;

                    item.ModifiedBy   = dbitem.ModifiedBy;
                    item.ModifiedDate = dbitem.ModifiedDate;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("post_PRO_BenhNhan", e);
                    item = null;
                }
            }
            return(item);
        }
コード例 #7
0
        public static bool put_CAT_BangGiaKinhPhi(AppEntities db, int ID, DTO_CAT_BangGiaKinhPhi item, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_CAT_BangGiaKinhPhi.Find(ID);

            if (dbitem != null)
            {
                dbitem.IDKinhPhi   = item.IDKinhPhi;
                dbitem.NgayHieuLuc = item.NgayHieuLuc;
                dbitem.Gia         = item.Gia;
                dbitem.IsDisabled  = item.IsDisabled;
                dbitem.IsDeleted   = item.IsDeleted;

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;

                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "DTO_CAT_BangGiaKinhPhi", DateTime.Now, Username);

                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("put_CAT_BangGiaKinhPhi", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #8
0
        public static bool delete_CUS_SYS_PermissionList(AppEntities db, int ID, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_CUS_SYS_PermissionList.Find(ID);

            if (dbitem != null)
            {
                db.tbl_CUS_SYS_PermissionList.Remove(dbitem);


                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, dbitem.IDPartner, "DTO_CUS_SYS_PermissionList", DateTime.Now, Username);



                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("delete_CUS_SYS_PermissionList", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #9
0
        public static bool delete_PAR_DonHang(AppEntities db, int ID, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_PAR_DonHang.Find(ID);

            if (dbitem != null)
            {
                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;
                dbitem.IsDeleted    = true;


                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, dbitem.IDPartner, "DTO_PAR_DonHang", dbitem.ModifiedDate, Username);



                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("delete_PAR_DonHang", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #10
0
        public static bool uploadFullText_PRO_HoiNghiHoiThao(AppEntities db, int ID, string path, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_PRO_HoiNghiHoiThao.Find(ID);

            if (dbitem != null)
            {
                dbitem.BaiFulltext  = path;
                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;

                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "DTO_PRO_HoiNghiHoiThao", DateTime.Now, Username);

                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("uploadFullText_PRO_HoiNghiHoiThao", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #11
0
        public static bool put_CUS_HRM_LIST_ChucDanh(AppEntities db, int PartnerID, int ID, DTO_CUS_HRM_LIST_ChucDanh item, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_CUS_HRM_LIST_ChucDanh.Find(ID);

            if (dbitem != null)
            {
                dbitem.IDBoPhan   = item.IDBoPhan;
                dbitem.Code       = item.Code;
                dbitem.Name       = item.Name;
                dbitem.Remark     = item.Remark;
                dbitem.IsDisabled = item.IsDisabled;
                dbitem.Sort       = item.Sort;
                dbitem.IsDeleted  = item.IsDeleted;

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;

                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, dbitem.IDPartner, "DTO_CUS_HRM_LIST_ChucDanh", dbitem.ModifiedDate, Username);


                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("put_CUS_HRM_LIST_ChucDanh", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #12
0
        public static bool put_PRO_HoiNghiHoiThaoCustom(AppEntities db, int ID, DTO_PRO_HoiNghiHoiThao item, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_PRO_HoiNghiHoiThao.Find(ID);

            if (dbitem != null)
            {
                dbitem.ThoiGian       = item.ThoiGian;
                dbitem.ThoiGianHetHan = item.ThoiGianHetHan;
                dbitem.DiaDiem        = item.DiaDiem;
                dbitem.TenHoiNghi     = item.TenHoiNghi;
                dbitem.IDSite         = item.IDSite;
                dbitem.IsDisabled     = item.IsDisabled;
                dbitem.IsDeleted      = item.IsDeleted;

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;

                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "DTO_PRO_HoiNghiHoiThao", DateTime.Now, Username);

                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("put_PRO_HoiNghiHoiThaoCustom", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #13
0
ファイル: tbl_CAT_Tags.cs プロジェクト: CodeArt-VN/IVFMD-NCKH
        public static bool put_CAT_Tags(AppEntities db, int ID, DTO_CAT_Tags item, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_CAT_Tags.Find(ID);

            if (dbitem != null)
            {
                dbitem.TenTag     = item.TenTag;
                dbitem.GhiChu     = item.GhiChu;
                dbitem.IsDisabled = item.IsDisabled;
                dbitem.IsDeleted  = item.IsDeleted;

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;

                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "DTO_CAT_Tags", DateTime.Now, Username);

                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("put_CAT_Tags", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #14
0
        public static bool put_WEB_BaiViet_DanhMuc(AppEntities db, int ID, DTO_WEB_BaiViet_DanhMuc item, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_WEB_BaiViet_DanhMuc.Find(ID);

            if (dbitem != null)
            {
                dbitem.IDDanhMuc  = item.IDDanhMuc;
                dbitem.IDBaiViet  = item.IDBaiViet;
                dbitem.URL        = item.URL;
                dbitem.Sort       = item.Sort;
                dbitem.IsDisabled = item.IsDisabled;
                dbitem.IsDeleted  = item.IsDeleted;

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;

                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "DTO_WEB_BaiViet_DanhMuc", dbitem.ModifiedDate, Username);

                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("put_WEB_BaiViet_DanhMuc", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #15
0
        public static bool put_PRO_BenhNhanCustom(AppEntities db, int ID, DTO_PRO_BenhNhan item, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_PRO_BenhNhan.Find(ID);

            if (dbitem != null)
            {
                var benhnhan = db.tbl_CUS_HRM_BenhNhan.FirstOrDefault(c => c.ID == dbitem.IDBenhNhan);
                if (benhnhan != null)
                {
                    benhnhan.MaBenhNhan = item.MaBenhNhan;
                    benhnhan.GioiTinh   = item.GioiTinh;
                }

                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "DTO_PRO_BenhNhan", DateTime.Now, Username);

                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("put_PRO_BenhNhan", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #16
0
        public static bool put_PRO_BenhNhan(AppEntities db, int ID, DTO_PRO_BenhNhan item, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_PRO_BenhNhan.Find(ID);

            if (dbitem != null)
            {
                dbitem.IDDeTai    = item.IDDeTai;
                dbitem.IDBenhNhan = item.IDBenhNhan;
                dbitem.IsDisabled = item.IsDisabled;
                dbitem.IsDeleted  = item.IsDeleted;

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;

                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "DTO_PRO_BenhNhan", DateTime.Now, Username);

                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("put_PRO_BenhNhan", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #17
0
        public static bool delete_CUS_HRM_STAFF_NhanSu_HOSREM(AppEntities db, int ID, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_CUS_HRM_STAFF_NhanSu_HOSREM.Find(ID);

            if (dbitem != null)
            {
                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;
                dbitem.IsDeleted    = true;


                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "DTO_CUS_HRM_STAFF_NhanSu_HOSREM", DateTime.Now, Username);



                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("delete_CUS_HRM_STAFF_NhanSu_HOSREM", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #18
0
        public static bool uploadFileThuyetMinh(AppEntities db, int deTaiId, string path, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_PRO_ThuyetMinhDeTai.FirstOrDefault(c => c.IDDeTai == deTaiId);

            if (dbitem == null)
            {
                dbitem             = new tbl_PRO_ThuyetMinhDeTai();
                dbitem.IDDeTai     = deTaiId;
                dbitem.CreatedBy   = Username;
                dbitem.CreatedDate = DateTime.Now;
                db.tbl_PRO_ThuyetMinhDeTai.Add(dbitem);
            }
            if (dbitem != null)
            {
                dbitem.FileThuyetMinh = path;
                dbitem.ModifiedBy     = Username;
                dbitem.ModifiedDate   = DateTime.Now;

                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "tbl_PRO_ThuyetMinhDeTai", DateTime.Now, Username);

                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("uploadFileThuyetMinh", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #19
0
        public static bool put_SYS_Config(AppEntities db, int ID, DTO_SYS_Config item, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_SYS_Config.Find(ID);

            if (dbitem != null)
            {
                dbitem.Code       = item.Code;
                dbitem.Name       = item.Name;
                dbitem.Remark     = item.Remark;
                dbitem.Sort       = item.Sort;
                dbitem.IsDisabled = item.IsDisabled;
                dbitem.IsDeleted  = item.IsDeleted;
                dbitem.Value      = item.Value;

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;

                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "DTO_SYS_Config", dbitem.ModifiedDate, Username);

                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("put_SYS_Config", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #20
0
        public static bool put_PRO_HoiNghiHoiThao_DangKy(AppEntities db, int ID, DTO_PRO_HoiNghiHoiThao_DangKy item, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_PRO_HoiNghiHoiThao_DangKy.Find(ID);

            if (dbitem != null)
            {
                dbitem.IDNhanVien       = item.IDNhanVien;
                dbitem.IDHoiNghiHoiThao = item.IDHoiNghiHoiThao;

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;

                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "DTO_PRO_HoiNghiHoiThao_DangKy", DateTime.Now, Username);

                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("put_PRO_HoiNghiHoiThao_DangKy", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #21
0
        public static bool put_PRO_HoiNghiHoiThao_DangKyDeTai(AppEntities db, int ID, DTO_PRO_HoiNghiHoiThao_DangKyDeTai item, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_PRO_HoiNghiHoiThao_DangKyDeTai.Find(ID);

            if (dbitem != null)
            {
                dbitem.IDDangKy         = item.IDDangKy;
                dbitem.IDHoiNghiHoiThao = item.IDHoiNghiHoiThao;
                dbitem.IDHinhThucDangKy = item.IDHinhThucDangKy;
                dbitem.IDTrangThai      = item.IDTrangThai;
                dbitem.TenDeTai         = item.TenDeTai;
                dbitem.BaiAbstract      = item.BaiAbstract;
                dbitem.BaiFulltext      = item.BaiFulltext;

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;

                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "DTO_PRO_HoiNghiHoiThao_DangKyDeTai", DateTime.Now, Username);

                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("put_PRO_HoiNghiHoiThao_DangKyDeTai", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #22
0
        public static bool put_CUS_DOC_File_Permission(AppEntities db, int PartnerID, int ID, DTO_CUS_DOC_File_Permission item, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_CUS_DOC_File_Permission.Find(ID);

            if (dbitem != null)
            {
                dbitem.IDFile       = item.IDFile;
                dbitem.IDRole       = item.IDRole;
                dbitem.IsDisabled   = item.IsDisabled;
                dbitem.IsDeleted    = item.IsDeleted;
                dbitem.IsCanView    = item.IsCanView;
                dbitem.IsCanChange  = item.IsCanChange;
                dbitem.IsCanApprove = item.IsCanApprove;

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;

                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, dbitem.IDPartner, "DTO_CUS_DOC_File_Permission", dbitem.ModifiedDate, Username);


                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("put_CUS_DOC_File_Permission", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #23
0
        public static DTO_PRO_SYLL update_PRO_SYLL(AppEntities db, DTO_PRO_SYLL item, string Username)
        {
            var dbitem = db.tbl_PRO_SYLL.Find(item.ID);

            if (dbitem == null)
            {
                dbitem             = new tbl_PRO_SYLL();
                dbitem.CreatedBy   = Username;
                dbitem.CreatedDate = DateTime.Now;
                dbitem.IDDetai     = item.IDDetai;
                dbitem.IDNhanSu    = item.IDNhanSu;
                db.tbl_PRO_SYLL.Add(dbitem);
            }

            var objHRM_SYLL = db.tbl_CUS_HRM_STAFF_NhanSu_SYLL.FirstOrDefault(c => c.IDNhanSu == item.IDNhanSu);

            if (objHRM_SYLL != null)
            {
                int        id         = dbitem.ID;
                CopyHelper copyHelper = new CopyHelper();
                copyHelper.Copy(objHRM_SYLL, dbitem);
                dbitem.ID = id;
            }
            dbitem.IDDetai    = item.IDDetai;
            dbitem.IDNhanSu   = item.IDNhanSu;
            dbitem.IsDisabled = item.IsDisabled;
            dbitem.IsDeleted  = item.IsDeleted;

            dbitem.ModifiedBy   = Username;
            dbitem.ModifiedDate = DateTime.Now;

            try
            {
                db.SaveChanges();

                var detai = db.tbl_PRO_DeTai.FirstOrDefault(c => c.ID == dbitem.IDDetai);
                if (detai != null)
                {
                    if (detai.IDNCV == dbitem.IDNhanSu)
                    {
                        BS_HelperReference.PRO_SYLL_NCV_Update(db, dbitem.IDDetai, dbitem.IDNhanSu);
                    }
                }

                BS_CUS_Version.update_CUS_Version(db, null, "DTO_PRO_SYLL", DateTime.Now, Username);
                item.ID          = dbitem.ID;
                item.CreatedBy   = dbitem.CreatedBy;
                item.CreatedDate = dbitem.CreatedDate;

                item.ModifiedBy   = dbitem.ModifiedBy;
                item.ModifiedDate = dbitem.ModifiedDate;
                return(item);
            }
            catch (DbEntityValidationException e)
            {
                errorLog.logMessage("save_PRO_SYLL", e);
                return(null);
            }
        }
コード例 #24
0
        public static DTO_CUS_HRM_STAFF_NhanSu post_CUS_HRM_STAFF_NhanSu(AppEntities db, int PartnerID, DTO_CUS_HRM_STAFF_NhanSu item, string Username)
        {
            tbl_CUS_HRM_STAFF_NhanSu dbitem = new tbl_CUS_HRM_STAFF_NhanSu();

            if (item != null)
            {
                dbitem.IDChucDanh  = item.IDChucDanh;
                dbitem.IDBoPhan    = item.IDBoPhan;
                dbitem.IDRole      = item.IDRole;
                dbitem.Code        = item.Code;
                dbitem.Name        = item.Name;
                dbitem.Remark      = item.Remark;
                dbitem.Sort        = item.Sort;
                dbitem.IsDisabled  = item.IsDisabled;
                dbitem.IsDeleted   = item.IsDeleted;
                dbitem.Ten         = item.Ten;
                dbitem.Ho          = item.Ho;
                dbitem.Email       = item.Email;
                dbitem.SoDienThoai = item.SoDienThoai;
                dbitem.DiaChi      = item.DiaChi;
                dbitem.IsHRCO      = item.IsHRCO;
                dbitem.IsCNDT      = item.IsCNDT;

                dbitem.CreatedBy   = Username;
                dbitem.CreatedDate = DateTime.Now;

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;

                dbitem.IDPartner = PartnerID;


                try
                {
                    db.tbl_CUS_HRM_STAFF_NhanSu.Add(dbitem);
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, dbitem.IDPartner, "DTO_CUS_HRM_STAFF_NhanSu", dbitem.ModifiedDate, Username);



                    item.ID = dbitem.ID;

                    item.CreatedBy   = dbitem.CreatedBy;
                    item.CreatedDate = dbitem.CreatedDate;

                    item.ModifiedBy   = dbitem.ModifiedBy;
                    item.ModifiedDate = dbitem.ModifiedDate;

                    item.IDPartner = dbitem.IDPartner;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("post_CUS_HRM_STAFF_NhanSu", e);
                    item = null;
                }
            }
            return(item);
        }
コード例 #25
0
        public static bool put_PRO_DonXinDanhGiaDaoDuc(AppEntities db, int ID, DTO_PRO_DonXinDanhGiaDaoDuc item, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_PRO_DonXinDanhGiaDaoDuc.Find(ID);

            if (dbitem != null)
            {
                dbitem.IDDeTai                     = item.IDDeTai;
                dbitem.HoTenChuNhiem               = item.HoTenChuNhiem;
                dbitem.DonVi                       = item.DonVi;
                dbitem.DiaChi                      = item.DiaChi;
                dbitem.DienThoai                   = item.DienThoai;
                dbitem.TenDeTai                    = item.TenDeTai;
                dbitem.TenDonViChuTri              = item.TenDonViChuTri;
                dbitem.DiaChiDonVi                 = item.DiaChiDonVi;
                dbitem.DienThoaiDonVi              = item.DienThoaiDonVi;
                dbitem.DiaDiemNghienCuu            = item.DiaDiemNghienCuu;
                dbitem.ThoiGianNghienCuu           = item.ThoiGianNghienCuu;
                dbitem.TuNgay                      = item.TuNgay;
                dbitem.DenNgay                     = item.DenNgay;
                dbitem.BangKiemLuaChon             = item.BangKiemLuaChon;
                dbitem.PhieuThongTinXemXet         = item.PhieuThongTinXemXet;
                dbitem.DeCuongNCYSH                = item.DeCuongNCYSH;
                dbitem.CacBangCauHoi               = item.CacBangCauHoi;
                dbitem.MauPhieuChapThuanTinhNguyen = item.MauPhieuChapThuanTinhNguyen;
                dbitem.TrangThongTinGioiThieu      = item.TrangThongTinGioiThieu;
                dbitem.SYLLChuNhiem                = item.SYLLChuNhiem;
                dbitem.GiayToKhac                  = item.GiayToKhac;
                dbitem.GhiChuGiayToKhac            = item.GhiChuGiayToKhac;
                dbitem.HTML                  = item.HTML;
                dbitem.IsDisabled            = item.IsDisabled;
                dbitem.IsDeleted             = item.IsDeleted;
                dbitem.NgayKy_Ngay           = item.NgayKy_Ngay;
                dbitem.NgayKy_Thang          = item.NgayKy_Thang;
                dbitem.NgayKy_Nam            = item.NgayKy_Nam;
                dbitem.NgayKy_ChuKy          = item.NgayKy_ChuKy;
                dbitem.FormConfig            = item.FormConfig;
                dbitem.NgayKy_ChuKyThuTruong = item.NgayKy_ChuKyThuTruong;

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;

                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "DTO_PRO_DonXinDanhGiaDaoDuc", DateTime.Now, Username);

                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("put_PRO_DonXinDanhGiaDaoDuc", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #26
0
        public static DTO_PAR_DonHang post_PAR_DonHang(AppEntities db, int PartnerID, DTO_PAR_DonHang item, string Username)
        {
            tbl_PAR_DonHang dbitem = new tbl_PAR_DonHang();

            if (item != null)
            {
                dbitem.IDLoaiKhachHang = item.IDLoaiKhachHang;
                dbitem.IDTinhTrang     = item.IDTinhTrang;
                dbitem.IDLoaiDonHang   = item.IDLoaiDonHang;
                dbitem.Code            = item.Code;
                dbitem.Name            = item.Name;
                dbitem.Remark          = item.Remark;
                dbitem.Sort            = item.Sort;
                dbitem.IsDisabled      = item.IsDisabled;
                dbitem.IsDeleted       = item.IsDeleted;
                dbitem.NgayMua         = item.NgayMua;
                dbitem.TongCong        = item.TongCong;
                dbitem.Thue            = item.Thue;
                dbitem.ChietKhau       = item.ChietKhau;
                dbitem.MaGiamGia       = item.MaGiamGia;
                dbitem.ThanhTien       = item.ThanhTien;

                dbitem.CreatedBy   = Username;
                dbitem.CreatedDate = DateTime.Now;

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;

                dbitem.IDPartner = PartnerID;


                try
                {
                    db.tbl_PAR_DonHang.Add(dbitem);
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, dbitem.IDPartner, "DTO_PAR_DonHang", dbitem.ModifiedDate, Username);



                    item.ID = dbitem.ID;

                    item.CreatedBy   = dbitem.CreatedBy;
                    item.CreatedDate = dbitem.CreatedDate;

                    item.ModifiedBy   = dbitem.ModifiedBy;
                    item.ModifiedDate = dbitem.ModifiedDate;

                    item.IDPartner = dbitem.IDPartner;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("post_PAR_DonHang", e);
                    item = null;
                }
            }
            return(item);
        }
コード例 #27
0
        public static DTO_CUS_DOC_File post_CUS_DOC_File(AppEntities db, int PartnerID, DTO_CUS_DOC_File item, string Username)
        {
            tbl_CUS_DOC_File dbitem = new tbl_CUS_DOC_File();

            if (item != null)
            {
                dbitem.Code         = item.Code;
                dbitem.Name         = item.Name;
                dbitem.Remark       = item.Remark;
                dbitem.Sort         = item.Sort;
                dbitem.IsDisabled   = item.IsDisabled;
                dbitem.IsDeleted    = item.IsDeleted;
                dbitem.Path         = item.Path;
                dbitem.Extension    = item.Extension;
                dbitem.IsApproved   = item.IsApproved;
                dbitem.ApprovedBy   = item.ApprovedBy;
                dbitem.ApprovedDate = item.ApprovedDate;
                dbitem.FileSize     = item.FileSize;
                dbitem.FileVersion  = item.FileVersion;
                dbitem.IDDeTai      = item.IDDeTai;
                dbitem.IsHidden     = item.IsHidden;

                dbitem.CreatedBy   = Username;
                dbitem.CreatedDate = DateTime.Now;

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;

                dbitem.IDPartner = PartnerID;


                try
                {
                    db.tbl_CUS_DOC_File.Add(dbitem);
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, dbitem.IDPartner, "DTO_CUS_DOC_File", dbitem.ModifiedDate, Username);



                    item.ID = dbitem.ID;

                    item.CreatedBy   = dbitem.CreatedBy;
                    item.CreatedDate = dbitem.CreatedDate;

                    item.ModifiedBy   = dbitem.ModifiedBy;
                    item.ModifiedDate = dbitem.ModifiedDate;

                    item.IDPartner = dbitem.IDPartner;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("post_CUS_DOC_File", e);
                    item = null;
                }
            }
            return(item);
        }
コード例 #28
0
        public static string put_PRO_BaoCaoNangSuatKhoaHocCustom(AppEntities db, int ID, DTO_PRO_BaoCaoNangSuatKhoaHoc item, string Username)
        {
            string result = string.Empty;
            var    dbitem = db.tbl_PRO_BaoCaoNangSuatKhoaHoc.Find(ID);

            if (dbitem != null)
            {
                dbitem.IDDeTai       = item.IDDeTai;
                dbitem.IDNhom        = item.IDNhom;
                dbitem.IDSite        = item.IDSite;
                dbitem.TenDeTai      = item.TenDeTai;
                dbitem.NgayBaoCao    = item.NgayBaoCao;
                dbitem.TapChiHoiNghi = item.TapChiHoiNghi;
                dbitem.IsDisabled    = item.IsDisabled;
                dbitem.IsDeleted     = item.IsDeleted;
                dbitem.IDKinhPhi     = item.IDKinhPhi;
                dbitem.IDNCV         = item.IDNCV;
                dbitem.IsApproved    = item.IsApproved;
                dbitem.ApprovedDate  = item.ApprovedDate;

                if (item.IsApproved)
                {
                    return("Kinh phí đã duyệt, không thể chỉnh sửa");
                }

                var kinhphi = db.tbl_CAT_KinhPhi.FirstOrDefault(c => c.ID == item.IDKinhPhi);
                if (kinhphi != null && kinhphi.IsManual != true)
                {
                    DateTime dt      = item.NgayBaoCao;
                    var      banggia = db.tbl_CAT_BangGiaKinhPhi.Where(c => c.IDKinhPhi == item.IDKinhPhi && c.NgayHieuLuc <= dt).OrderByDescending(c => c.NgayHieuLuc).FirstOrDefault();
                    if (banggia != null)
                    {
                        dbitem.KinhPhi = banggia.Gia;
                    }
                }
                else
                {
                    dbitem.KinhPhi = item.KinhPhi;
                }

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;

                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "DTO_PRO_BaoCaoNangSuatKhoaHoc", DateTime.Now, Username);
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("put_PRO_BaoCaoNangSuatKhoaHoc", e);
                    result = e.InnerException.Message;
                }
            }
            return(result);
        }
コード例 #29
0
        public static bool put_WEB_BaiViet(AppEntities db, int ID, DTO_WEB_BaiViet item, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_WEB_BaiViet.Find(ID);

            if (dbitem != null)
            {
                dbitem.IDDanhMuc       = item.IDDanhMuc;
                dbitem.IDParent        = item.IDParent;
                dbitem.Code            = item.Code;
                dbitem.Name            = item.Name;
                dbitem.Remark          = item.Remark;
                dbitem.Sort            = item.Sort;
                dbitem.IsDisabled      = item.IsDisabled;
                dbitem.IsDeleted       = item.IsDeleted;
                dbitem.Type            = item.Type;
                dbitem.ThumbnailImage  = item.ThumbnailImage;
                dbitem.Image           = item.Image;
                dbitem.AlternateImage  = item.AlternateImage;
                dbitem.NgayDangBaiViet = item.NgayDangBaiViet;
                dbitem.LuotXem         = item.LuotXem;
                dbitem.DanhGia         = item.DanhGia;
                dbitem.AllowComment    = item.AllowComment;
                dbitem.LuotThich       = item.LuotThich;
                dbitem.NgonNgu         = item.NgonNgu;
                dbitem.Summary         = item.Summary;
                dbitem.NoiDung         = item.NoiDung;
                dbitem.TenKhac         = item.TenKhac;
                dbitem.ReadMoreText    = item.ReadMoreText;
                dbitem.SEO1            = item.SEO1;
                dbitem.SEO2            = item.SEO2;
                dbitem.Duyet           = item.Duyet;
                dbitem.URL             = item.URL;
                dbitem.Pin             = item.Pin;
                dbitem.PinPos          = item.PinPos;
                dbitem.Home            = item.Home;
                dbitem.HomePos         = item.HomePos;

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;

                try
                {
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "DTO_WEB_BaiViet", dbitem.ModifiedDate, Username);

                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("put_WEB_BaiViet", e);
                    result = false;
                }
            }
            return(result);
        }
コード例 #30
0
        public static DTO_PRO_Sysnopsis post_PRO_Sysnopsis(AppEntities db, DTO_PRO_Sysnopsis item, string Username)
        {
            tbl_PRO_Sysnopsis dbitem = new tbl_PRO_Sysnopsis();

            if (item != null)
            {
                dbitem.IDDeTai                 = item.IDDeTai;
                dbitem.StudyTitle              = item.StudyTitle;
                dbitem.Investigators           = item.Investigators;
                dbitem.BackgroundAims          = item.BackgroundAims;
                dbitem.Objectives              = item.Objectives;
                dbitem.StudyDesign             = item.StudyDesign;
                dbitem.StudyPopulation         = item.StudyPopulation;
                dbitem.Endpoint                = item.Endpoint;
                dbitem.PrimaryEndpoint         = item.PrimaryEndpoint;
                dbitem.SecondaryEndpoint       = item.SecondaryEndpoint;
                dbitem.MainEligibilityCriteria = item.MainEligibilityCriteria;
                dbitem.InclusionCriteria       = item.InclusionCriteria;
                dbitem.ExclusionCriteria       = item.ExclusionCriteria;
                dbitem.DataAnalysis            = item.DataAnalysis;
                dbitem.References              = item.References;
                dbitem.HTML       = item.HTML;
                dbitem.IsDisabled = item.IsDisabled;
                dbitem.IsDeleted  = item.IsDeleted;
                dbitem.FormConfig = item.FormConfig;

                dbitem.CreatedBy   = Username;
                dbitem.CreatedDate = DateTime.Now;

                dbitem.ModifiedBy   = Username;
                dbitem.ModifiedDate = DateTime.Now;


                try
                {
                    db.tbl_PRO_Sysnopsis.Add(dbitem);
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "DTO_PRO_Sysnopsis", DateTime.Now, Username);


                    item.ID = dbitem.ID;

                    item.CreatedBy   = dbitem.CreatedBy;
                    item.CreatedDate = dbitem.CreatedDate;

                    item.ModifiedBy   = dbitem.ModifiedBy;
                    item.ModifiedDate = dbitem.ModifiedDate;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("post_PRO_Sysnopsis", e);
                    item = null;
                }
            }
            return(item);
        }