public ActionResult Insert(GongSiXinXi entity) { if (ModelState.IsValid) { if (!ValidSiteUrl(entity.SiteUrl)) { X.Msg.Alert(MsgInfo.TI_SHI, MsgInfo.SITE_URL).Show(); return(this.Direct()); } entity.CreatedBy = GetCurrentUserName(); entity.CreatedDate = DateTime.Now; entity.AreaPath = GetOrganizationAreaPath(); _gongSiXinXiService.AddGongSiXinXi(entity); _gongSiXinXiService.Save(); this.GetCmp <Window>("windowGongSiXinXi").Hide(); this.GetCmp <Store>("storeGongSiXinXi").Reload(); return(this.Direct()); } return(this.Direct()); }
public ActionResult Update(GongSiXinXi entity) { if (ModelState.IsValid) { if (!ValidSiteUrl(entity.SiteUrl)) { X.Msg.Alert(MsgInfo.TI_SHI, MsgInfo.SITE_URL).Show(); return(this.Direct()); } entity.LastModifiedBy = GetCurrentUserName(); entity.LastModifiedDate = DateTime.Now; _gongSiXinXiService.UpdateGongSiXinXi(entity); _gongSiXinXiService.Save(); var window = this.GetCmp <Window>("windowGongSiXinXi"); window.Hide(); this.GetCmp <Store>("storeGongSiXinXi").Reload(); return(this.Direct()); } return(this.Direct()); }