Esempio n. 1
0
        public void Insert(SaveDataModel inputObject)
        {
            // Get sysdate
            var currentDate = DateTime.Now;

            // Set data
            var entity = new User();
            entity.UserCd = inputObject.UserCd;
            entity.Email = inputObject.Email;
            entity.FullName = inputObject.Fullname;
            entity.Password = DataHelper.GetMd5Hash(inputObject.Password);
            entity.Address = inputObject.Address;
            entity.Phone1 = inputObject.Phone1;
            entity.Phone2 = inputObject.Phone2;
            entity.CityCd = inputObject.CityCd;
            entity.HasNewsletter = false;
            entity.CreateUser = inputObject.Email;
            entity.CreateDate = currentDate;
            entity.UpdateUser = inputObject.Email;
            entity.UpdateDate = currentDate;
            entity.DeleteFlag = true;

            var entityGroupUser = new UserGroup();
            entityGroupUser.UserCd = inputObject.UserCd;
            entityGroupUser.GroupCd = Logics.GP_USERS;
            entityGroupUser.CreateUser = inputObject.Email;
            entityGroupUser.CreateDate = currentDate;
            entityGroupUser.UpdateUser = inputObject.Email;
            entityGroupUser.UpdateDate = currentDate;
            entityGroupUser.DeleteFlag = true;

            // Insert data
            EntityManager.Users.InsertOnSubmit(entity);
            EntityManager.UserGroups.InsertOnSubmit(entityGroupUser);
        }
Esempio n. 2
0
        public void Insert(SaveDataModel inputObject)
        {
            // Get sysdate
            var currentDate = DateTime.Now;
            // Get unique code
            var userCd = Guid.NewGuid();

            // Set data
            var entity = new User();
            entity.UserCd = userCd;
            entity.Email = inputObject.Email;
            entity.FullName = inputObject.FullName;
            entity.Password = DataHelper.GetMd5Hash(Logics.PASSWORD_DEFAULT);
            entity.Address = inputObject.Address;
            entity.Phone1 = inputObject.Phone1;
            entity.Phone2 = inputObject.Phone2;
            entity.CityCd = inputObject.CityCd;
            entity.HasNewsletter = false;
            entity.CreateUser = PageHelper.UserName;
            entity.CreateDate = currentDate;
            entity.UpdateUser = PageHelper.UserName;
            entity.UpdateDate = currentDate;
            entity.DeleteFlag = inputObject.DeleteFlag;

            var entityGroupUser = new UserGroup();
            entityGroupUser.UserCd = userCd;
            entityGroupUser.GroupCd = inputObject.GroupCd;
            entityGroupUser.CreateUser = PageHelper.UserName;
            entityGroupUser.CreateDate = currentDate;
            entityGroupUser.UpdateUser = PageHelper.UserName;
            entityGroupUser.UpdateDate = currentDate;
            entityGroupUser.DeleteFlag = inputObject.DeleteFlag;

            // Insert
            EntityManager.Users.InsertOnSubmit(entity);
            EntityManager.UserGroups.InsertOnSubmit(entityGroupUser);

            // Submit
            EntityManager.SubmitChanges();
        }
Esempio n. 3
0
		private void detach_UserGroups(UserGroup entity)
		{
			this.SendPropertyChanging();
			entity.Group = null;
		}
Esempio n. 4
0
		private void attach_UserGroups(UserGroup entity)
		{
			this.SendPropertyChanging();
			entity.Group = this;
		}
Esempio n. 5
0
 partial void DeleteUserGroup(UserGroup instance);
Esempio n. 6
0
 partial void UpdateUserGroup(UserGroup instance);
Esempio n. 7
0
 partial void InsertUserGroup(UserGroup instance);