コード例 #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);
        }
コード例 #2
0
ファイル: CCData.Designer.cs プロジェクト: PhilipAdeoye/CCIS
 /// <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;
 }
コード例 #3
0
ファイル: CCData.Designer.cs プロジェクト: PhilipAdeoye/CCIS
 /// <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);
 }