예제 #1
0
 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();
 }
예제 #2
0
        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;
            }
        }
예제 #3
0
 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;
 }