public ActionResult Create(FormCollection frm) { try { UserSet u = new UserSet(); //form dan gelen veriler u.UserName=frm["UserName"]; u.UserType = (Byte)En_UserType.SiteUser; u.Password=frm["Password"]; u.Email=frm["Email"]; u.RegistrationDate = DateTime.Now; u.IsApproved = (Byte)En_IsApproved.NotApproved; u.IsActive = (Byte)En_IsActive.Active; //kaydet _entity.UserSet.AddObject(u); _entity.SaveChanges(); return RedirectToAction("Index"); } catch { return View(); } }
/// <summary> /// Create a new UserSet object. /// </summary> /// <param name="userId">Initial value of the UserId property.</param> /// <param name="userType">Initial value of the UserType property.</param> /// <param name="userName">Initial value of the UserName property.</param> /// <param name="password">Initial value of the Password property.</param> /// <param name="email">Initial value of the Email property.</param> /// <param name="isApproved">Initial value of the IsApproved property.</param> /// <param name="isActive">Initial value of the IsActive property.</param> /// <param name="registrationDate">Initial value of the RegistrationDate property.</param> public static UserSet CreateUserSet(global::System.Int32 userId, global::System.Int16 userType, global::System.String userName, global::System.String password, global::System.String email, global::System.Byte isApproved, global::System.Byte isActive, global::System.DateTime registrationDate) { UserSet userSet = new UserSet(); userSet.UserId = userId; userSet.UserType = userType; userSet.UserName = userName; userSet.Password = password; userSet.Email = email; userSet.IsApproved = isApproved; userSet.IsActive = isActive; userSet.RegistrationDate = registrationDate; return userSet; }
/// <summary> /// Deprecated Method for adding a new object to the UserSet EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToUserSet(UserSet userSet) { base.AddObject("UserSet", userSet); }