public void SynUserMapping(ControlPanelUser controlPanelUser, int userSysNo, int generateUserSysNo) { DataCommand cmd; if (userSysNo == 0) { cmd = DataCommandManager.GetDataCommand("InsertNewUser"); cmd.SetParameterValue("@GenerateUserSysNo", generateUserSysNo); } else { cmd = DataCommandManager.GetDataCommand("UpdateExistUser"); cmd.SetParameterValue("@IPPUserSysNo", userSysNo); } cmd.SetParameterValue("@ACLogicUserName", controlPanelUser.DisplayName); cmd.SetParameterValue("@ACPhysicalUserName", controlPanelUser.LoginName); cmd.SetParameterValue("@ACSourceDirectoryKey", controlPanelUser.SourceDirectory); cmd.SetParameterValue("@CompanyCode", controlPanelUser.CompanyCode); cmd.SetParameterValue("@DepartmentCode", controlPanelUser.DepartmentCode); cmd.SetParameterValue("@DepartmentName", controlPanelUser.DepartmentName); cmd.SetParameterValue("@EmailAddress", controlPanelUser.EmailAddress); cmd.SetParameterValue("@Status", MappingStatus(controlPanelUser.Status)); cmd.SetParameterValue("@PhoneNumber", controlPanelUser.PhoneNumber); cmd.ExecuteNonQuery(); }
public void GetControlPanelUserByLoginName(string loginName, EventHandler <RestClientEventArgs <ControlPanelUserVM> > callback) { string relativeUrl = "/CommonService/ControlPanelUser/GetControlPanelUserByLoginName"; if (!string.IsNullOrEmpty(loginName)) { restClient.Query <ControlPanelUser>(relativeUrl, loginName, (obj, args) => { if (args.FaultsHandle()) { return; } ControlPanelUserVM _viewModel = null; ControlPanelUser entity = args.Result; if (entity == null) { _viewModel = new ControlPanelUserVM(); } else { _viewModel = entity.Convert <ControlPanelUser, ControlPanelUserVM>(); } callback(obj, new RestClientEventArgs <ControlPanelUserVM>(_viewModel, restClient.Page)); }); } }
public void GetUserBySysNo(int?sysNo, EventHandler <RestClientEventArgs <ControlPanelUserVM> > callback) { string relativeUrl = "/CommonService/ControlPanelUser/GetUser/" + sysNo; if (sysNo.HasValue) { restClient.Query <ControlPanelUser>(relativeUrl, (obj, args) => { if (args.FaultsHandle()) { return; } ControlPanelUserVM _viewModel = null; ControlPanelUser entity = args.Result; if (entity == null) { _viewModel = new ControlPanelUserVM(); } else { _viewModel = entity.Convert <ControlPanelUser, ControlPanelUserVM>(); } callback(obj, new RestClientEventArgs <ControlPanelUserVM>(_viewModel, restClient.Page)); }); } }
public ControlPanelUser UpdateUser(ControlPanelUser request) { request.EditDate = DateTime.Now; DataCommand cmd = DataCommandManager.GetDataCommand("UpdateUser"); cmd.SetParameterValue <ControlPanelUser>(request); return(cmd.ExecuteEntity <ControlPanelUser>()); }
public ControlPanelUser GetUserBySysNo(int _sysNo) { DataCommand cmd = DataCommandManager.GetDataCommand("GetControlPanelUserBySysNo"); cmd.SetParameterValue("@SysNo", _sysNo); ControlPanelUser item = cmd.ExecuteEntity <ControlPanelUser>(); return(item); }
public int GetExistUserSysNoInOldData(ControlPanelUser controlPanelUser, int mappingUserSysNo) { DataCommand command = DataCommandManager.GetDataCommand("GetExistUserSysNoInOldData"); command.SetParameterValue("@UserID", controlPanelUser.LoginName); command.SetParameterValue("@UserSysNo", mappingUserSysNo); object result = command.ExecuteScalar(); if (result != null) { return(Convert.ToInt32(result)); } else { return(0); } }
private void TrimProperties(ref ControlPanelUser entity) { entity.LoginName = entity.LoginName == null ? null : entity.LoginName.Trim(); entity.SourceDirectory = entity.SourceDirectory == null ? null : entity.SourceDirectory.Trim(); entity.DisplayName = entity.DisplayName == null ? null : entity.DisplayName.Trim(); entity.DepartmentCode = entity.DepartmentCode == null ? null : entity.DepartmentCode.Trim(); entity.PhoneNumber = entity.PhoneNumber == null ? null : entity.PhoneNumber.Trim(); entity.EmailAddress = entity.EmailAddress == null ? null : entity.EmailAddress.Trim(); entity.LogicUserId = entity.LogicUserId == null ? null : entity.LogicUserId.Trim(); entity.PhysicalUserId = entity.PhysicalUserId == null ? null : entity.PhysicalUserId.Trim(); entity.InUser = entity.InUser == null ? null : entity.InUser.Trim(); entity.EditUser = entity.EditUser == null ? null : entity.EditUser.Trim(); entity.CompanyCode = entity.CompanyCode == null ? null : entity.CompanyCode.Trim(); entity.Province = string.IsNullOrWhiteSpace(entity.Province)? null : entity.Province.Trim(); entity.OrganizationName = string.IsNullOrWhiteSpace(entity.OrganizationName)? null : entity.OrganizationName.Trim(); }
public int GetExistUserSysNo(ControlPanelUser controlPanelUser) { DataCommand command = DataCommandManager.GetDataCommand("GetExistUserSysNo"); command.SetParameterValue("@SourceUserName", controlPanelUser.LoginName); command.SetParameterValue("@SourceDirectoryKey", controlPanelUser.SourceDirectory); command.SetParameterValue("@CompanyCode", controlPanelUser.CompanyCode); object result = command.ExecuteScalar(); if (result != null) { return(Convert.ToInt32(result)); } else { return(0); } }
private void SynMappingAndSysUser(ControlPanelUser controlPanelUser) { int generateUserSysNo = 0; int mappingUserSysNo = ObjectFactory <ISynMappingAndSysUserDA> .Instance.GetExistUserSysNo(controlPanelUser); int sysUserNo = ObjectFactory <ISynMappingAndSysUserDA> .Instance.GetExistUserSysNoInOldData(controlPanelUser, mappingUserSysNo); if (sysUserNo == 0 && mappingUserSysNo == 0) { generateUserSysNo = ObjectFactory <ISynMappingAndSysUserDA> .Instance.GenerateUserSysNo(); } else { generateUserSysNo = mappingUserSysNo == 0 ? sysUserNo : mappingUserSysNo; } ObjectFactory <ISynMappingAndSysUserDA> .Instance.SynUserMapping(controlPanelUser, mappingUserSysNo, generateUserSysNo); ObjectFactory <ISynMappingAndSysUserDA> .Instance.SynSysUser(controlPanelUser, sysUserNo, generateUserSysNo); }
public void SynSysUser(ControlPanelUser controlPanelUser, int userSysNo, int generateUserSysNo) { DataCommand cmd; if (userSysNo == 0) { cmd = DataCommandManager.GetDataCommand("InsertNewUserInOldData"); cmd.SetParameterValue("@GenerateUserSysNo", generateUserSysNo); cmd.SetParameterValue("@UserID", controlPanelUser.LoginName); } else { cmd = DataCommandManager.GetDataCommand("UpdateExistUserInOldData"); cmd.SetParameterValue("@SysNo", userSysNo); } cmd.SetParameterValue("@UserName", controlPanelUser.DisplayName); cmd.SetParameterValue("@Email", controlPanelUser.EmailAddress); cmd.SetParameterValue("@Phone", controlPanelUser.PhoneNumber); cmd.SetParameterValue("@Status", MappingStatus(controlPanelUser.Status)); cmd.ExecuteNonQuery(); }
public ControlPanelUser UpdateUser(ControlPanelUser request) { return(ObjectFactory <ControlPanelUserAppService> .Instance.Update(request)); }
public virtual ControlPanelUser Update(ControlPanelUser request) { return(ObjectFactory <ControlPanelUserProcessor> .Instance.Update(request)); }