public tbl_CustomerContact CreateContact(RegisterViewModel model) { var contactRepo = new Repos.CustomerContactRepo(); var newContact = new tbl_CustomerContact(); newContact.cell_number = Convert.ToInt64(model.Contact); newContact.landline = Convert.ToInt64(model.Contact); contactRepo.SaveContact(newContact); return(newContact); }
public bool UpdateContact(console.Models.tbl_CustomerContact entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { tbl_CustomerContact contact = (from c in context.tbl_CustomerContact where c.contact_id == entity.contact_id select c).First(); contact.cell_number = entity.cell_number; contact.landline = entity.landline; result = context.SaveChanges() > 1; } return(result); }
public tbl_User CreateUser(RegisterViewModel model, tbl_CustomerContact contact, tbl_BillingAddress billing, tbl_DelivetyAddresses delivery) { var userRepo = new Repos.UserRepo(); var newUser = new tbl_User(); newUser.user_name = model.Name; newUser.user_surname = model.Surname; newUser.email_address = model.Email; newUser.password = model.Password; newUser.delivery_id = delivery.delivery_id; newUser.billing_id = billing.billing_id; newUser.contact_id = contact.contact_id; userRepo.SaveUser(newUser); return(newUser); }