public ActionResult add1(FormCollection collection) { RoadFlow.Data.Model.Dictionary model = new RoadFlow.Data.Model.Dictionary(); RoadFlow.Platform.Dictionary dictionary = new RoadFlow.Platform.Dictionary(); string str1 = this.Request.QueryString["id"]; if (!str1.IsGuid()) { RoadFlow.Data.Model.Dictionary root = dictionary.GetRoot(); str1 = root != null?root.ID.ToString() : ""; } if (!str1.IsGuid()) { throw new Exception("未找到父级"); } if (collection != null) { string str2 = this.Request.Form["Title"]; string str3 = this.Request.Form["Code"]; string str4 = this.Request.Form["Values"]; string str5 = this.Request.Form["Note"]; string str6 = this.Request.Form["Other"]; model.ID = Guid.NewGuid(); model.Code = str3.IsNullOrEmpty() ? (string)null : str3.Trim(); model.Note = str5.IsNullOrEmpty() ? (string)null : str5.Trim(); model.Other = str6.IsNullOrEmpty() ? (string)null : str6.Trim(); model.ParentID = str1.ToGuid(); model.Sort = dictionary.GetMaxSort(str1.ToGuid()); model.Title = str2.Trim(); model.Value = str4.IsNullOrEmpty() ? (string)null : str4.Trim(); dictionary.Add(model); dictionary.RefreshCache(); RoadFlow.Platform.Log.Add("添加了数据字典项", model.Serialize(), RoadFlow.Platform.Log.Types.数据字典, "", "", (RoadFlow.Data.Model.Users)null); // ISSUE: reference to a compiler-generated field if (DictController.\u003C\u003Eo__9.\u003C\u003Ep__0 == null) { // ISSUE: reference to a compiler-generated field DictController.\u003C\u003Eo__9.\u003C\u003Ep__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "Script", typeof(DictController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null) })); } // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field object obj = DictController.\u003C\u003Eo__9.\u003C\u003Ep__0.Target((CallSite)DictController.\u003C\u003Eo__9.\u003C\u003Ep__0, this.ViewBag, "alert('添加成功!');parent.frames[0].reLoad('" + str1 + "');"); } return((ActionResult)this.View((object)model)); }
public ActionResult add1(FormCollection collection) { RoadFlow.Data.Model.Dictionary dict = new RoadFlow.Data.Model.Dictionary(); RoadFlow.Platform.Dictionary bdict = new RoadFlow.Platform.Dictionary(); string id = Request.QueryString["id"]; if (!id.IsGuid()) { var dictRoot = bdict.GetRoot(); id = dictRoot != null?dictRoot.ID.ToString() : ""; } if (!id.IsGuid()) { throw new Exception("未找到父级"); } if (collection != null) { string title = Request.Form["Title"]; string code = Request.Form["Code"]; string values = Request.Form["Values"]; string note = Request.Form["Note"]; string other = Request.Form["Other"]; dict.ID = Guid.NewGuid(); dict.Code = code.IsNullOrEmpty() ? null : code.Trim(); dict.Note = note.IsNullOrEmpty() ? null : note.Trim(); dict.Other = other.IsNullOrEmpty() ? null : other.Trim(); dict.ParentID = id.ToGuid(); dict.Sort = bdict.GetMaxSort(id.ToGuid()); dict.Title = title.Trim(); dict.Value = values.IsNullOrEmpty() ? null : values.Trim(); bdict.Add(dict); bdict.RefreshCache(); RoadFlow.Platform.Log.Add("添加了数据字典项", dict.Serialize(), RoadFlow.Platform.Log.Types.数据字典); ViewBag.Script = "alert('添加成功!');parent.frames[0].reLoad('" + id + "');"; } return(View(dict)); }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { RoadFlow.Data.Model.Dictionary dict = new RoadFlow.Data.Model.Dictionary(); RoadFlow.Platform.Dictionary bdict = new RoadFlow.Platform.Dictionary(); string id = Request.QueryString["id"]; if (!id.IsGuid()) { var dictRoot = bdict.GetRoot(); id = dictRoot != null?dictRoot.ID.ToString() : ""; } if (!id.IsGuid()) { throw new Exception("未找到父级"); } string title = Request.Form["Title1"]; string code = Request.Form["Code"]; string values = Request.Form["Values"]; string note = Request.Form["Note"]; string other = Request.Form["Other"]; dict.ID = Guid.NewGuid(); dict.Code = code.IsNullOrEmpty() ? null : code.Trim(); dict.Note = note.IsNullOrEmpty() ? null : note.Trim(); dict.Other = other.IsNullOrEmpty() ? null : other.Trim(); dict.ParentID = id.ToGuid(); dict.Sort = bdict.GetMaxSort(id.ToGuid()); dict.Title = title.Trim(); dict.Value = values.IsNullOrEmpty() ? null : values.Trim(); bdict.Add(dict); bdict.RefreshCache(); RoadFlow.Platform.Log.Add("添加了数据字典项", dict.Serialize(), RoadFlow.Platform.Log.Types.数据字典); Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('添加成功!');parent.frames[0].reLoad('" + id + "');", true); } }