internal static void Delete(DAL.CustomersDataContext dc, Login item) { DAL.Login dalLogin = dc.Logins.Where(l => l.Id == item.Id).Where(l => !l.Deleted).Single(); dalLogin.Deleted = true; dc.SubmitChanges(); }
private static void map(Login login, DAL.Login dalLogin) { bool isNew = login.Id == 0; bool isModified = false; if (dalLogin.CustomerId != login.CustomerId) { dalLogin.CustomerId = login.CustomerId; isModified = true; } if (dalLogin.FrontDoor != login.FrontDoor) { dalLogin.FrontDoor = login.FrontDoor; isModified = true; } if (isNew) { dalLogin.CreatedBy = login.LastChangedBy; dalLogin.CreatedDate = DateTime.Now; } if (isModified) { dalLogin.LastChangedBy = login.LastChangedBy; dalLogin.LastChangedDate = DateTime.Now; } }
private void map(DAL.Login dalLogin, Login login) { login.Id = dalLogin.Id; login.CustomerId = dalLogin.CustomerId; login.FrontDoor = dalLogin.FrontDoor; }
internal static Login createRandomLogin() { Login l = new Login(); l.FrontDoor = "frontDoor"; return l; }