public int CreateOmbudsman(global::Ombudsman.Models.Ombudsman ombudsman) { using (var db = new OmbudsmanEntities()) { var added = new Ombudsman() { IsActive = ombudsman.IsActive, Email = ombudsman.Email, Address1 = ombudsman.Address1, Address2 = ombudsman.Address2, City = ombudsman.City, Fax = ombudsman.Fax, Name = ombudsman.Name, Phone = ombudsman.Phone, State = ombudsman.State, ZipCode = ombudsman.ZipCode }; db.AddToOmbudsmen(added); db.SaveChanges(); return added.OmbudsmanId; } }
/// <summary> /// Create a new Ombudsman object. /// </summary> /// <param name="ombudsmanId">Initial value of the OmbudsmanId property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="isActive">Initial value of the IsActive property.</param> public static Ombudsman CreateOmbudsman(global::System.Int32 ombudsmanId, global::System.String name, global::System.Boolean isActive) { Ombudsman ombudsman = new Ombudsman(); ombudsman.OmbudsmanId = ombudsmanId; ombudsman.Name = name; ombudsman.IsActive = isActive; return ombudsman; }
/// <summary> /// Deprecated Method for adding a new object to the Ombudsmen EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToOmbudsmen(Ombudsman ombudsman) { base.AddObject("Ombudsmen", ombudsman); }
private string GetOmbudsmanNameIf(Ombudsman ombudsman) { if (ombudsman == null) { return null; } else { return ombudsman.Name; } }