public ActionResult CustomerLogin(FormCollection collection) { var model = new Customer(); UpdateModel(model, collection); var customer = _customerService.LoginCustomer(model.Email); if (customer == null) return Json(new { message = "Kullanıcı kayıtlı değil..", success = false }); if (customer.Password == model.Password.ToMd5Pass()) return Json(new { message = "Giriş Başarılı..", success = true }); return Json(new { message = "Kullanıcı Adı veya şifre Hatalı", success = false }); }
public ActionResult Register(FormCollection collection) { var model = new Customer() { CreateDate = DateTime.Now, MembershipPackage_Id = 2 }; UpdateModel(model, collection); model.Password = model.Password.ToMd5Pass(); // Customer Already Exist if (_customerService.IsAlReadyExistCustomer(model.Id)) return Json(new { message = "Kullanıcı Kaydı Bulunamadı", success = false }); _customerService.CreateCustomer(model, false); //Success return Json(new { message = "Giriş Başarılı Yönlendiriliyorsunuz", success = true }); }
public bool IsAlReadyExistCustomer(Customer customer) { return _repository.List<Customer>(x => x.Id == customer.Id).ToList().Count > 0 ? true : false; }
public void CreateCustomer(Customer customer, bool transaction) { _repository.Create(customer); _repository.Save(); }
/// <summary> /// Create a new Customer object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="membershipPackage_Id">Initial value of the MembershipPackage_Id property.</param> public static Customer CreateCustomer(global::System.Int32 id, global::System.String name, global::System.Int32 membershipPackage_Id) { Customer customer = new Customer(); customer.Id = id; customer.Name = name; customer.MembershipPackage_Id = membershipPackage_Id; return customer; }
/// <summary> /// Deprecated Method for adding a new object to the Customer EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToCustomer(Customer customer) { base.AddObject("Customer", customer); }