public bool UpdateUserDetails() { try { if (Action == Constants.InsertAction) { CreatedDate = UserContext.CurrentDate; UserCode = Guid.NewGuid(); } var objProfile = new UserProfile { UType = Constants.UserType, UCode = UserCode, Created = CreatedDate, LoginId = UserLoginId, Password = Password, Name = UserName, Address = Address, City = City, Country = Country, State = State, Zip = ZipCode, Mobile = Mobile, OffPhone = OfficePhone, ResPhone = ResidentialPhone, Email = Email, Dob = Dob, EmpId = EmployeeId, Gender = Gender, Designation = new Designation { Id = Designation }, ReportingTo = new Guid(ReportingTo), Branch = Branch, ActiveTill = ActiveTill, Wh = Warehouse, Dept = Department, Avatar = Avator, LastPasswordChanged = Dates.ToDateTime(LastPasswordChanged, DateFormat.Format_05), Bu = Bu, Off = Status, DefaultLink = Constants.DefaultHomeLink, Action = Action, DataBaseInfo = UserContext.DataBaseInfo }; var userProfiles = new UserProfiles { objProfile }; return(_controlPanel.ManageUsers(userProfiles)); } catch (Exception Ex) { AuditLog.LogEvent(SysEventType.ERROR, "Profile Creation", "Error occured while saving.", Ex); } return(false); }
public bool UpdateUserDetails() { // Assign new action if action is empty or view if (Action == string.Empty || Action == Constants.ViewAction) { Action = Constants.InsertAction; } if (Action == Constants.InsertAction) { CreatedDate = UserContext.CurrentDate; UserCode = Guid.NewGuid(); } var objProfile = new UserProfile { UType = Constants.UserType, UCode = UserCode, Created = CreatedDate, LoginId = UserLoginId, Password = Password, Name = UserName, Address = Address, City = City, Country = Country, State = State, Zip = ZipCode, Mobile = Mobile, OffPhone = OfficePhone, ResPhone = ResidentialPhone, Email = Email, Dob = Dob, EmpId = EmployeeId, Gender = Gender, Designation = new Designation { Id = Designation }, ReportingTo = new Guid(ReportingTo), Branch = Branch, ActiveTill = ActiveTill, Wh = Warehouse, Dept = Department, Avatar = Avator, LastPasswordChanged = Dates.ToDateTime(LastPasswordChanged, DateFormat.Format_05), Bu = Bu, Off = Status, DefaultLink = Constants.DefaultHomeLink, Action = Action, DataBaseInfo = UserContext.DataBaseInfo }; var userProfiles = new UserProfiles { objProfile }; return(_controlPanel.ManageUsers(userProfiles)); }