Inheritance: System.Data.Objects.DataClasses.EntityObject
        public RedirectToRouteResult CreateVendor(System.Guid id)
        {
            Vendor vendor = new Vendor();
            vendor.VendorId = System.Guid.NewGuid();
            vendor.UserId = id;

            //if (vendorsRepository.GetVendorByUserId(id).Equals(null))
            //{
                if (TryUpdateModel(vendor))
                {
                    vendorsRepository.add(vendor);
                    vendorsRepository.save();
                    _rolesService.RemoveFromRole(_userService.Get(id), "Customer");
                    _rolesService.AddToRole(_userService.Get(id), "Vendor");
                    return RedirectToAction("index");
                }
            //}

            return RedirectToAction("Index");
        }
Exemple #2
0
 public void delete(Vendor vendor)
 {
     entities.Vendors.DeleteObject(vendor);
 }
Exemple #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Vendors EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToVendors(Vendor vendor)
 {
     base.AddObject("Vendors", vendor);
 }
Exemple #4
0
 public void add(Vendor vendor)
 {
     entities.Vendors.AddObject(vendor);
 }
Exemple #5
0
 /// <summary>
 /// Create a new Vendor object.
 /// </summary>
 /// <param name="vendorId">Initial value of the VendorId property.</param>
 /// <param name="userId">Initial value of the UserId property.</param>
 public static Vendor CreateVendor(global::System.Guid vendorId, global::System.Guid userId)
 {
     Vendor vendor = new Vendor();
     vendor.VendorId = vendorId;
     vendor.UserId = userId;
     return vendor;
 }