public bool Update(CSF_Pages entity) { try { CSF_Pages obj = MyContext.CSF_Pages.Find(entity.ID); obj.IsActive = entity.IsActive == null ? false : entity.IsActive; obj.IsAdmin = entity.IsAdmin == null ? false : entity.IsAdmin; obj.IsHost = entity.IsHost == null ? false : entity.IsHost; obj.IsBlank = entity.IsBlank == null ? false : entity.IsBlank; obj.Name = entity.Name; obj.Order = entity.Order; obj.Icon = entity.Icon; obj.ParentID = entity.ParentID == null ? 0 : entity.ParentID; obj.Key = entity.Key; obj.ModuleID = entity.ModuleID; MyContext.Entry(obj).State = EntityState.Modified; MyContext.SaveChanges(); return(true); } catch (Exception ex) { Logs.WriteLog(ex); return(false); } }
public bool Update(CMS_Documents entity) { try { CMS_Documents obj = MyContext.CMS_Documents.Find(entity.ID); obj.DocumentNumber = entity.DocumentNumber; obj.TypeOfDocumentID = entity.TypeOfDocumentID; obj.AreaOfDocument = entity.AreaOfDocument; obj.Abstract = entity.Abstract; obj.Contents = entity.Contents; obj.OrganizationID = entity.OrganizationID; obj.IssuedDate = entity.IssuedDate; obj.EffectiveDate = entity.EffectiveDate; obj.Signer = entity.Signer; obj.FileName = entity.FileName; obj.Publish = entity.Publish == null ? false : entity.Publish; obj.Effective = entity.Effective == null ? false : entity.Effective; obj.Description = entity.Description; MyContext.Entry(obj).State = EntityState.Modified; MyContext.SaveChanges(); return(true); } catch (Exception ex) { Logs.WriteLog(ex); return(false); } }
public ActionResult Index(CSF_Templates obj) { ViewBag.URLIMAGE = System.Configuration.ConfigurationManager.AppSettings["UrlImage"]; if (ModelState.IsValid) { DT_WebGISEntities MyContext = new DT_WebGISEntities(); MyContext.Entry(obj).State = System.Data.Entity.EntityState.Modified; MyContext.SaveChanges(); SetAlert("Lưu giao diên thành công", AlertType.Success); } return(View(obj)); }
public JsonResult editUrlMap(string url) { var id = Session["idMap"]; DT_WebGISEntities db = new DT_WebGISEntities(); var GT = db.CMS_Maps.Find(id); var service = db.CMS_MapService.Where(x => x.MapID == GT.ID).FirstOrDefault(); var serviceMap = db.CMS_Services.Where(x => x.ID == service.ServiceID).FirstOrDefault(); serviceMap.URL = url; db.Entry(serviceMap).State = EntityState.Modified; db.SaveChanges(); return(Json(new { status = true, message = "" }, JsonRequestBehavior.AllowGet)); }
public bool Update(CMS_News entity) { try { CMS_News obj = MyContext.CMS_News.Find(entity.ID); obj.TITLE = entity.TITLE; obj.CONTENTS = entity.CONTENTS; obj.EXCERPT = entity.EXCERPT; obj.ID_CATEGORIES = entity.ID_CATEGORIES; obj.PICTURE = entity.PICTURE; obj.EDITDATE = System.DateTime.Now; obj.ID_USERMODIFY = entity.ID_USERMODIFY; MyContext.Entry(obj).State = EntityState.Modified; MyContext.SaveChanges(); return(true); } catch (Exception ex) { Logs.WriteLog(ex); return(false); } }
public bool Update(CSF_RoleFunction entity) { try { MyContext.Entry(entity).State = EntityState.Modified; MyContext.SaveChanges(); return(true); } catch (Exception ex) { Logs.WriteLog(ex); return(false); } }
public bool Update(CMS_Links entity) { try { CMS_Links obj = MyContext.CMS_Links.Find(entity.ID); obj.Name = entity.Name; obj.Url = entity.Url; obj.Picture = entity.Picture; obj.Shows = entity.Shows; obj.Order = entity.Order; MyContext.Entry(obj).State = EntityState.Modified; MyContext.SaveChanges(); return(true); } catch (Exception ex) { Logs.WriteLog(ex); return(false); } }
public bool Update(CMS_Photos entity) { try { CMS_Photos obj = MyContext.CMS_Photos.Find(entity.ID); obj.Name = entity.Name; obj.TypeOfPhotoID = entity.TypeOfPhotoID; obj.Description = entity.Description; obj.FileName = entity.FileName; obj.Publish = entity.Publish; MyContext.Entry(obj).State = EntityState.Modified; MyContext.SaveChanges(); return(true); } catch (Exception ex) { Logs.WriteLog(ex); return(false); } }
public JsonResult GuiDuyet(string newsid) { try { DT_WebGISEntities entity = new DT_WebGISEntities(); int NEWSID = Convert.ToInt32(newsid); var news = entity.CMS_News.Find(NEWSID); if (news != null && (news.ID_NEWS_STATUS == 1 || news.ID_NEWS_STATUS == 3 || news.ID_NEWS_STATUS == 6)) { news.ID_NEWS_STATUS = 2; entity.Entry(news).State = EntityState.Modified; entity.SaveChanges(); } SetAlert("Gửi duyệt thành công", AlertType.Success); return(Json(new { state = true, message = "" }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { state = false, message = ex }, JsonRequestBehavior.AllowGet)); } }
public bool Update(CMS_Questions entity) { try { CMS_Questions obj = MyContext.CMS_Questions.Find(entity.ID); obj.Title = entity.Title; obj.Contents = entity.Contents; obj.Answer = entity.Answer; obj.TypeOfQuestionID = entity.TypeOfQuestionID; obj.Publish = entity.Publish; obj.FileName = entity.FileName; MyContext.Entry(obj).State = EntityState.Modified; MyContext.SaveChanges(); return(true); } catch (Exception ex) { Logs.WriteLog(ex); return(false); } }