Exemplo n.º 1
0
        public ActionResult ListofServices(int?page)
        {
            long userId = 0;

            if (User.Identity.IsAuthenticated)
            {
                userId = RegistrationProvider.GetUseridfromUsername(User.Identity.Name);
            }
            int pageSize  = 5;
            int pageIndex = 1;

            pageIndex = page.HasValue ? Convert.ToInt32(page) : 1;
            JobList model = new JobList();

            if (Session["ListOfJobs"] != null)
            {
                model = (JobList)Session["ListOfJobs"];
            }
            else
            {
                model = JobsProvider.GetAllJobs(userId);
                Session["ListOfJobs"] = model;
            }
            model.Jobs = model.Jobs.OrderByDescending(x => x.Job_details_id).ToList();
            //ServiceDomainModel domains = new ServiceDomainModel();
            // domains = model.ServiceDomain.Where(x => x.Service_domain_id == domainid).FirstOrDefault();
            return(PartialView("_Employers", model.Jobs.ToPagedList(pageIndex, pageSize)));
        }
Exemplo n.º 2
0
        public ActionResult Details(string ID)
        {
            long userId = 0;

            if (User.Identity.IsAuthenticated)
            {
                userId = RegistrationProvider.GetUseridfromUsername(User.Identity.Name);
            }
            var     id    = long.Parse(ID);
            JobList model = new JobList();

            if (Session["ListOfJobs"] != null)
            {
                model = (JobList)Session["ListOfJobs"];
            }
            else
            {
                model = JobsProvider.GetAllJobs(userId);

                Session["ListOfJobs"] = model;
            }
            var result = model.Jobs.Where(x => x.Job_details_id == id).FirstOrDefault();

            return(View(result));
        }
Exemplo n.º 3
0
        public async Task <ActionResult> UpdatePassword([Bind(Include = "password,confirm,token")] string password, string confirm, string token)
        {
            ResetPasswordModel model = new ResetPasswordModel();

            model.password   = password;
            model.used_on_ip = ClsFunction.GetVisitorIPAddress();
            model.token      = token;
            var res   = RegistrationProvider.ResetPassword(model.password, model.token, model.used_on_ip);
            var MODEL = new ResetPasswordModel();

            if (res == "S")
            {
                return(Json(new { success = true, message = "Successfully done!", data = MODEL }, JsonRequestBehavior.DenyGet));
            }
            else if (res == "LE")
            {
                return(Json(new { success = false, message = "Link has been expired" }, JsonRequestBehavior.DenyGet));
            }
            else
            {
                return(Json(new { success = false, message = "Resetting Password Failed" }, JsonRequestBehavior.DenyGet));
            }

            return(Json(new { success = false, message = "Resetting Password Failed" }, JsonRequestBehavior.DenyGet));
        }
Exemplo n.º 4
0
        public ActionResult SearchJobsPost()
        {
            long userId = 0;

            if (User.Identity.IsAuthenticated)
            {
                userId = RegistrationProvider.GetUseridfromUsername(User.Identity.Name);
            }
            JobList model = new JobList();

            //DataTable dt = loc;


            if (Session["ListOfJobs"] != null)
            {
                model = (JobList)Session["ListOfJobs"];
            }
            else
            {
                model = JobsProvider.GetAllJobs(userId);

                Session["ListOfJobs"] = model;
            }

            return(PartialView("_MainSearchJobs", model.Jobs));
        }
Exemplo n.º 5
0
        public async Task <ActionResult> ResetPassword([Bind(Include = "id")] string id)
        {
            var ID = RegistrationProvider.GetUserId(id);
            ResetPasswordModel model = new ResetPasswordModel();
            string             str   = "";

            model.token = id;
            if (model.token != null)
            {
                str = RegistrationProvider.CheckpasswordToken(model.token);
                if (str == "S")
                {
                    TempData["ResetPassword"] = "******";
                    return(View(model));
                }
                else if (str == "LE")
                {
                    TempData["Error"] = "Link has been expired";
                    return(RedirectToAction("Error", "Home"));
                }
                else
                {
                    TempData["Error"] = "Something went wrong Please try again later";
                    return(RedirectToAction("Error", "Home"));
                }
            }
            TempData["Error"] = "Something went wrong Please try again later";
            return(RedirectToAction("Error", "Home"));
        }
 public int Save_Registered_User_Request(tblUserRegistrationRequestDto userRegistrationRequestDto)
 {
     int result = 0;
     RegistrationProvider objUserProfileDataProvider = new RegistrationProvider();
     result = objUserProfileDataProvider.Save_Registered_User_Request(userRegistrationRequestDto);
     return result;
 }
 public int Save_Registered_User(tblRegisteredUserDto registeredUserDto)
 {
     int result = 0;
     RegistrationProvider objUserProfileDataProvider = new RegistrationProvider();
     result = objUserProfileDataProvider.Save_Registered_User(registeredUserDto);
     return result;
 }
Exemplo n.º 8
0
        public ActionResult FilterList(string jobId, string city, int?page)
        {
            long userId = 0;

            if (User.Identity.IsAuthenticated)
            {
                userId = RegistrationProvider.GetUseridfromUsername(User.Identity.Name);
            }
            int pageSize  = 5;
            int pageIndex = 1;

            pageIndex = page.HasValue ? Convert.ToInt32(page) : 1;
            JobList model = new JobList();

            if (Session["ListOfJobs"] != null)
            {
                model = (JobList)Session["ListOfJobs"];
            }
            else
            {
                model = JobsProvider.GetAllJobs(userId);
                Session["ListOfJobs"] = model;
            }
            model.Jobs = model.Jobs.Where(x => x.Job_details_id == Convert.ToInt32(jobId) || x.Job_city == city).OrderByDescending(x => x.Job_details_id).ToList();
            return(PartialView("_Employers", model.Jobs.ToPagedList(pageIndex, pageSize)));
        }
Exemplo n.º 9
0
        public async Task <ActionResult> Confirmation([Bind(Include = "id")] string id)
        {
            string usedon_ip = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
            string UsedOnIp  = ClsFunction.GetVisitorIPAddress();
            string Token     = id;

            if (!string.IsNullOrEmpty(UsedOnIp) && !string.IsNullOrEmpty(Token))
            {
                var result = RegistrationProvider.ActivateRegistration(Token, UsedOnIp);

                if (result == "S")
                {
                    TempData["Success"] = "Registration Activated";
                    return(RedirectToAction("Success", "Home"));
                }
                else if (result == "LE")
                {
                    TempData["Error"] = "Link is Expired";
                    return(RedirectToAction("Error", "Home"));
                }
                else
                {
                    TempData["Error"] = "Failed";
                    return(RedirectToAction("Error", "Home"));
                }
            }
            TempData["Error"] = "Sonething went Wrong Please try again!";
            return(RedirectToAction("Error", "Home"));
        }
Exemplo n.º 10
0
        public JsonResult Register(RegistrationRequest requests)
        {
            var provider = new RegistrationProvider();

            var response = provider.Register(requests);

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 11
0
        public Response FuncRegister(RegisteredUser User)
        {
            Response res = new Response();

            if (User != null)
            {
                var user_status = RegistrationProvider.CheckUserAvailability(User.Username);

                var flag = false;

                if (user_status == "S")
                {
                    flag = RegistrationProvider.RegisterUser(User);
                    if (flag)
                    {
                        res.IsValid      = true;
                        res.ErrorCode    = ((int)ErrorProvider.ErrorCode.RegistrationSucces).ToString();
                        res.ErrorMessage = "Registration has been done Successfully";
                        return(res);
                    }
                    else
                    {
                        res.IsValid      = false;
                        res.ErrorCode    = ((int)ErrorProvider.ErrorCode.RegistrationFailed).ToString();
                        res.ErrorMessage = "Registration has been failed";
                        return(res);
                    }
                }
                else if (user_status == "NA")
                {
                    res.IsValid      = false;
                    res.ErrorCode    = ((int)ErrorProvider.ErrorCode.UserInActive).ToString();
                    res.ErrorMessage = "User is Not Active";
                    return(res);
                }
                else
                {
                    res.IsValid      = false;
                    res.ErrorCode    = ((int)ErrorProvider.ErrorCode.UserExists).ToString();
                    res.ErrorMessage = "User Already Exists";
                    return(res);
                }
            }
            res.IsValid      = false;
            res.ErrorCode    = ((int)ErrorProvider.ErrorCode.UserExists).ToString();
            res.ErrorMessage = "User Already Exists";
            return(res);
        }
Exemplo n.º 12
0
        public override bool ValidateUser(string username, string password)
        {
            LoginModel model = new LoginModel();

            model.Username = username;
            model.Password = password;
            var response = RegistrationProvider.Login(model);

            //var response = Account.Login(new LoginModel() { Username = username, Password = password });

            if (response.IsValid)
            {
                return(true);
            }
            throw new Exception(response.ErrorMessage);
        }
Exemplo n.º 13
0
 public ActionResult ForgotPassword(ForgotPasswordModel model)
 {
     try
     {
         model.deviceId = ClsFunction.GetVisitorIPAddress();
         var res = RegistrationProvider.GetUsersNamecheck(model.username, model.deviceId);
         if (res)
         {
             return(Json(new { title = "ForgotPassword", success = true, message = "Email has been sent to you with the Link" }, JsonRequestBehavior.DenyGet));
         }
         else
         {
             return(Json(new { title = "ForgotPassword", success = false, message = "User Does not Exist" }, JsonRequestBehavior.DenyGet));
         }
     }
     catch (Exception ex)
     {
         return(Json(new { title = "ForgotPassword", success = false, message = "Something went Wrong Please try again" }, JsonRequestBehavior.DenyGet));
     }
 }
Exemplo n.º 14
0
        //
        // GET: /Jobs/

        public ActionResult Index(string search, string city, int?page)
        {
            long userId = 0;

            if (User.Identity.IsAuthenticated)
            {
                userId = RegistrationProvider.GetUseridfromUsername(User.Identity.Name);
            }
            int pageSize  = 5;
            int pageIndex = 1;

            pageIndex = page.HasValue ? Convert.ToInt32(page) : 1;
            JobList model = new JobList();

            model = JobsProvider.GetAllJobs(userId);
            Session["ListOfJobs"] = model;

            JobList mod = new JobList();

            mod.Jobs = new List <JobDetailsModel>();
            var list = model.Jobs.Where(x => x.Applied == null).ToList();

            if ((search != null && search != "") && (city != null && city != ""))
            {
                mod.Jobs = list.Where(x => x.Job_city == city && x.Job_title.Contains(search)).OrderByDescending(x => x.Job_details_id).ToList();
            }
            else if (search != null && search != "")
            {
                mod.Jobs = list.Where(x => x.Job_title.Contains(search)).OrderByDescending(x => x.Job_details_id).ToList();
            }
            else if (city != null && city != "")
            {
                mod.Jobs = list.Where(x => x.Job_city == city).OrderByDescending(x => x.Job_details_id).ToList();
            }
            else
            {
                mod.Jobs = list.ToList();
            }
            return(View(mod.Jobs.ToPagedList(pageIndex, pageSize)));
        }
Exemplo n.º 15
0
        public ActionResult ApplyJobs(MultipleJobsModel model)
        {
            long userId = 0;

            if (User.Identity.IsAuthenticated)
            {
                userId = RegistrationProvider.GetUseridfromUsername(User.Identity.Name);
                if (model != null)
                {
                    model.Registered_user_id = userId;
                    model.Applied_date       = DateTime.Now;
                    var res = JobsProvider.ApplicationStatus(model);
                    if (res)
                    {
                        TempData["Success"] = "Job has been applied we may get back to you.";
                        return(Json(new { title = "Favrequest", success = true, message = "S" }, JsonRequestBehavior.DenyGet));
                    }
                    TempData["Error"] = "Failed.";
                    return(Json(new { title = "Favrequest", success = true, message = "F" }, JsonRequestBehavior.DenyGet));
                }
            }
            return(Json(new { title = "Favrequest", success = true, message = "NA" }, JsonRequestBehavior.DenyGet));
        }
Exemplo n.º 16
0
        public ActionResult AppliedJobs(int?page)
        {
            long userId = 0;

            if (User.Identity.IsAuthenticated)
            {
                userId = RegistrationProvider.GetUseridfromUsername(User.Identity.Name);
            }
            int pageSize  = 5;
            int pageIndex = 1;

            pageIndex = page.HasValue ? Convert.ToInt32(page) : 1;
            JobList model = new JobList();

            model = JobsProvider.GetAllJobs(userId);
            Session["ListOfJobs"] = model;

            JobList mod = new JobList();

            mod.Jobs = new List <JobDetailsModel>();
            var list = model.Jobs.Where(x => x.Applied != null).ToList();

            return(View(list.ToPagedList(pageIndex, pageSize)));
        }
Exemplo n.º 17
0
 public RegistrationProviderService(RegistrationProvider provider)
 {
     _provider = provider ?? new RegistrationProvider();
 }
Exemplo n.º 18
0
 internal Interactors(Func <string> newId, Func <string> newCode, Func <DateTime> now)
 {
     _newCode = newCode;
     _registrationProvider = new RegistrationProvider(newId);
     _now = now;
 }
 protected void SetRegistrationProvider(RegistrationProvider provider)
 {
     _provider = provider;
 }
Exemplo n.º 20
0
 public async Task <ActionResult> Login([Bind(Include = "user,word,rememberme")] string user, string word, string rememberme)
 {
     try
     {
         HttpContext.User = null;
         FormsAuthentication.SignOut();
         LoginModel model = new LoginModel();
         model.Username  = user;
         model.Password  = word;
         model.IpAddress = ClsFunction.GetVisitorIPAddress();
         model.Type      = "WEB";
         bool RememberMe = false;
         if (rememberme != null)
         {
             RememberMe = true;
         }
         else
         {
             RememberMe = false;
         }
         Response res = new Response();
         res = RegistrationProvider.LoginFunc(model);
         if (res.ErrorCode == ((int)ErrorProvider.ErrorCode.LoginSuccess).ToString())
         {
             FormsAuthentication.SetAuthCookie(user, RememberMe);
             Session["LoginAttempts"] = 0;
             return(Json(new { title = "Login", success = true, message = res.ErrorMessage, failcount = Session["LoginAttempts"].ToString() }, JsonRequestBehavior.DenyGet));
         }
         else if (res.ErrorCode == ((int)ErrorProvider.ErrorCode.FirstLogin).ToString())
         {
             FormsAuthentication.SetAuthCookie(user, RememberMe);
             Session["LoginAttempts"] = 0;
             return(Json(new { title = "Login", success = true, message = res.ErrorMessage, failcount = Session["LoginAttempts"].ToString() }, JsonRequestBehavior.DenyGet));
         }
         else if (res.ErrorCode == ((int)ErrorProvider.ErrorCode.LoginFailure).ToString())
         {
             if (Session["LoginAttempts"] == null)
             {
                 Session["LoginAttempts"] = 1;
             }
             else
             {
                 Session["LoginAttempts"] = 1 + (int)Session["LoginAttempts"];
             }
             return(Json(new { title = "Login", success = false, message = res.ErrorMessage, failcount = Session["LoginAttempts"].ToString() }, JsonRequestBehavior.DenyGet));
         }
         else if (res.ErrorCode == ((int)ErrorProvider.ErrorCode.InvalidUserNamePass).ToString())
         {
             if (Session["LoginAttempts"] == null)
             {
                 Session["LoginAttempts"] = 1;
             }
             else
             {
                 Session["LoginAttempts"] = 1 + (int)Session["LoginAttempts"];
             }
             return(Json(new { title = "Login", success = false, message = res.ErrorMessage, failcount = Session["LoginAttempts"].ToString() }, JsonRequestBehavior.DenyGet));
         }
         else if (res.ErrorCode == ((int)ErrorProvider.ErrorCode.UserNotExist).ToString())
         {
             if (Session["LoginAttempts"] == null)
             {
                 Session["LoginAttempts"] = 1;
             }
             else
             {
                 Session["LoginAttempts"] = 1 + (int)Session["LoginAttempts"];
             }
             return(Json(new { title = "Login", success = false, message = res.ErrorMessage, failcount = Session["LoginAttempts"].ToString() }, JsonRequestBehavior.DenyGet));
         }
         else
         {
             if (Session["LoginAttempts"] == null)
             {
                 Session["LoginAttempts"] = 1;
             }
             else
             {
                 Session["LoginAttempts"] = 1 + (int)Session["LoginAttempts"];
             }
             return(Json(new { title = "Login", success = false, message = "Something Went Wrong Please Try again", failcount = Session["LoginAttempts"].ToString() }, JsonRequestBehavior.DenyGet));
         }
     }
     catch (Exception ex)
     {
         if (Session["LoginAttempts"] == null)
         {
             Session["LoginAttempts"] = 1;
         }
         else
         {
             Session["LoginAttempts"] = 1 + (int)Session["LoginAttempts"];
         }
         return(Json(new { title = "Login", success = true, message = "Something went wrong Please try again later", failcount = Session["LoginAttempts"].ToString() }, JsonRequestBehavior.DenyGet));
     }
 }