/// <summary> /// Create a new Form object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="description">Initial value of the Description property.</param> public static Form CreateForm(global::System.Int32 id, global::System.String name, global::System.String description) { Form form = new Form(); form.Id = id; form.Name = name; form.Description = description; return form; }
private static bool AddWorlFlow() { using(Model2Container c=new Model2Container()) { Form f=new Form(); f.Name = "请假流程1"; f.Description = "请假"; c.AddToForm(f); Field f1=new Field(); f1.Form = f; f1.Name = "days"; f1.Title = "天数"; f1.Type = 0; c.AddToField(f1); Field f2 = new Field(); f2.Form = f; f2.Name = "leader"; f2.Title = "主管意见"; f2.Type = 1; c.AddToField(f2); Field f3 = new Field(); f3.Form = f; f3.Name = "manager"; f3.Title = "总经理意见"; f3.Type = 1; c.AddToField(f3); try { c.SaveChanges(); return true; } catch (Exception) { return false; } } }
/// <summary> /// Deprecated Method for adding a new object to the Form EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToForm(Form form) { base.AddObject("Form", form); }