public ActionResult CustomerFileUpload(HttpPostedFileBase file) { if (file != null && file.ContentLength > 0) { try { KYCDetails details = new KYCDetails(); details.customerID = Convert.ToInt32(Session["CustomerID"].ToString()); details.DocumentName = file.FileName; int kycID = _ICustomerDetails.SaveKYC(details); string test = Convert.ToString(kycID) + '_' + file.FileName.ToString(); string path = Path.Combine(Server.MapPath("~/compDoc"), Path.GetFileName(test)); file.SaveAs(path); return(RedirectToAction("ViewCustomer")); } catch (Exception ex) { return(Json(new { Error = false, Message = "File Not Uploaded" }, JsonRequestBehavior.AllowGet)); } } else { ViewBag.Message = "You have not specified a file."; } return(RedirectToAction("ViewCustomer")); }
public async Task <ActionResult> AddKYC(int userId) { bool isSuccess = false; if (userId > 0) { RegisterUserResponse rr = new RegisterUserResponse(); RegisterUser registerUser = new RegisterUser(); registerUser.idprooftype = Convert.ToInt32(Request.Form["idprooftype"].ToString()); registerUser.idproof = Request.Form["idproof"]; registerUser.addressprooftype = Convert.ToInt32(Request.Form["addressprooftype"].ToString()); registerUser.addressproof = Request.Form["addressproof"]; registerUser.bankdetails = Request.Form["bankdetails"]; KYCDetails kdetail = new KYCDetails(); kdetail.kyc_detail_id = 0; kdetail.id_proof_id = registerUser.idprooftype; kdetail.id_proof_document_path = registerUser.idproof; kdetail.address_proof_id = registerUser.addressprooftype; kdetail.address_proof_document_path = registerUser.addressproof; kdetail.bank_details = registerUser.bankdetails; int kyc_detail_id = await rs.InsertKYCInfo(kdetail); if (kyc_detail_id > 0) { isSuccess = await rs.UpdateKYCInfoInUser(userId, kyc_detail_id); } } return(Ok(isSuccess)); }
public FileResult OpenDoc(int id) { List <KYCDetails> kycDet = new List <KYCDetails>(); if (Session["CustomerID"] != null) { kycDet = _ICustomerDetails.GetKYCByCustID(Convert.ToInt32(Session["CustomerID"])); } KYCDetails details = kycDet.Where(x => x.kycID == id).FirstOrDefault(); string test = Convert.ToString(id) + '_' + details.DocumentName.ToString(); return(File(Server.MapPath("/compDoc/" + test), "application/pdf")); }
public int SaveKYC(KYCDetails kycDetails) { int kycID = 0; try { con = connManager.GetConnection(); con.Open(); con.Execute(addKYCDocument, kycDetails, commandType: CommandType.StoredProcedure); List <KYCDetails> kyc = SqlMapper.Query <KYCDetails>(con, getAllKYCDocument).ToList(); kycID = kyc.Max(x => x.kycID); return(kycID); } catch (Exception ex) { throw; } finally { con.Close(); } }
public async Task <int> InsertKYCInfo(KYCDetails kyc_info) { return(await _user.InsertKYCInfo(kyc_info)); }
public int SaveKYC(KYCDetails kycDetails) { return(_customerProvider.SaveKYC(kycDetails)); }
public async Task <ActionResult> RegisterUser()//[FromBody] RegisterUser test) { RegisterUserResponse rr = new RegisterUserResponse(); RegisterUser registerUser = new RegisterUser(); registerUser.is_employee = Convert.ToString(Request.Form["isEmployee"]) == "true" ? true : false; registerUser.introcode = Request.Form["introcode"]; registerUser.introname = Request.Form["introname"]; registerUser.username = Request.Form["username"]; if (registerUser.username == string.Empty) { rr.message = "user name not generated due to server issue, can not register"; rr.user_security_stamp = "XXXX"; return(Ok(rr)); } registerUser.password = Request.Form["password"]; registerUser.firstName = Request.Form["firstName"]; registerUser.middleName = Request.Form["middleName"]; registerUser.lastName = Request.Form["lastName"]; registerUser.fathername = Request.Form["fathername"]; registerUser.gender = Convert.ToInt32(Request.Form["gender"].ToString()); registerUser.dob = Request.Form["dob"]; registerUser.mobile = Request.Form["mobile"]; registerUser.email = Request.Form["email"]; registerUser.pancard = Request.Form["pancard"]; registerUser.aadharcard = Request.Form["aadharcard"]; registerUser.address = Request.Form["address"]; registerUser.po = Request.Form["po"]; registerUser.ps = Request.Form["ps"]; registerUser.district = Request.Form["district"]; registerUser.city = Request.Form["city"]; if (Request.Form["state"] != "") { registerUser.state = Convert.ToInt32(Request.Form["state"]); } else { registerUser.state = 0; } registerUser.pincode = Request.Form["pincode"]; registerUser.bankname = Request.Form["bankname"]; registerUser.accholdername = Request.Form["accholdername"]; registerUser.accnumber = Request.Form["accnumber"]; registerUser.ifsc = Request.Form["ifsc"]; registerUser.branch = Request.Form["branch"]; registerUser.photo = Request.Form["photo"]; registerUser.isKYCLater = Convert.ToBoolean(Request.Form["isKYCLater"]); if (!registerUser.isKYCLater) { if ((Request.Form["idprooftype"].ToString()) != "") { registerUser.idprooftype = Convert.ToInt32(Request.Form["idprooftype"].ToString()); } else { registerUser.idprooftype = 0; } registerUser.idproof = Request.Form["idproof"]; if (Request.Form["addressprooftype"].ToString() != "") { registerUser.addressprooftype = Convert.ToInt32(Request.Form["addressprooftype"].ToString()); } else { registerUser.addressprooftype = 0; } registerUser.addressproof = Request.Form["addressproof"]; registerUser.bankdetails = Request.Form["bankdetails"]; } registerUser.payonline = Convert.ToBoolean(Request.Form["payonline"].ToString() == string.Empty ? false : true); BankDetails bdetail = new BankDetails(); bdetail.bank_detail_id = 0; bdetail.bank_name = registerUser.bankname; bdetail.account_holder_name = registerUser.accholdername; bdetail.account_number = registerUser.accnumber; bdetail.ifsc_number = registerUser.ifsc; bdetail.branch_name = registerUser.branch; bdetail.is_pay_online = registerUser.payonline; int bank_detail_id = await rs.InsertBankInfo(bdetail); int kyc_detail_id = 0; if (!registerUser.isKYCLater) { KYCDetails kdetail = new KYCDetails(); kdetail.kyc_detail_id = 0; kdetail.id_proof_id = registerUser.idprooftype; kdetail.id_proof_document_path = registerUser.idproof; kdetail.address_proof_id = registerUser.addressprooftype; kdetail.address_proof_document_path = registerUser.addressproof; kdetail.bank_details = registerUser.bankdetails; kyc_detail_id = await rs.InsertKYCInfo(kdetail); } UserDetails udetail = new UserDetails(); udetail.introcode = registerUser.introcode; udetail.introname = registerUser.introname; udetail.username = registerUser.username; udetail.role_id = registerUser.is_employee ? 2 : 3; udetail.email = registerUser.email; udetail.password = registerUser.password; udetail.first_name = registerUser.firstName; udetail.last_name = registerUser.lastName; udetail.father_name = registerUser.fathername; udetail.dob = registerUser.dob; udetail.mobile_number = registerUser.mobile; udetail.pan_card = registerUser.pancard; udetail.aadhar_card = registerUser.aadharcard; udetail.address = registerUser.address; udetail.post_office = registerUser.po; udetail.police_station = registerUser.ps; udetail.district = registerUser.district; udetail.city = registerUser.city; udetail.state = registerUser.state; udetail.pin = registerUser.pincode; udetail.sex = Enum.GetNames(typeof(Gender)).GetValue(registerUser.gender - 1).ToString(); udetail.middle_name = registerUser.middleName; udetail.bank_detail_id = bank_detail_id; udetail.kyc_detail_id = kyc_detail_id; udetail.introcode = registerUser.introcode; udetail.introname = registerUser.introname; udetail.photo = registerUser.photo; udetail.is_employee = registerUser.is_employee; string user_security_stamp = await rs.InsertUserInfo(udetail); rr.message = "Registered."; rr.user_security_stamp = user_security_stamp; RegisterTokenResponse rtr = new RegisterTokenResponse(); rtr.message = await rs.RegisterToken(registerUser.introcode, user_security_stamp); //Soumit// After this call a procedure to calculate the joining bonus and before the call a sp to get the below outputs from a user_security_stamp //Immediate parent model //List of shiblings //List of user under this user. // ------- Added for Rank Achievement #region Rank Achievement if (rs.UpdateUserRank(user_security_stamp, 0)) { await rs.UpdateNextLevel(user_security_stamp); } #endregion /* Registration successfull: registered user should recieve email for successful registration*/ string emailBody = "Hi, <br />" + registerUser.firstName + " " + registerUser.lastName + " you have been successfully registered to Telecharge.<br />" + "user name - " + registerUser.username + "<br />password - " + registerUser.password + "<br />Thanks and Regards,<br>Telecharge Registration Team" + "<br />This is a system generated email, do not reply back to this email-id"; //string emailBody = "Hi, <br />Your Login ID/ User Name - " + registerUser.username + "<br/>Password - " + registerUser.password; string emailSubject = "Telecharge - Registration"; string fromEmailID = "*****@*****.**"; await commonService.SendEmail(registerUser.email, emailSubject, emailBody, fromEmailID); //await commonService.IsWithdrawalRequestSendByThisUser(5); return(Ok(rr)); }