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); }
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(); }
/// <summary> /// Get infomation /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>DataModel</returns> private InitDataModel GetInfo(InitDataModel inputObject) { // Local variable declaration InitDataModel getResult = null; MCodeCom mCodeCom = null; AdminUserEntryDao adminUserEntryDao = null; // Variable initialize getResult = new InitDataModel(); mCodeCom = new MCodeCom(); adminUserEntryDao = new AdminUserEntryDao(); // Get data var listCity = mCodeCom.GetListCity(false, false); var listDeleteFlag = mCodeCom.GetListCode(Logics.GROUP_DELETE_FLAG, null, false, false); var listGroup = mCodeCom.GetListGroup(false, false); var user = new User(); if (!IsAdd) user = adminUserEntryDao.GetSingle(inputObject.UserCd); // Set value getResult.ListCity = listCity; getResult.ListDeleteFlag = listDeleteFlag; getResult.ListGroup = listGroup; getResult.User = user; // Return value return getResult; }
/// <summary> /// Update password /// </summary> /// <param name="param">User</param> /// <param name="ignoreDeleteFlag">IgnoreDeleteFlag</param> public void UpdatePassword(User param, bool ignoreDeleteFlag) { // Get account var entity = GetSingle(param.UserCd, ignoreDeleteFlag); // Setting value entity.Password = param.Password; entity.UpdateUser = param.UpdateUser; entity.UpdateDate = param.UpdateDate; // Submit EntityManager.SubmitChanges(); }
private void detach_Users(User entity) { this.SendPropertyChanging(); entity.City = null; }
private void attach_Users(User entity) { this.SendPropertyChanging(); entity.City = this; }
partial void DeleteUser(User instance);
partial void UpdateUser(User instance);
partial void InsertUser(User instance);