public bool UpdateCustomer(int id, Customers_Profile customer) { try { db.SubmitChanges(); return(true); } catch (Exception e) { return(false); } }
public bool UpdateCustomer(int id, string name, string lastname, string username, string ident, string password, string account) { Customers_Profile customer = repository.GetCustomer(id); customer.Account = Convert.ToInt32(account); customer.User.Name = name; customer.User.LastName = lastname; customer.User.UserName = username; customer.Identification = ident; customer.User.Password = password; return(repository.UpdateCustomer(id, customer)); }
public bool DeleteCustomer(Customers_Profile customer) { try { db.Customers_Profiles.DeleteOnSubmit(customer); db.SubmitChanges(); return(true); } catch (Exception e) { return(false); } }
public bool AddCustomer(string name, string lastname, string ident, string username, string password, int account) { var customer = new Customers_Profile(); customer.Account = account; customer.Status = "1"; customer.Identification = ident; var user = new User(); user.Name = name; user.LastName = lastname; user.Identification = ident; user.Password = password; user.UserName = username; user.Status = "1"; user.Creation_Date = DateTime.Now; user.Customers_Profiles.Add(customer); var subject = repository.AddCustomer(user); return(true); }