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);
        }
示例#2
0
        public FormSettingResponse GetFormSettings(FormSettingRequest formSettingRequest)
        {
            try
            {
                var formInfo     = formSettingRequest.FormInfo;
                var formId       = formInfo.FormId.ToString();
                var userId       = formInfo.UserId;
                var currentOrgId = formSettingRequest.CurrentOrgId;

                Epi.Web.BLL.FormSetting formSettingImplementation = new Epi.Web.BLL.FormSetting(_formSettingFacade, _userDao);
                var formSettingBO       = formSettingImplementation.GetFormSettings(formId, currentOrgId);
                var formSettingResponse = CreateFormSettingResponse(formId, userId, formSettingBO);
                return(formSettingResponse);
            }
            catch (Exception ex)
            {
                throw new FaultException <CustomFaultException>(new CustomFaultException(ex));
            }
        }