public ActionResult Index(ApplyVisa AV)
        {
            var    username = Request.Cookies["UserName"].Value.ToString();
            int    userId   = DbOperation.FetchIdByUserName(username);
            string us       = DbOperation.FetchPassportNumber(userId);
            string Visa     = DbOperation.FetchVisaNumber(userId);

            AV.VisaNumber             = Visa;
            AV.UserId                 = userId;
            Session["PassportNumber"] = us;
            if (checkForCancelVisaValidation(AV))
            {
                return(View());
            }
            bool successful = DbOperation.VisaCancel(AV);

            if (successful)
            {
                var json = DbOperation.fetchApplyVisabyUserId(userId);
                Session["successMsg"] = "Your request has been submitted successfully. Please pay " + json[0].CancellationCharge + " to complete the cancellation process";

                return(Redirect("/CancelVisaSuccess"));
            }
            else
            {
                return(View());
            }
        }
Beispiel #2
0
        // GET: ReIssuePassport
        //[Authorize]
        public ActionResult Index()
        {
            if (Request.Cookies["UserName"] == null)
            {
                return(Redirect("/SignIn"));
            }
            var username = Request.Cookies["UserName"].Value.ToString();
            int userId   = DbOperation.FetchIdByUserName(username);

            if (!DbOperation.CheckUserHaveApplyPassport(userId))
            {
                return(Redirect("/ReissuePassportError"));
            }
            else
            {
                ApplyPassport         C              = new ApplyPassport();
                Service1Client        PVMS           = new Service1Client();
                Country[]             D              = PVMS.FetchCountries();
                List <SelectListItem> CountrynewList = new List <SelectListItem>();
                CountrynewList.Add(new SelectListItem {
                    Text = "Select Country", Value = "-1"
                });
                for (var i = 0; i < D.Length; i++)
                {
                    CountrynewList.Add(new SelectListItem {
                        Text = D[i].CountryName, Value = D[i].CountryId.ToString()
                    });
                }
                ViewBag.CountryDD = CountrynewList.ToList();
                return(View(C));
            }
        }
Beispiel #3
0
        public ActionResult Index(ApplyVisa AV)
        {
            Service1Client PVMS = new Service1Client();
            Country[] D = PVMS.FetchCountries();
            ViewBag.CountryDD = D.ToList();
            var username = Request.Cookies["UserName"].Value.ToString();
            int userId = DbOperation.FetchIdByUserName(username);
            AV.UserId = userId;
            if (checkForApplyVisaValidation(AV))
            {
                return View();
            }
            bool successful =DbOperation.ApplyingVisa(AV);
            if (successful)
            {
                var json = DbOperation.fetchApplyVisabyUserId(userId);
                string destination = DbOperation.fetchCountryStateCityById(json[0].CountryId);
                Session["successMsg"] = "Dear User your Visa request has been accepted successfully with id " + json[0].VisaNumber  +" ,UserId " + username + " Destination " + destination + " Employee Occupation " + json[0].Occupation + " Date of Application " + json[0].DateOfApplication.ToString("dd-MM-yyyy") + " Date of Issue " + json[0].DateOfIssue.ToString("dd-MM-yyyy") + "\n Date of Expiry " + json[0].DateOfExpiry.ToString("dd-MM-yyyy") + " Registration Cost " + json[0].RegistrationCost;

                return Redirect("/ApplyVisaSuccess");
            }
            else
            {
                return View();
            }

        }
Beispiel #4
0
        public ActionResult Index(ApplyPassport A)
        {
            var username = Request.Cookies["UserName"].Value.ToString();

            ViewBag.CountryDD = null;
            Service1Client PVMS = new Service1Client();

            Country[]             D = PVMS.FetchCountries();
            List <SelectListItem> CountrynewList = new List <SelectListItem>();

            CountrynewList.Clear();
            CountrynewList.Add(new SelectListItem {
                Text = "Select Country", Value = "-1"
            });
            for (var i = 0; i < D.Length; i++)
            {
                CountrynewList.Add(new SelectListItem {
                    Text = D[i].CountryName, Value = D[i].CountryId.ToString()
                });
            }
            ViewBag.CountryDD = CountrynewList.ToList();
            if (checkForApplyPassportValidation(A))
            {
                return(View());
            }
            int userId = DbOperation.FetchIdByUserName(username);

            if (DbOperation.CheckUserHaveApplyPassport(userId))
            {
                return(Redirect("/ApplyPassportError"));
            }
            else
            {
                A.UserId = userId;
                bool successful = DbOperation.ApplyPassportNew(A);
                if (successful)
                {
                    var json = DbOperation.fetchApplyPassportbyUserId(userId);
                    Session["PassportNumber"] = json[0].PassportNumber;
                    Session["Amount"]         = json[0].Amount;
                    Session["successMsg"]     = "<b>Need the passport number while giving payment? Please note down your Id \n </b> \n" + json[0].PassportNumber + ".Passport application cost is Rs." + json[0].Amount;

                    return(Redirect("/ApplyPassportSuccess"));
                }
                else
                {
                    return(View());
                }
            }
        }
        public ActionResult Index(User U)
        {
            var username = Request.Cookies["UserName"].Value.ToString();
            int userId   = DbOperation.FetchIdByUserName(username);

            TempData["HintQuestion"] = DbOperation.FetchHintQuestionByUserName(username);
            U.UserId = username;

            if (DbOperation.Authenticity(U))
            {
                return(Redirect("/VisaCancellation"));
            }
            else
            {
                TempData["Msg"] = "Answer does not Match.Please Try Again";
                return(View());
            }
        }
Beispiel #6
0
        public ActionResult Index(ApplyPassport A)
        {
            var username = Request.Cookies["UserName"].Value.ToString();

            ViewBag.CountryDD = null;
            Service1Client PVMS = new Service1Client();

            Country[]             D = PVMS.FetchCountries();
            List <SelectListItem> CountrynewList = new List <SelectListItem>();

            CountrynewList.Clear();
            CountrynewList.Add(new SelectListItem {
                Text = "Select Country", Value = "-1"
            });
            for (var i = 0; i < D.Length; i++)
            {
                CountrynewList.Add(new SelectListItem {
                    Text = D[i].CountryName, Value = D[i].CountryId.ToString()
                });
            }
            ViewBag.CountryDD = CountrynewList.ToList();
            int userId = DbOperation.FetchIdByUserName(username);

            A.UserId = userId;
            if (checkForReissuePassportValidation(A))
            {
                return(View());
            }
            bool successful = DbOperation.ReissuePassport(A);

            if (successful)
            {
                var json = DbOperation.fetchApplyPassportbyUserId(userId);
                Session["PassportNumber"] = json[0].PassportNumber;
                Session["Amount"]         = json[0].Amount;
                Session["successMsg"]     = "<b>Passport re issue is successfully done.</b>\n Amount to be paid is Rs." + json[0].Amount + " Passport issue date is " + json[0].IssueDate.ToString("dd-MM-yyyy") + " and expiry date is " + json[0].ExpiryDate.ToString("dd-MM-yyyy");

                return(Redirect("/ReIssuePassportSuccess"));
            }
            else
            {
                return(View());
            }
        }
        // GET: VisaCancellation
        //[Authorize]
        public ActionResult Index()
        {
            if (Request.Cookies["UserName"] == null)
            {
                return(Redirect("/SignIn"));
            }
            var username = Request.Cookies["UserName"].Value.ToString();
            int userId   = DbOperation.FetchIdByUserName(username);

            if (!DbOperation.CheckUserHaveApplyVisa(userId))
            {
                return(Redirect("/CancelVisaError"));
            }
            else
            {
                Session["PassportNumber"] = DbOperation.FetchPassportNumber(userId);
                Session["VisaNumber"]     = DbOperation.FetchVisaNumber(userId);

                ApplyVisa AV = new ApplyVisa();
                return(View(AV));
            }
        }
Beispiel #8
0
 // GET: ApplyVisa
 //[Authorize]
 public ActionResult Index()
 {
     if (Request.Cookies["UserName"] == null)
     {
         return Redirect("/SignIn");
     }
     var username = Request.Cookies["UserName"].Value.ToString();
     int userId = DbOperation.FetchIdByUserName(username);
     if (!DbOperation.CheckUserHaveApplyPassport(userId))
     {
         return Redirect("/ApplyVisaError");
     }
     else
     {
     ApplyVisa V = new ApplyVisa();
     Service1Client PVMS = new Service1Client();
     Country[] D = PVMS.FetchCountries();
     ViewBag.CountryDD = D.ToList();
     return View(V);
         
     }
 }