Exemplo n.º 1
0
        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);
        }
Exemplo n.º 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;
 }
Exemplo n.º 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);
 }