/// <summary> /// Create a new Field object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="title">Initial value of the Title property.</param> /// <param name="type">Initial value of the Type property.</param> public static Field CreateField(global::System.Int32 id, global::System.String name, global::System.String title, global::System.Int16 type) { Field field = new Field(); field.Id = id; field.Name = name; field.Title = title; field.Type = type; return field; }
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 Field EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToField(Field field) { base.AddObject("Field", field); }