Example #1
0
        public bool SetUserInfo(UserRequest UserInfo)
        {
            OrganizationRequest OrganizationRequest = new OrganizationRequest();

            OrganizationRequest.Organization.OrganizationKey = UserInfo.Organization.OrganizationKey;
            bool IsSet = false;

            try
            {
                Epi.Web.Interfaces.DataInterfaces.IUserDao IUserDao = new EF.EntityUserDao();
                Epi.Web.BLL.User Implementation = new Epi.Web.BLL.User(IUserDao);

                Epi.Web.Interfaces.DataInterfaces.IOrganizationDao IOrganizationDao = new EF.EntityOrganizationDao();
                Epi.Web.BLL.Organization OrgImplementation = new Epi.Web.BLL.Organization(IOrganizationDao);


                OrganizationBO OrganizationBO = OrgImplementation.GetOrganizationByKey(UserInfo.Organization.OrganizationKey);

                IsSet = Implementation.SetUserInfo(Mapper.ToUserBO(UserInfo.User), OrganizationBO);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(IsSet);
        }
Example #2
0
        public bool UpdateUserInfo(UserRequest UserInfo)
        {
            Epi.Web.Interfaces.DataInterfaces.IDaoFactory entityDaoFactory = new EF.EntityDaoFactory();
            Epi.Web.Interfaces.DataInterfaces.IUserDao    IUserDao         = new EF.EntityUserDao();
            Epi.Web.BLL.User Implementation = new Epi.Web.BLL.User(IUserDao);

            var            UserBO = Mapper.ToUserBO(UserInfo.User);
            OrganizationBO OrgBO  = new OrganizationBO();

            OrgBO = Mapper.ToBusinessObject(UserInfo.Organization);
            return(Implementation.UpdateUser(UserBO, OrgBO));
        }
Example #3
0
        public UserResponse GetUserByUserId(UserRequest UserInfo)
        {
            UserResponse UserResponse = new UserResponse();

            Epi.Web.Interfaces.DataInterfaces.IUserDao IUserDao = new EF.EntityUserDao();
            Epi.Web.BLL.User Implementation = new Epi.Web.BLL.User(IUserDao);
            var CurrentUser = Implementation.GetUserByUserId(Mapper.ToUserBO(UserInfo.User), Mapper.ToBusinessObject(UserInfo.Organization));

            UserResponse.User = new List <UserDTO>();
            UserResponse.User.Add(Mapper.ToUserDTO(CurrentUser));


            return(UserResponse);
        }
Example #4
0
        public UserResponse GetUserListByOrganization(UserRequest UserInfo)
        {
            UserResponse UserResponse = new UserResponse();
            UserRequest  UserRequest  = new UserRequest();



            Epi.Web.Interfaces.DataInterfaces.IOrganizationDao IOrganizationDao = new EF.EntityOrganizationDao();
            Epi.Web.BLL.Organization OrgImplementation = new Epi.Web.BLL.Organization(IOrganizationDao);


            OrganizationBO OrganizationBO = OrgImplementation.GetOrganizationByKey(UserInfo.Organization.OrganizationKey);



            Epi.Web.Interfaces.DataInterfaces.IDaoFactory entityDaoFactory = new EF.EntityDaoFactory();
            Epi.Web.Interfaces.DataInterfaces.IUserDao    IUserDao         = new EF.EntityUserDao();
            Epi.Web.BLL.User Implementation = new Epi.Web.BLL.User(IUserDao);
            UserResponse.User = Mapper.ToUserDTO(Implementation.GetUsersByOrgId(OrganizationBO.OrganizationId));

            return(UserResponse);
        }
Example #5
0
        public UserResponse GetLoginToken(UserRequest UserInfo)
        {
            UserResponse UserResponse = new UserResponse();
            UserRequest  UserRequest  = new UserRequest();


            try
            {
                Epi.Web.Interfaces.DataInterfaces.IUserDao IUserDao = new EF.EntityUserDao();
                Epi.Web.BLL.User Implementation = new Epi.Web.BLL.User(IUserDao);
                bool             UserExist      = Implementation.GetExistingUser(Mapper.ToUserBO(UserRequest.User));

                if (UserExist)
                {
                    UserResponse.Message = ConfigurationManager.AppSettings[""];
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(UserResponse);
        }