public static bool put_PRO_TrangThai_Log(AppEntities db, int ID, DTO_PRO_TrangThai_Log item, string Username)
        {
            bool result = false;
            var  dbitem = db.tbl_PRO_TrangThai_Log.Find(ID);

            if (dbitem != null)
            {
                dbitem.IDDeTai             = item.IDDeTai;
                dbitem.IDPhanLoaiTrangThai = item.IDPhanLoaiTrangThai;
                dbitem.IDTrangThaiCu       = item.IDTrangThaiCu;
                dbitem.IDTrangThaiMoi      = item.IDTrangThaiMoi;
                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_TrangThai_Log", DateTime.Now, Username);

                    result = true;
                }
                catch (DbEntityValidationException e)
                {
                    errorLog.logMessage("put_PRO_TrangThai_Log", e);
                    result = false;
                }
            }
            return(result);
        }
        public static DTO_PRO_TrangThai_Log post_PRO_TrangThai_Log(AppEntities db, DTO_PRO_TrangThai_Log item, string Username)
        {
            tbl_PRO_TrangThai_Log dbitem = new tbl_PRO_TrangThai_Log();

            if (item != null)
            {
                dbitem.IDDeTai             = item.IDDeTai;
                dbitem.IDPhanLoaiTrangThai = item.IDPhanLoaiTrangThai;
                dbitem.IDTrangThaiCu       = item.IDTrangThaiCu;
                dbitem.IDTrangThaiMoi      = item.IDTrangThaiMoi;
                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_TrangThai_Log.Add(dbitem);
                    db.SaveChanges();

                    BS_CUS_Version.update_CUS_Version(db, null, "DTO_PRO_TrangThai_Log", 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_TrangThai_Log", e);
                    item = null;
                }
            }
            return(item);
        }