public List <KYCCommon> GetAgentList(KycFilterCommon model) { var KycDetails = new List <KYCCommon>(); string sql = "sproc_kyc_manage @flag ='list' "; sql += string.IsNullOrEmpty(model.KycStatus)? "" : ", @kyc_status =" + DAO.FilterString(model.KycStatus); sql += string.IsNullOrEmpty(model.Email)? "" : ", @email_address =" + DAO.FilterString(model.Email); sql += string.IsNullOrEmpty(model.MobileNumber)? "" : ", @mobile_no =" + DAO.FilterString(model.MobileNumber); sql += string.IsNullOrEmpty(model.FromDate)? "" : ", @from_date =" + DAO.FilterString(model.FromDate); sql += string.IsNullOrEmpty(model.ToDate)? "" : ", @to_date =" + DAO.FilterString(model.ToDate); var dbres = DAO.ExecuteDataTable(sql); if (dbres != null) { foreach (DataRow dr in dbres.Rows) { KYCCommon KycDetail = new KYCCommon(); KycDetail.AgentId = dr["AgentId"].ToString(); KycDetail.MobileNo = dr["Mobile"].ToString(); KycDetail.EmailAddress = dr["Email"].ToString(); KycDetail.SubmittedDate = DateTime.Parse(dr["SubmittedDate"].ToString()).ToLongDateString(); KycDetail.KycStatus = dr["KYCStatus"].ToString(); KycDetails.Add(KycDetail); } } return(KycDetails); }
public ActionResult Kyc() { string UserId = Session["UserName"].ToString(); string AgentID = _walletUserBusiness.UserInfo(UserId).AgentId.ToString(); KYCCommon kycCommon = new KYCCommon(); KYCModel kycModel = new KYCModel(); if (!String.IsNullOrEmpty(AgentID)) { kycCommon = _kyc.AgentKycInfo(AgentID); } //kycCommon.AgentId = ID.ToString(); kycModel = kycCommon.MapObject <KYCModel>(); kycModel.Country = string.IsNullOrEmpty(kycModel.Country) ? "Nepal" : kycModel.Country; kycModel.Nationality = string.IsNullOrEmpty(kycModel.Nationality) ? "Nepali" : kycModel.Nationality; LoadDropDownList(kycModel); #region FileLocation string FileLocation; string usertype = Session["UserType"].ToString(); if (usertype.ToLower() == "distributor") { FileLocation = "/Content/userupload/Distributor/kyc/"; } else if (usertype.ToLower() == "sub-distributor") { FileLocation = "/Content/userupload/SubDistributor/kyc/"; } else if (usertype.ToLower() == "walletuser") { FileLocation = "/Content/userupload/Walletuser/kyc/"; } else if (usertype.ToLower() == "merchant") { FileLocation = "/Content/userupload/Merchant/kyc/"; } else if (usertype.ToLower() == "agent") { FileLocation = "/Content/userupload/Agent/kyc/"; } else if (usertype.ToLower() == "sub-agent") { FileLocation = "/Content/userupload/SubAgent/kyc/"; } else { FileLocation = "/Content/userupload/"; } #endregion return(View(kycModel)); }
public CommonDbResponse UpadateKycDetails(KYCCommon kycCommon, string status) { string sql = "sproc_kyc_manage "; sql += "@flag =" + DAO.FilterString(status); sql += ",@first_name=" + DAO.FilterString(kycCommon.FirstName); sql += ",@middle_name=" + DAO.FilterString(kycCommon.MiddleName); sql += ",@last_name=" + DAO.FilterString(kycCommon.LastName); sql += ",@dob_eng=" + DAO.FilterString(kycCommon.DOB_Eng); sql += ",@dob_nep=" + DAO.FilterString(kycCommon.DOB_Nep); sql += ",@gender=" + DAO.FilterString(kycCommon.Gender); sql += ",@occupation=" + DAO.FilterString(kycCommon.Occupation); sql += ",@marital_status=" + DAO.FilterString(kycCommon.MaritalStatus); sql += ",@spouse_name=" + DAO.FilterString(kycCommon.SpouseName); sql += ",@father_name=" + DAO.FilterString(kycCommon.FatherName); sql += ",@mother_name=" + DAO.FilterString(kycCommon.MotherName); sql += ",@grand_father_name=" + DAO.FilterString(kycCommon.GrandFatherName); sql += ",@nationality=" + DAO.FilterString(kycCommon.Nationality); sql += ",@country=" + DAO.FilterString(kycCommon.Country); sql += ",@province=" + DAO.FilterString(kycCommon.PProvince); sql += ",@district=" + DAO.FilterString(kycCommon.PDistrict); sql += ",@local_body=" + DAO.FilterString(kycCommon.PLocalBody); sql += ",@ward_no=" + DAO.FilterString(kycCommon.PWardNo); sql += ",@address=" + DAO.FilterString(kycCommon.PAddress); sql += ",@temp_province=" + DAO.FilterString(kycCommon.TProvince); sql += ",@temp_district=" + DAO.FilterString(kycCommon.TDistrict); sql += ",@temp_local_body=" + DAO.FilterString(kycCommon.TLocalBody); sql += ",@temp_ward_no=" + DAO.FilterString(kycCommon.TWardNo); sql += ",@temp_address=" + DAO.FilterString(kycCommon.TAddress); sql += ",@phone_no=" + DAO.FilterString(kycCommon.PhoneNo); sql += ",@email_address=" + DAO.FilterString(kycCommon.EmailAddress); sql += ",@action_user="******",@action_ip_address=" + DAO.FilterString(kycCommon.Updated_IP); sql += ",@mobile_no=" + DAO.FilterString(kycCommon.MobileNo); sql += ",@remarks=" + DAO.FilterString(kycCommon.Remarks); //Document Details sql += ",@agent_id=" + DAO.FilterString(kycCommon.AgentId); sql += ",@id_type=" + DAO.FilterString(kycCommon.Id_type); sql += ",@id_number=" + DAO.FilterString(kycCommon.Id_No); sql += ",@id_issuedate_local=" + DAO.FilterString(kycCommon.Id_IssuedDateAD); sql += ",@id_issue_date_nepali=" + DAO.FilterString(kycCommon.Id_IssuedDateBS); sql += ",@id_expiry_date_local=" + DAO.FilterString(kycCommon.Id_ExpiryDateAD); sql += ",@id_expiry_date_nepali=" + DAO.FilterString(kycCommon.Id_ExpiryDateBS); sql += ",@id_issue_district=" + DAO.FilterString(kycCommon.Id_IssuedPlace); sql += ",@ppPhoto_img=" + DAO.FilterString(kycCommon.PPImage); sql += ",@id_front_img=" + DAO.FilterString(kycCommon.Id_DocumentFront); sql += ",@id_back_photo_img=" + DAO.FilterString(kycCommon.Id_DocumentBack); //sql += ",first_name=" + DAO.FilterString(kycCommon.FirstName); return(DAO.ParseCommonDbResponse(sql)); }
public List <KYCCommon> GetAgentList() { var KycDetails = new List <KYCCommon>(); string sql = "sproc_kyc_manage @flag ='list' "; var dbres = DAO.ExecuteDataTable(sql); if (dbres != null) { foreach (DataRow dr in dbres.Rows) { KYCCommon KycDetail = new KYCCommon(); KycDetail.AgentId = dr["Agent Id"].ToString(); KycDetail.MobileNo = dr["Mobile"].ToString(); KycDetail.EmailAddress = dr["Email"].ToString(); KycDetail.SubmittedDate = DateTime.Parse(dr["Submitted Date"].ToString()).ToLongDateString(); KycDetail.KycStatus = dr["KYC Status"].ToString(); KycDetails.Add(KycDetail); } } return(KycDetails); }
// GET: KYC/Details/id="1003" public ActionResult Details(string agentid = "") { KYCCommon kycCommon = new KYCCommon(); KYCModel kycModel = new KYCModel(); var ID = agentid.DecryptParameter(); //if (Session["UserName"] == null) //{ // return RedirectToAction("LogOff", "Home"); //} if (String.IsNullOrEmpty(ID)) { return(RedirectToAction("Index", ControllerName)); } if (!String.IsNullOrEmpty(ID)) { kycCommon = _kyc.AgentKycInfo(ID); } //kycCommon.AgentId = ID.ToString(); kycModel = kycCommon.MapObject <KYCModel>(); kycModel.Country = string.IsNullOrEmpty(kycModel.Country) ? "Nepal" : kycModel.Country; kycModel.Nationality = string.IsNullOrEmpty(kycModel.Nationality) ? "Nepali" : kycModel.Nationality; ViewBag.AgentId = ID; LoadDropDownList(kycModel); #region FileLocation string FileLocation; string usertype = kycModel.AgentType; if (usertype.ToLower() == "distributor") { FileLocation = "/Content/userupload/Distributor/kyc/"; } else if (usertype.ToLower() == "sub-distributor") { FileLocation = "/Content/userupload/SubDistributor/kyc/"; } else if (usertype.ToLower() == "walletuser") { FileLocation = "/Content/userupload/Walletuser/kyc/"; } else if (usertype.ToLower() == "merchant") { FileLocation = "/Content/userupload/Merchant/kyc/"; } else if (usertype.ToLower() == "agent") { FileLocation = "/Content/userupload/Agent/kyc/"; } else if (usertype.ToLower() == "sub-agent") { FileLocation = "/Content/userupload/SubAgent/kyc/"; } else { FileLocation = "/Content/userupload/"; } ViewBag.FileLocation = FileLocation; #endregion return(View(kycModel)); }
public ActionResult Details(KYCModel kycModel, HttpPostedFileBase PPImageFile, HttpPostedFileBase Id_DocumentFrontFile, HttpPostedFileBase Id_DocumentBackFile, string submitbutton, string OthersRemarks = "") { if (submitbutton.ToUpper() == "GOBACK") { return(RedirectToAction("Index", ControllerName)); } LoadDropDownList(kycModel); #region FileLocation string FileLocation; string usertype = kycModel.AgentType; if (usertype.ToLower() == "distributor") { FileLocation = "/Content/userupload/Distributor/kyc/"; } else if (usertype.ToLower() == "sub-distributor") { FileLocation = "/Content/userupload/SubDistributor/kyc/"; } else if (usertype.ToLower() == "walletuser") { FileLocation = "/Content/userupload/Walletuser/kyc/"; } else if (usertype.ToLower() == "merchant") { FileLocation = "/Content/userupload/Merchant/kyc/"; } else if (usertype.ToLower() == "agent") { FileLocation = "/Content/userupload/Agent/kyc/"; } else if (usertype.ToLower() == "sub-agent") { FileLocation = "/Content/userupload/SubAgent/kyc/"; } else { FileLocation = "/Content/userupload/"; } ViewBag.FileLocation = FileLocation; #endregion if (String.IsNullOrEmpty(kycModel.AgentId)) { return(RedirectToAction("Index", ControllerName)); } string status = ""; if (submitbutton.ToUpper() == "REJECT") { status = "r"; if (kycModel.Remarks.ToUpper().Equals("OTHERS")) { if (OthersRemarks == "") { ModelState.AddModelError("OtherRemarks", "Other Remarks is Required"); return(View(kycModel)); } else { kycModel.Remarks = "Others::" + OthersRemarks; } } RejectValidation(); } else if (submitbutton.ToUpper() == "APPROVE") { status = "a"; ModelState.Remove(("Remarks")); } else if (submitbutton.ToUpper() == "UPDATE") { status = "u"; ModelState.Remove(("Remarks")); } else { return(RedirectToAction("Index", ControllerName)); } if (submitbutton.ToUpper() != "REJECT") { if ((Id_DocumentFrontFile == null && string.IsNullOrEmpty(kycModel.Id_DocumentFront)) || (PPImageFile == null && string.IsNullOrEmpty(kycModel.PPImage)) || (Id_DocumentBackFile == null && string.IsNullOrEmpty(kycModel.Id_DocumentBack) && kycModel.Id_type.ToUpper() == "CITIZENSHIP")) { if (Id_DocumentFrontFile == null && string.IsNullOrEmpty(kycModel.Id_DocumentFront)) { ModelState.AddModelError("Id_DocumentFront", "Document Front Image is Required"); } if (PPImageFile == null && string.IsNullOrEmpty(kycModel.PPImage)) { ModelState.AddModelError("PPImage", "Profile Image is Required"); } if ((Id_DocumentBackFile == null && string.IsNullOrEmpty(kycModel.Id_DocumentBack) && kycModel.Id_type.ToUpper() == "CITIZENSHIP")) { ModelState.AddModelError("Id_DocumentBack", "Document Front Image is Required"); } return(View(kycModel)); } if (kycModel.Id_type.ToUpper() == "CITIZENSHIP") { ModelState.Remove(("Id_ExpiryDateAD")); ModelState.Remove(("Id_ExpiryDateBS")); } string temp_address = kycModel.SameAsPermanentAddress.ToString(); if (temp_address == "True") { kycModel.TProvince = kycModel.PProvince; kycModel.TDistrict = kycModel.PDistrict; kycModel.TLocalBody = kycModel.PLocalBody; kycModel.TWardNo = kycModel.PWardNo; kycModel.TAddress = kycModel.PAddress; } } string ID = ""; var PPImagePath = ""; var Id_DocumentFrontPath = ""; var Id_DocumentBackPath = ""; if (ModelState.IsValid) { //kycModel.Remarks = String.IsNullOrEmpty(kycModel.Remarks) ? "" : // kycModel.Remarks.ToUpper().Equals("OTHERS") ? OthersRemarks : kycModel.Remarks; kycModel.ActionUser = Session["UserName"].ToString(); ID = kycModel.AgentId.DecryptParameter(); kycModel.AgentId = ID; #region "PPImage" if (PPImageFile != null && (status.ToUpper() == "A" || status.ToUpper() == "U")) { var allowedExtensions = new[] { ".jpg", ".png", ".jpeg" }; var fileName = Path.GetFileName(PPImageFile.FileName); String timeStamp = DateTime.Now.ToString(); var ext = Path.GetExtension(PPImageFile.FileName); if (PPImageFile.ContentLength > 1 * 1024 * 1024)//1 MB { return(RedirectToAction("Details", ControllerName, ID)); } if (allowedExtensions.Contains(ext.ToLower())) { string datet = timeStamp.Replace('/', ' ').Replace(':', ' '); string myfilename = kycModel.MobileNo + "-PPImage-" + datet + ext; PPImagePath = Path.Combine(Server.MapPath(FileLocation), myfilename); kycModel.PPImage = FileLocation + myfilename; //PPImageFile.SaveAs(PPImagePath); } else { return(RedirectToAction("Details", ControllerName, ID)); } } #endregion #region "Id_DocumentFront" if (Id_DocumentFrontFile != null && (status.ToUpper() == "A" || status.ToUpper() == "U")) { var allowedExtensions = new[] { ".jpg", ".png", ".jpeg" }; var fileName = Path.GetFileName(Id_DocumentFrontFile.FileName); String timeStamp = DateTime.Now.ToString(); var ext = Path.GetExtension(Id_DocumentFrontFile.FileName); if (Id_DocumentFrontFile.ContentLength > 1 * 1024 * 1024)//1 MB { return(RedirectToAction("Details", ControllerName, ID)); } if (allowedExtensions.Contains(ext.ToLower())) { string datet = timeStamp.Replace('/', ' ').Replace(':', ' '); string myfilename = kycModel.MobileNo + "-Id_DocumentFront-" + datet + ext; Id_DocumentFrontPath = Path.Combine(Server.MapPath(FileLocation), myfilename); kycModel.Id_DocumentFront = FileLocation + myfilename; //Id_DocumentFrontFile.SaveAs(Id_DocumentFrontPath); } else { return(RedirectToAction("Details", ControllerName, ID)); } } #endregion #region "Id_DocumentBack" if (Id_DocumentBackFile != null && (status.ToUpper() == "A" || status.ToUpper() == "U")) { var allowedExtensions = new[] { ".jpg", ".png", ".jpeg" }; var fileName = Path.GetFileName(Id_DocumentBackFile.FileName); String timeStamp = DateTime.Now.ToString(); var ext = Path.GetExtension(Id_DocumentBackFile.FileName); if (Id_DocumentBackFile.ContentLength > 1 * 1024 * 1024)//1 MB { return(RedirectToAction("Details", ControllerName, ID)); } if (allowedExtensions.Contains(ext.ToLower())) { string datet = timeStamp.Replace('/', ' ').Replace(':', ' '); string myfilename = kycModel.MobileNo + "-Id_DocumentBack-" + datet + ext; Id_DocumentBackPath = Path.Combine(Server.MapPath(FileLocation), myfilename); kycModel.Id_DocumentBack = FileLocation + myfilename; //Id_DocumentBackFile.SaveAs(Id_DocumentBackPath); } else { return(RedirectToAction("Details", ControllerName, ID)); } } #endregion KYCCommon kycCommon = kycModel.MapObject <KYCCommon>(); CommonDbResponse dbResponse = _kyc.UpadateKycDetails(kycCommon, status); if (dbResponse.Code == 0) { //SaveImages On Success if (PPImagePath != "") { PPImageFile.SaveAs(PPImagePath); } if (Id_DocumentFrontPath != "") { Id_DocumentFrontFile.SaveAs(Id_DocumentFrontPath); } if (Id_DocumentBackPath != "") { Id_DocumentBackFile.SaveAs(Id_DocumentBackPath); } //Ends SaveImages } dbResponse.SetMessageInTempData(this); return(RedirectToAction("Index")); } return(View(kycModel)); //return RedirectToAction("Index"); }
public KYCCommon AgentKycInfo(string AgentId) { KYCCommon kycCommon = new KYCCommon(); string sql = "sproc_kyc_manage @flag ='v', @agent_id= '" + AgentId + "'"; var dbres = DAO.ExecuteDataTable(sql); if (dbres != null) { foreach (DataRow dr in dbres.Rows) { kycCommon.AgentType = dr["agent_type"].ToString(); kycCommon.AgentId = dr["agent_id"].ToString(); kycCommon.FirstName = dr["first_name"].ToString(); kycCommon.MiddleName = dr["middle_name"].ToString(); kycCommon.LastName = dr["last_name"].ToString(); kycCommon.DOB_Eng = dr["date_of_birth_eng"].ToString(); kycCommon.DOB_Nep = dr["date_of_birth_nep"].ToString(); //kycCommon.DOB_Eng = string.IsNullOrEmpty(dr["date_of_birth_eng"].ToString()) ? "" : Convert.ToDateTime(dr["date_of_birth_eng"].ToString()).ToString("yyyy-MM-dd"); //kycCommon.DOB_Nep = string.IsNullOrEmpty(dr["date_of_birth_nep"].ToString()) ? "" : Convert.ToDateTime(dr["date_of_birth_nep"].ToString()).ToString("yyyy-MM-dd"); kycCommon.Gender = dr["gender"].ToString(); kycCommon.Occupation = dr["occupation"].ToString(); kycCommon.MaritalStatus = dr["marital_status"].ToString(); kycCommon.SpouseName = dr["spouse_name"].ToString(); kycCommon.FatherName = dr["father_name"].ToString(); kycCommon.MotherName = dr["mother_name"].ToString(); kycCommon.GrandFatherName = dr["grand_father_name"].ToString(); kycCommon.Nationality = dr["agent_nationality"].ToString(); kycCommon.Country = dr["agent_country"].ToString(); kycCommon.PProvince = dr["permanent_province"].ToString(); kycCommon.PDistrict = dr["permanent_district"].ToString(); kycCommon.PLocalBody = dr["permanent_localbody"].ToString(); kycCommon.PWardNo = dr["permanent_wardno"].ToString(); kycCommon.PAddress = dr["permanent_address"].ToString(); kycCommon.TProvince = dr["temporary_province"].ToString(); kycCommon.TDistrict = dr["temporary_district"].ToString(); kycCommon.TLocalBody = dr["temporary_localbody"].ToString(); kycCommon.TWardNo = dr["temporary_wardno"].ToString(); kycCommon.TAddress = dr["temporary_address"].ToString(); kycCommon.PhoneNo = dr["agent_phone_no"].ToString(); kycCommon.EmailAddress = dr["agent_email_address"].ToString(); kycCommon.MobileNo = dr["agent_mobile_no"].ToString(); kycCommon.Remarks = dr["admin_remarks"].ToString(); kycCommon.KycStatus = dr["KYC_Status"].ToString(); kycCommon.Id_type = dr["Identification_type"].ToString(); kycCommon.Id_No = dr["Identification_NO"].ToString(); kycCommon.Id_IssuedDateAD = string.IsNullOrEmpty(dr["Identification_issued_date"].ToString()) ? "" : Convert.ToDateTime(dr["Identification_issued_date"].ToString()).ToString("yyyy-MM-dd"); kycCommon.Id_IssuedDateBS = string.IsNullOrEmpty(dr["Identification_issued_date_nepali"].ToString()) ? "" : Convert.ToDateTime(dr["Identification_issued_date_nepali"].ToString()).ToString("yyyy-MM-dd"); kycCommon.Id_ExpiryDateAD = string.IsNullOrEmpty(dr["Identification_expiry_date"].ToString()) ? "" : Convert.ToDateTime(dr["Identification_expiry_date"].ToString()).ToString("yyyy-MM-dd"); kycCommon.Id_ExpiryDateBS = string.IsNullOrEmpty(dr["identification_expiry_date_nepali"].ToString()) ? "" : Convert.ToDateTime(dr["identification_expiry_date_nepali"].ToString()).ToString("yyyy-MM-dd"); //kycCommon.Id_IssuedDateAD = dr["Identification_issued_date"].ToString(); //kycCommon.Id_IssuedDateBS = dr["Identification_issued_date_nepali"].ToString(); //kycCommon.Id_ExpiryDateAD = dr["Identification_expiry_date"].ToString(); //kycCommon.Id_ExpiryDateBS = dr["identification_expiry_date_nepali"].ToString(); kycCommon.Id_IssuedPlace = dr["Identification_issued_place"].ToString(); kycCommon.PPImage = dr["Identification_photo_Logo"].ToString(); kycCommon.Id_DocumentFront = dr["Id_document_front"].ToString(); kycCommon.Id_DocumentBack = dr["Id_document_back"].ToString(); //kycCommon.SubmittedDate = DateTime.Parse(dr["Submitted Date"].ToString()); } } else { kycCommon = null; } return(kycCommon); }
public ActionResult Kyc(KYCModel clientkyc, HttpPostedFileBase PPImageFile, HttpPostedFileBase Id_DocumentFrontFile, HttpPostedFileBase Id_DocumentBackFile) { LoadDropDownList(clientkyc); string status = "u"; ModelState.Remove(("Remarks")); #region FileLocation string FileLocation; string usertype = Session["UserType"].ToString(); if (usertype.ToLower() == "distributor") { FileLocation = "/Content/userupload/Distributor/kyc/"; } else if (usertype.ToLower() == "sub-distributor") { FileLocation = "/Content/userupload/SubDistributor/kyc/"; } else if (usertype.ToLower() == "walletuser") { FileLocation = "/Content/userupload/Walletuser/kyc/"; } else if (usertype.ToLower() == "merchant") { FileLocation = "/Content/userupload/Merchant/kyc/"; } else if (usertype.ToLower() == "agent") { FileLocation = "/Content/userupload/Agent/kyc/"; } else if (usertype.ToLower() == "sub-agent") { FileLocation = "/Content/userupload/SubAgent/kyc/"; } else { FileLocation = "/Content/userupload/"; } ViewBag.FileLocation = FileLocation; #endregion if ((Id_DocumentFrontFile == null && string.IsNullOrEmpty(clientkyc.Id_DocumentFront)) || (PPImageFile == null && string.IsNullOrEmpty(clientkyc.PPImage)) || (Id_DocumentBackFile == null && string.IsNullOrEmpty(clientkyc.Id_DocumentBack) && clientkyc.Id_type.ToUpper() == "CITIZENSHIP")) { if (Id_DocumentFrontFile == null && string.IsNullOrEmpty(clientkyc.Id_DocumentFront)) { ModelState.AddModelError("Id_DocumentFront", "Document Front Image is Required"); } if (PPImageFile == null && string.IsNullOrEmpty(clientkyc.PPImage)) { ModelState.AddModelError("PPImage", "Profile Image is Required"); } if ((Id_DocumentBackFile == null && string.IsNullOrEmpty(clientkyc.Id_DocumentBack) && clientkyc.Id_type.ToUpper() == "CITIZENSHIP")) { ModelState.AddModelError("Id_DocumentBack", "Document Front Image is Required"); } return(View(clientkyc)); } if (clientkyc.Id_type.ToUpper() == "CITIZENSHIP") { //if (Id_DocumentBackFile == null && string.IsNullOrEmpty(clientkyc.Id_DocumentBack)) //{ // ModelState.AddModelError("Id_DocumentBack", "Document Front Image is Required"); // return View(clientkyc); //} ModelState.Remove(("Id_ExpiryDateAD")); ModelState.Remove(("Id_ExpiryDateBS")); } var PPImagePath = ""; var Id_DocumentFrontPath = ""; var Id_DocumentBackPath = ""; string temp_address = clientkyc.SameAsPermanentAddress.ToString(); if (temp_address == "True") { clientkyc.TProvince = clientkyc.PProvince; clientkyc.TDistrict = clientkyc.PDistrict; clientkyc.TLocalBody = clientkyc.PLocalBody; clientkyc.TWardNo = clientkyc.PWardNo; clientkyc.TAddress = clientkyc.PAddress; } if (ModelState.IsValid) { //clientkyc.Remarks = String.IsNullOrEmpty(clientkyc.Remarks) ? "" : // clientkyc.Remarks.ToUpper().Equals("OTHERS") ? OthersRemarks : clientkyc.Remarks; clientkyc.ActionUser = Session["UserName"].ToString(); #region "PPImage" if (PPImageFile != null && status.ToUpper() == "U") { var allowedExtensions = new[] { ".jpg", ".png", ".jpeg" }; var fileName = Path.GetFileName(PPImageFile.FileName); String timeStamp = DateTime.Now.ToString(); var ext = Path.GetExtension(PPImageFile.FileName); if (PPImageFile.ContentLength > 1 * 1024 * 1024)//1 MB { return(RedirectToAction("Kyc", ControllerName)); } if (allowedExtensions.Contains(ext.ToLower())) { string datet = timeStamp.Replace('/', '-').Replace(':', '-'); string myfilename = clientkyc.MobileNo + "-PPImage-" + datet + ext; PPImagePath = Path.Combine(Server.MapPath(FileLocation), myfilename); clientkyc.PPImage = FileLocation + myfilename; //PPImageFile.SaveAs(PPImagePath); } else { return(RedirectToAction("Kyc", ControllerName)); } } #endregion #region "Id_DocumentFront" if (Id_DocumentFrontFile != null && status.ToUpper() == "U") { var allowedExtensions = new[] { ".jpg", ".png", ".jpeg" }; var fileName = Path.GetFileName(Id_DocumentFrontFile.FileName); String timeStamp = DateTime.Now.ToString(); var ext = Path.GetExtension(Id_DocumentFrontFile.FileName); if (Id_DocumentFrontFile.ContentLength > 1 * 1024 * 1024)//1 MB { return(RedirectToAction("Kyc", ControllerName)); } if (allowedExtensions.Contains(ext.ToLower())) { string datet = timeStamp.Replace('/', '-').Replace(':', '-'); string myfilename = clientkyc.MobileNo + "-Id_DocumentFront-" + datet + ext; Id_DocumentFrontPath = Path.Combine(Server.MapPath(FileLocation), myfilename); clientkyc.Id_DocumentFront = FileLocation + myfilename; //Id_DocumentFrontFile.SaveAs(Id_DocumentFrontPath); } else { return(RedirectToAction("Kyc", ControllerName)); } } #endregion #region "Id_DocumentBack" if (Id_DocumentBackFile != null && status.ToUpper() == "U") { var allowedExtensions = new[] { ".jpg", ".png", ".jpeg" }; var fileName = Path.GetFileName(Id_DocumentBackFile.FileName); String timeStamp = DateTime.Now.ToString(); var ext = Path.GetExtension(Id_DocumentBackFile.FileName); if (Id_DocumentBackFile.ContentLength > 1 * 1024 * 1024)//1 MB { return(RedirectToAction("Kyc", ControllerName)); } if (allowedExtensions.Contains(ext.ToLower())) { string datet = timeStamp.Replace('/', '-').Replace(':', '-'); string myfilename = clientkyc.MobileNo + "-Id_DocumentBack-" + datet + ext; Id_DocumentBackPath = Path.Combine(Server.MapPath(FileLocation), myfilename); clientkyc.Id_DocumentBack = FileLocation + myfilename; //Id_DocumentBackFile.SaveAs(Id_DocumentBackPath); } else { return(RedirectToAction("Kyc", ControllerName)); } } #endregion KYCCommon kycCommon = clientkyc.MapObject <KYCCommon>(); CommonDbResponse dbResponse = _kyc.UpadateKycDetails(kycCommon, status); if (dbResponse.Code == 0) { //SaveImages On Success if (PPImagePath != "") { PPImageFile.SaveAs(PPImagePath); } if (Id_DocumentFrontPath != "") { Id_DocumentFrontFile.SaveAs(Id_DocumentFrontPath); } if (Id_DocumentBackPath != "") { Id_DocumentBackFile.SaveAs(Id_DocumentBackPath); } //Ends SaveImages } dbResponse.SetMessageInTempData(this); return(RedirectToAction("Profile")); } return(View(clientkyc)); }
public ActionResult Details(KYCModelDetail kycModel, string submitbutton, string OthersRemarks = "") { if (submitbutton.ToUpper() == "GOBACK") { return(RedirectToAction("Index", ControllerName)); } KYCModel kyc = new KYCModel(); kyc = kycModel.MapObject <KYCModel>(); LoadDropDownList(kyc); #region FileLocation string FileLocation; string usertype = kycModel.AgentType; if (usertype.ToLower() == "distributor") { FileLocation = "/Content/userupload/Distributor/kyc/"; } else if (usertype.ToLower() == "sub-distributor") { FileLocation = "/Content/userupload/SubDistributor/kyc/"; } else if (usertype.ToLower() == "walletuser") { FileLocation = "/Content/userupload/Walletuser/kyc/"; } else if (usertype.ToLower() == "merchant") { FileLocation = "/Content/userupload/Merchant/kyc/"; } else if (usertype.ToLower() == "agent") { FileLocation = "/Content/userupload/Agent/kyc/"; } else if (usertype.ToLower() == "sub-agent") { FileLocation = "/Content/userupload/SubAgent/kyc/"; } else { FileLocation = "/Content/userupload/"; } ViewBag.FileLocation = FileLocation; #endregion if (String.IsNullOrEmpty(kycModel.AgentId)) { return(RedirectToAction("Index", ControllerName)); } string status = ""; if (submitbutton.ToUpper() == "REJECT") { status = "r"; if (kycModel.Remarks.ToUpper().Equals("OTHERS")) { if (OthersRemarks == "") { ModelState.AddModelError("OtherRemarks", "Other Remarks is Required"); return(View(kycModel)); } else { kycModel.Remarks = "Others::" + OthersRemarks; } } RejectValidation(); } else if (submitbutton.ToUpper() == "APPROVE") { status = "a"; ModelState.Remove(("Remarks")); } else { return(RedirectToAction("Index", ControllerName)); } kycModel.ActionUser = Session["UserName"].ToString(); kycModel.AgentId = kycModel.AgentId.DecryptParameter(); KYCCommon kycCommon = kycModel.MapObject <KYCCommon>(); CommonDbResponse dbResponse = _kyc.UpadateKycDetails(kycCommon, status); dbResponse.SetMessageInTempData(this); return(RedirectToAction("Index")); }
// GET: KYC/Details/id="1003" public ActionResult Details(string agentid = "") { KYCCommon kycCommon = new KYCCommon(); KYCModelDetail kycModel = new KYCModelDetail(); var ID = agentid.DecryptParameter(); if (String.IsNullOrEmpty(ID)) { return(RedirectToAction("Index", ControllerName)); } if (!String.IsNullOrEmpty(ID)) { kycCommon = _kyc.AgentKycInfo(ID); } //kycCommon.AgentId = ID.ToString(); kycModel = kycCommon.MapObject <KYCModelDetail>(); kycModel.Country = string.IsNullOrEmpty(kycModel.Country) ? "Nepal" : kycModel.Country; kycModel.Nationality = string.IsNullOrEmpty(kycModel.Nationality) ? "Nepali" : kycModel.Nationality; var pprovince = LoadDropdownList("province") as Dictionary <string, string>; kycModel.PProvince = pprovince.ContainsKey(kycModel.PProvince) ? pprovince.FirstOrDefault(x => x.Key == kycModel.PProvince).Value : kycModel.PProvince; kycModel.TProvince = pprovince.ContainsKey(kycModel.TProvince) ? pprovince.FirstOrDefault(x => x.Key == kycModel.TProvince).Value : kycModel.TProvince; ViewBag.AgentId = ID; KYCModel kyc = new KYCModel(); kyc = kycModel.MapObject <KYCModel>(); ViewBag.RemarksList = ApplicationUtilities.SetDDLValue(LoadDropdownList("remarks") as Dictionary <string, string>, kycModel.Remarks, "--Remarks--"); //LoadDropDownList(kyc); #region FileLocation string FileLocation; string usertype = kycModel.AgentType; if (usertype.ToLower() == "distributor") { FileLocation = "/Content/userupload/Distributor/kyc/"; } else if (usertype.ToLower() == "sub-distributor") { FileLocation = "/Content/userupload/SubDistributor/kyc/"; } else if (usertype.ToLower() == "walletuser") { FileLocation = "/Content/userupload/Walletuser/kyc/"; } else if (usertype.ToLower() == "merchant") { FileLocation = "/Content/userupload/Merchant/kyc/"; } else if (usertype.ToLower() == "agent") { FileLocation = "/Content/userupload/Agent/kyc/"; } else if (usertype.ToLower() == "sub-agent") { FileLocation = "/Content/userupload/SubAgent/kyc/"; } else { FileLocation = "/Content/userupload/"; } ViewBag.FileLocation = FileLocation; #endregion return(View(kycModel)); }
public shared.Models.CommonDbResponse UpadateKycDetails(KYCCommon kycCommon, string status) { return(_repo.UpadateKycDetails(kycCommon, status)); }