public FormSettingResponse GetSettings(FormSettingRequest pRequest) { FormSettingResponse Response = new FormSettingResponse(); try { Epi.Web.Enter.Interfaces.DataInterfaces.IDaoFactory entityDaoFactory = new EFwcf.EntityDaoFactory(); Epi.Web.Enter.Interfaces.DataInterface.IFormSettingDao IFormSettingDao = entityDaoFactory.FormSettingDao; if (!string.IsNullOrEmpty(pRequest.FormInfo.FormId)) { Epi.Web.Enter.Interfaces.DataInterface.IFormInfoDao FormInfoDao = entityDaoFactory.FormInfoDao; Epi.Web.Enter.Interfaces.DataInterface.IUserDao IUserDao = entityDaoFactory.UserDao; Epi.Web.BLL.FormInfo FormInfoImplementation = new Epi.Web.BLL.FormInfo(FormInfoDao); Epi.Web.BLL.FormSetting SettingsImplementation = new Epi.Web.BLL.FormSetting(IFormSettingDao, IUserDao, FormInfoDao); FormInfoBO FormInfoBO = FormInfoImplementation.GetFormInfoByFormId(pRequest.FormInfo.FormId, pRequest.GetXml, pRequest.FormInfo.UserId); Response.FormInfo = Mapper.ToFormInfoDTO(FormInfoBO); Response.FormSetting = Mapper.ToDataTransferObject(SettingsImplementation.GetFormSettings(pRequest.FormInfo.FormId.ToString(), FormInfoBO.Xml)); } else { Epi.Web.BLL.FormSetting SettingsImplementation = new Epi.Web.BLL.FormSetting(IFormSettingDao); Response.FormSetting = Mapper.ToDataTransferObject(SettingsImplementation.GetFormSettings()); } } catch (Exception ex) { throw ex; } return(Response); }
public UserAuthenticationResponse GetUser(UserAuthenticationRequest request) { try { var response = new UserAuthenticationResponse(); Epi.Web.Enter.Interfaces.DataInterfaces.IDaoFactory entityDaoFactory = new EFwcf.EntityDaoFactory(); Epi.Web.Enter.Interfaces.DataInterface.IUserDao IUserDao = entityDaoFactory.UserDao; Epi.Web.BLL.User Implementation = new Epi.Web.BLL.User(IUserDao); UserBO UserBO = Mapper.ToUserBO(request.User); // UserBO result = Implementation.GetUserByUserId(UserBO); UserBO result = Implementation.GetUserByEmail(UserBO); if (result != null) { response.User = Mapper.ToUserDTO(result); } return(response); } catch (Exception ex) { throw ex; } }
public UserAuthenticationResponse UserLogin(UserAuthenticationRequest request) { var response = new UserAuthenticationResponse(); Epi.Web.Enter.Interfaces.DataInterfaces.IDaoFactory entityDaoFactory = new EFwcf.EntityDaoFactory(); Epi.Web.Enter.Interfaces.DataInterface.IUserDao IUserDao = entityDaoFactory.UserDao; Epi.Web.BLL.User Implementation = new Epi.Web.BLL.User(IUserDao); UserBO UserBO = Mapper.ToUserBO(request.User); UserBO result = Implementation.GetUser(UserBO); if (result != null) { //response.Acknowledge = AcknowledgeType.Failure; TBD //response.Message = "Invalid Pass Code."; response.User = Mapper.ToUserDTO(result); response.UserIsValid = true; } else { response.UserIsValid = false; } return(response); }
public bool UpdateUser(UserAuthenticationRequest request) { Epi.Web.Enter.Interfaces.DataInterfaces.IDaoFactory entityDaoFactory = new EF.EntityDaoFactory(); Epi.Web.Enter.Interfaces.DataInterface.IUserDao IUserDao = entityDaoFactory.UserDao; Epi.Web.BLL.User Implementation = new Epi.Web.BLL.User(IUserDao); UserBO UserBO = Mapper.ToUserBO(request.User); OrganizationBO OrgBO = new OrganizationBO(); return(Implementation.UpdateUser(UserBO, OrgBO)); }