Esempio n. 1
0
 public ActionResult TravelDocumentation(string id = "", string a = "", string p = "")
 {
     try
     {
         ViewBag.StudentID     = id;
         ViewBag.ApplicationNo = StringCipher.Decrypt(a);
         ViewBag.ProgramLevel  = p;
         TravelPlanRepository _objRepo = new TravelPlanRepository();
         DataSet _ds = _objRepo.SELECT_Student_TravelPlan_Status(ViewBag.StudentID);
         if (_ds != null)
         {
             if (_ds.Tables[0].Rows.Count > 0)
             {
                 foreach (DataRow _dr in _ds.Tables[0].Rows)
                 {
                     ViewBag.HasPassportDetails      = _dr["HasPassportDetails"].ToString();
                     ViewBag.HasAirTicketDetails     = _dr["HasAirTicketDetails"].ToString();
                     ViewBag.HasVisaDetails          = _dr["HasVisaDetails"].ToString();
                     ViewBag.HasInstituteSpocDetails = _dr["HasInstituteSpocDetails"].ToString();
                     ViewBag.IsAdmittedByInstitute   = _dr["IsAdmittedByInstitute"].ToString();
                 }
             }
         }
     }
     catch (Exception)
     {
         throw;
     }
     return(View());
 }
        public JsonResult SelectAirTicket()
        {
            string Message = string.Empty, Code = string.Empty, Error = string.Empty;
            List <mTravelPlanAirTicket> _list = new List <mTravelPlanAirTicket>();

            try
            {
                TravelPlanRepository _objRepo = new TravelPlanRepository();
                DataSet _ds = _objRepo.SELECT_StudentTravelPlanAirTicket(Session["studentid"].ToString(), Session["ApplicationNo"].ToString());
                if (_ds != null)
                {
                    if (_ds.Tables[0].Rows.Count > 0)
                    {
                        foreach (DataRow _dr in _ds.Tables[0].Rows)
                        {
                            _list.Add(new mTravelPlanAirTicket
                            {
                                ID = _dr["ID"].ToString(),
                                HaveBookedTicket        = (_dr["HaveBookedTicket"] != null ? _dr["HaveBookedTicket"].ToString() : ""),
                                LandingDate             = (_dr["LandingDate"] != null ? (_dr["LandingDate"].ToString() != "" ? Convert.ToDateTime(_dr["LandingDate"].ToString()).ToString("dd-MM-yyyy") : "") : ""),
                                LandingTime             = (_dr["LandingTime"] != null ? _dr["LandingTime"].ToString() : ""),
                                OriginCountry           = (_dr["OriginCountry"] != null ? _dr["OriginCountry"].ToString() : ""),
                                OriginAirport           = (_dr["OriginAirport"] != null ? _dr["OriginAirport"].ToString() : ""),
                                DestinationCountry      = (_dr["DestinationCountry"] != null ? _dr["DestinationCountry"].ToString() : ""),
                                DestinationAirport      = (_dr["DestinationAirport"] != null ? _dr["DestinationAirport"].ToString() : ""),
                                OtherOriginAirport      = (_dr["OtherOriginAirport"] != null ? _dr["OtherOriginAirport"].ToString() : ""),
                                OtherDestinationAirport = (_dr["OtherDestinationAirport"] != null ? _dr["OtherDestinationAirport"].ToString() : ""),
                                ETicket = (_dr["ETicket"] != null ? _dr["ETicket"].ToString() : "")
                            });
                        }
                        Message = "Data filled.";
                        Code    = "success";
                    }
                }
            }
            catch (NullReferenceException ex)
            {
                Message = "Your session has been expired. Kindly login again.";
                Code    = "sessionexpired";
                Error   = ex.Message;
            }
            catch (Exception ex)
            {
                Message = "Error from server side. Kindly refresh the page and try again.";
                Code    = "servererror";
                Error   = ex.Message;
            }
            return(Json(new
            {
                m = Message,
                c = Code,
                e = Error,
                List = _list
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
        public JsonResult SelectPassport()
        {
            string Message = string.Empty, Code = string.Empty, Error = string.Empty;
            List <mTravelPlanPassport> _list = new List <mTravelPlanPassport>();

            try
            {
                TravelPlanRepository _objRepo = new TravelPlanRepository();
                DataSet _ds = _objRepo.SELECT_StudentTravelPlanPassport(Session["studentid"].ToString(), Session["ApplicationNo"].ToString());
                if (_ds != null)
                {
                    if (_ds.Tables[0].Rows.Count > 0)
                    {
                        foreach (DataRow _dr in _ds.Tables[0].Rows)
                        {
                            _list.Add(new mTravelPlanPassport
                            {
                                ID = _dr["ID"].ToString(),
                                HaveValidPassport    = (_dr["HaveValidPassport"] != null ? _dr["HaveValidPassport"].ToString() : ""),
                                PassportNumber       = (_dr["PassportNumber"] != null ? _dr["PassportNumber"].ToString() : ""),
                                PassportExpiryDate   = (_dr["PassportExpiryDate"] != null ? (_dr["PassportExpiryDate"].ToString() != "" ? Convert.ToDateTime(_dr["PassportExpiryDate"].ToString()).ToString("dd-MM-yyyy") : "") : ""),
                                PassportDocument     = (_dr["PassportDocument"] != null ? _dr["PassportDocument"].ToString() : ""),
                                ApplicationNumber    = (_dr["ApplicationNumber"] != null ? _dr["ApplicationNumber"].ToString() : ""),
                                ApplicationDocument  = (_dr["ApplicationDocument"] != null ? _dr["ApplicationDocument"].ToString() : ""),
                                CitizenshipNumber    = (_dr["CitizenshipNumber"] != null ? _dr["CitizenshipNumber"].ToString() : ""),
                                CitizenshipIssueDate = (_dr["CitizenshipIssueDate"] != null ? (_dr["CitizenshipIssueDate"].ToString() != "" ? Convert.ToDateTime(_dr["CitizenshipIssueDate"].ToString()).ToString("dd-MM-yyyy") : "") : ""),
                                CitizenshipDocument  = (_dr["CitizenshipDocument"] != null ? _dr["CitizenshipDocument"].ToString() : "")
                            });
                        }
                        Message = "Data filled.";
                        Code    = "success";
                    }
                }
            }
            catch (NullReferenceException ex)
            {
                Message = "Your session has been expired. Kindly login again.";
                Code    = "sessionexpired";
                Error   = ex.Message;
            }
            catch (Exception ex)
            {
                Message = "Error from server side. Kindly refresh the page and try again.";
                Code    = "servererror";
                Error   = ex.Message;
            }
            return(Json(new
            {
                m = Message,
                c = Code,
                e = Error,
                List = _list
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
Esempio n. 4
0
        public JsonResult SaveInstituteSpoc(mTravelPlanInstituteSpoc _obj)
        {
            string Message = string.Empty, Code = string.Empty, Error = string.Empty;

            try
            {
                _obj.InstituteID = Session["InstituteID"].ToString();
                _obj.CreatedIP   = Session["localIP"].ToString();
                TravelPlanRepository _objRepo = new TravelPlanRepository();
                DataSet _ds = _objRepo.INSERT_UPDATE_StudentTravelInstituteSpoc(_obj);
                if (_ds != null)
                {
                    if (_ds.Tables[0].Rows.Count > 0)
                    {
                        if (_ds.Tables[0].Rows[0]["COUNTS"].ToString() == "1")
                        {
                            Message = "Details has been saved successfully!";
                            Code    = "success";
                        }
                    }
                    else
                    {
                        Message = "Error from server side. Kindly refresh the page and try again.";
                        Code    = "servererror";
                    }
                }
                else
                {
                    Message = "Error from server side. Kindly refresh the page and try again.";
                    Code    = "servererror";
                }
            }
            catch (NullReferenceException ex)
            {
                Message = "Your session has been expired. Kindly login again.";
                Code    = "sessionexpired";
                Error   = ex.Message;
            }
            catch (Exception ex)
            {
                Message = "Error from server side. Kindly refresh the page and try again.";
                Code    = "servererror";
                Error   = ex.Message;
            }

            return(Json(new
            {
                m = Message,
                c = Code,
                e = Error
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
        public JsonResult SeletAirports(string Country_id = "0")
        {
            string Message = string.Empty, Code = string.Empty, Error = string.Empty;
            List <mTravelPlanAirports> _list = new List <mTravelPlanAirports>();

            try
            {
                TravelPlanRepository _objRepo = new TravelPlanRepository();
                DataSet _ds = _objRepo.SELECT_COUNTRY_WISE_AIRPORTS(Country_id);
                if (_ds != null)
                {
                    if (_ds.Tables[0].Rows.Count > 0)
                    {
                        foreach (DataRow _dr in _ds.Tables[0].Rows)
                        {
                            _list.Add(new mTravelPlanAirports
                            {
                                ID          = _dr["ID"].ToString(),
                                name        = (_dr["name"] != null ? _dr["name"].ToString() : ""),
                                Country     = (_dr["Country"] != null ? _dr["Country"].ToString() : ""),
                                Region      = (_dr["Region"] != null ? _dr["Region"].ToString() : ""),
                                iso_country = (_dr["iso_country"] != null ? _dr["iso_country"].ToString() : ""),
                            });
                        }
                        Message = "Data filled.";
                        Code    = "success";
                    }
                }
            }
            catch (NullReferenceException ex)
            {
                Message = "Your session has been expired. Kindly login again.";
                Code    = "sessionexpired";
                Error   = ex.Message;
            }
            catch (Exception ex)
            {
                Message = "Error from server side. Kindly refresh the page and try again.";
                Code    = "servererror";
                Error   = ex.Message;
            }
            return(Json(new
            {
                m = Message,
                c = Code,
                e = Error,
                List = _list
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
Esempio n. 6
0
        public JsonResult DeleteInstituteSpoc(string id, string ProgramLevel = "")
        {
            string Message = string.Empty, Code = string.Empty, Error = string.Empty;
            List <mTravelPlanInstituteSpoc> _list = new List <mTravelPlanInstituteSpoc>();

            try
            {
                TravelPlanRepository _objRepo = new TravelPlanRepository();
                DataSet _ds = _objRepo.DELETE_StudentTravelInstituteSpoc(id, Session["InstituteID"].ToString(), ProgramLevel);
                if (_ds != null)
                {
                    if (_ds.Tables[0].Rows.Count > 0)
                    {
                        Message = "Details has been deleted successfully!";
                        Code    = "success";
                    }
                    else
                    {
                        Message = "Error from server side. Kindly refresh the page and try again.";
                        Code    = "servererror";
                    }
                }
                else
                {
                    Message = "Error from server side. Kindly refresh the page and try again.";
                    Code    = "servererror";
                }
            }
            catch (NullReferenceException ex)
            {
                Message = "Your session has been expired. Kindly login again.";
                Code    = "sessionexpired";
                Error   = ex.Message;
            }
            catch (Exception ex)
            {
                Message = "Error from server side. Kindly refresh the page and try again.";
                Code    = "servererror";
                Error   = ex.Message;
            }

            return(Json(new
            {
                m = Message,
                c = Code,
                e = Error,
                List = _list
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
Esempio n. 7
0
        public JsonResult StudentAdmitted(string StudentID = "", string ProgramLevel = "", string Admitted = "")
        {
            string Code = string.Empty, Message = string.Empty, Error = string.Empty;

            try
            {
                TravelPlanRepository _objRepo = new TravelPlanRepository();
                DataSet _ds = _objRepo.STUDENT_ADMITTED_BY_INSTITUTE(StudentID, Session["InstituteID"].ToString(), ProgramLevel, Admitted);
                if (_ds != null)
                {
                    if (_ds.Tables[0].Rows.Count > 0)
                    {
                        Message = "Student [" + StudentID + "] has " + (Admitted == "1" ? "completed on-board" : "dropped out") + " successfully!";
                        Code    = "success";
                    }
                    else
                    {
                        Message = "Error from server side. Kindly refresh the page and try again.!";
                        Code    = "servererror";
                    }
                }
            }
            catch (NullReferenceException ex)
            {
                Code    = "error";
                Message = "Your session has been expired. Kindly refresh and try again.";
                Error   = ex.Message;
            }
            catch (Exception ex)
            {
                Code    = "error";
                Message = "Error from server side. Kindly refresh and try again.";
                Error   = ex.Message;
            }

            return(Json(new
            {
                c = Code,
                m = Message,
                e = Error
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
        public JsonResult SavePassport(mTravelPlanPassport _obj)
        {
            string path = "";
            string folderPath = "";
            string Message = string.Empty, Code = string.Empty, Error = string.Empty;

            try
            {
                string filename = "";
                string fname    = "";
                if (Request.Files.Count > 0)
                {
                    if (Request.Files[0].ContentLength > 0)
                    {
                        HttpFileCollectionBase files = Request.Files;
                        folderPath = "Uploads/studentDocument/TravelPlan/" + Session["studentid"].ToString() + "/";
                        path       = AppDomain.CurrentDomain.BaseDirectory + folderPath;
                        filename   = Path.GetFileName(Request.Files[0].FileName);
                        HttpPostedFileBase file = files[0];
                        filename = Session["ApplicationNo"].ToString() + "_Passport_" + DateTime.Now.ToString("yyyyMMddhhmmss") + Path.GetExtension(file.FileName);
                        if (!Directory.Exists(path))
                        {
                            Directory.CreateDirectory(path);
                        }
                        else
                        {
                            string[] curentfiles = Directory.GetFiles(path);
                            foreach (string curentfile in curentfiles)
                            {
                                if (curentfile.IndexOf(filename) >= 0)
                                {
#pragma warning disable SCS0018 // Path traversal: injection possible in {1} argument passed to '{0}'
                                    System.IO.File.Delete(path: curentfile);
#pragma warning restore SCS0018 // Path traversal: injection possible in {1} argument passed to '{0}'
                                }
                            }
                        }

                        fname = Path.Combine(Server.MapPath("~/" + folderPath), filename);
                        file.SaveAs(fname);
                        if (_obj.HaveValidPassport == "Yes, I have")
                        {
                            _obj.PassportDocument = folderPath + filename;
                        }
                        else if (_obj.HaveValidPassport == "Applied for a passport")
                        {
                            _obj.ApplicationDocument = folderPath + filename;
                        }
                        else if (_obj.HaveValidPassport == "I have Nepalese citizenship document")
                        {
                            _obj.CitizenshipDocument = folderPath + filename;
                        }
                    }
                }
                _obj.CreatedIP     = Session["localIP"].ToString();
                _obj.StudentID     = Session["StudentID"].ToString();
                _obj.ApplicationNo = Session["ApplicationNo"].ToString();
                TravelPlanRepository _objRepository = new TravelPlanRepository();
                DataSet _ds = _objRepository.INSERT_UPDATE_StudentTravelPlanPassport(_obj);
                if (_ds != null)
                {
                    if (_ds.Tables[0].Rows.Count > 0)
                    {
                        Message = "Details saved successfully!";
                        Code    = "success";
                        Session["HasPassportDetails"] = "True";
                    }
                    else
                    {
                        Message = "Error from server side. Kindly refresh the page and try again.";
                        Code    = "servererror";
                    }
                }
                else
                {
                    Message = "Error from server side. Kindly refresh the page and try again.";
                    Code    = "servererror";
                }
            }
            catch (NullReferenceException ex)
            {
                Message = "Your session has been expired. Kindly login again.";
                Code    = "sessionexpired";
                Error   = ex.Message;
            }
            catch (Exception ex)
            {
                Message = "Error from server side. Kindly refresh the page and try again.";
                Code    = "servererror";
                Error   = ex.Message;
            }
            return(Json(new
            {
                m = Message,
                c = Code,
                e = Error
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
Esempio n. 9
0
        public JsonResult SelectInstituteSpoc(string id, string ProgramLevel = "")
        {
            string Message = string.Empty, Code = string.Empty, Error = string.Empty;
            List <mTravelPlanInstituteSpoc> _list = new List <mTravelPlanInstituteSpoc>();

            try
            {
                TravelPlanRepository _objRepo = new TravelPlanRepository();
                DataSet _ds = _objRepo.SELECT_StudentTravelInstituteSpoc(id, Session["InstituteID"].ToString(), ProgramLevel);
                if (_ds != null)
                {
                    if (_ds.Tables[0].Rows.Count > 0)
                    {
                        foreach (DataRow _dr in _ds.Tables[0].Rows)
                        {
                            _list.Add(new mTravelPlanInstituteSpoc
                            {
                                ID                 = _dr["ID"].ToString(),
                                NameOfSpoc         = _dr["NameOfSpoc"].ToString(),
                                StudentIDs         = _dr["StudentIDs"].ToString(),
                                Mobile             = _dr["Mobile"].ToString(),
                                Email              = _dr["Email"].ToString(),
                                DocumentName1      = _dr["DocumentName1"].ToString(),
                                OtherDocumentName1 = _dr["OtherDocumentName1"].ToString(),
                                DoumentPath1       = _dr["DoumentPath1"].ToString(),
                                DocumentName2      = _dr["DocumentName2"].ToString(),
                                OtherDocumentName2 = _dr["OtherDocumentName2"].ToString(),
                                DoumentPath2       = _dr["DoumentPath2"].ToString(),
                                DocumentName3      = _dr["DocumentName3"].ToString(),
                                OtherDocumentName3 = _dr["OtherDocumentName3"].ToString(),
                                DoumentPath3       = _dr["DoumentPath3"].ToString(),
                                DocumentName4      = _dr["DocumentName4"].ToString(),
                                OtherDocumentName4 = _dr["OtherDocumentName4"].ToString(),
                                DoumentPath4       = _dr["DoumentPath4"].ToString(),
                                DocumentName5      = _dr["DocumentName5"].ToString(),
                                OtherDocumentName5 = _dr["OtherDocumentName5"].ToString(),
                                DoumentPath5       = _dr["DoumentPath5"].ToString()
                            });
                        }
                        Message = "Details has been saved successfully!";
                        Code    = "success";
                    }
                    else
                    {
                        Message = "Error from server side. Kindly refresh the page and try again.";
                        Code    = "servererror";
                    }
                }
                else
                {
                    Message = "Error from server side. Kindly refresh the page and try again.";
                    Code    = "servererror";
                }
            }
            catch (NullReferenceException ex)
            {
                Message = "Your session has been expired. Kindly login again.";
                Code    = "sessionexpired";
                Error   = ex.Message;
            }
            catch (Exception ex)
            {
                Message = "Error from server side. Kindly refresh the page and try again.";
                Code    = "servererror";
                Error   = ex.Message;
            }

            return(Json(new
            {
                m = Message,
                c = Code,
                e = Error,
                List = _list
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }