public ActionResult Create(OrganizationVM model)
        {
            if (ModelState.IsValid)
            {
                var org = new Organization
                {
                    Name = model.Name,
                    MascotName = model.MascotName,
                    Tagline = model.Tagline,
                    CreatedBy = LoggedInUserId,
                    CreatedOn = DateTime.UtcNow,
                };
                db.Organizations.AddObject(org);
                TryDBChange(() => db.SaveChanges());
            }

            return PartialView("CreateForm", model);
        }
Example #2
0
 /// <summary>
 /// Create a new Organization object.
 /// </summary>
 /// <param name="organizationId">Initial value of the OrganizationId property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 public static Organization CreateOrganization(global::System.Int64 organizationId, global::System.String name)
 {
     Organization organization = new Organization();
     organization.OrganizationId = organizationId;
     organization.Name = name;
     return organization;
 }
Example #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Organizations EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToOrganizations(Organization organization)
 {
     base.AddObject("Organizations", organization);
 }