Ejemplo n.º 1
0
        private bool registerUser(UserInfo userInfo)
        {
            Login login = new DataAccess.Login();

            login.UserName = userInfo.UserName;
            login.Password = userInfo.Password;
            login.UserID   = Guid.NewGuid().ToString();
            UserInformation uinfo = new DataAccess.UserInformation();

            context.Logins.InsertOnSubmit(login);
            uinfo.UserId = login.UserID;
            fillGender(userInfo, uinfo);
            uinfo.Address    = userInfo.Address;
            uinfo.Contact    = userInfo.Contact;
            uinfo.Contact1   = userInfo.Contact1;
            uinfo.Country    = userInfo.Country;
            uinfo.DOB        = DateTime.Parse(userInfo.Dob);
            uinfo.FirstName  = userInfo.FirstName;
            uinfo.id         = Guid.NewGuid().ToString();
            uinfo.Initials   = userInfo.Intials;
            uinfo.LastName   = userInfo.LastName;
            uinfo.MiddleName = userInfo.MiddleName;
            context.UserInformations.InsertOnSubmit(uinfo);
            try
            {
                context.SubmitChanges();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
        private bool registerUser(UserInfo userInfo)
        {
            Login login = new DataAccess.Login();
            login.UserName = userInfo.UserName;
            login.Password = userInfo.Password;
            login.UserID = Guid.NewGuid().ToString();
            UserInformation uinfo = new DataAccess.UserInformation();
            context.Logins.InsertOnSubmit(login);
            uinfo.UserId = login.UserID;
            fillGender(userInfo, uinfo);
            uinfo.Address = userInfo.Address;
            uinfo.Contact = userInfo.Contact;
            uinfo.Contact1 = userInfo.Contact1;
            uinfo.Country = userInfo.Country;
            uinfo.DOB = DateTime.Parse(userInfo.Dob);
            uinfo.FirstName = userInfo.FirstName;
            uinfo.id = Guid.NewGuid().ToString();
            uinfo.Initials = userInfo.Intials;
            uinfo.LastName = userInfo.LastName;
            uinfo.MiddleName = userInfo.MiddleName;
            context.UserInformations.InsertOnSubmit(uinfo);
            try
            {
                context.SubmitChanges();

                return true;
            }
            catch (Exception ex)
            {
                return false;
            }
        }
		private void detach_Logins(Login entity)
		{
			this.SendPropertyChanging();
			entity.Role = null;
		}
		private void attach_Logins(Login entity)
		{
			this.SendPropertyChanging();
			entity.Role = this;
		}
 partial void DeleteLogin(Login instance);
 partial void UpdateLogin(Login instance);
 partial void InsertLogin(Login instance);