You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

526 lines
25 KiB

  1. using Swift.DAL.OnlineAgent;
  2. using Swift.DAL.SwiftDAL;
  3. using Swift.web.Library;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Data;
  7. using System.IO;
  8. using System.Linq;
  9. using System.Web;
  10. using System.Web.Script.Serialization;
  11. using System.Web.UI;
  12. using System.Web.UI.WebControls;
  13. namespace Swift.web.MobileRemit.Agent.ApproveCustomer
  14. {
  15. public partial class EditCustomerFromMobile : System.Web.UI.Page
  16. {
  17. private readonly RemittanceLibrary _sl = new RemittanceLibrary();
  18. private readonly OnlineCustomerDao _cd = new OnlineCustomerDao();
  19. private readonly StaticDataDdl _sdd = new StaticDataDdl();
  20. private const string ViewFunctionIdFromMobile = "20450000";
  21. private const string AddFunctionIdFromMobile = "20450030";
  22. private const string SaveEditIdFromMobile = "20203000";
  23. // private const string SignatureFunctionIdFromMobile = "20450040";
  24. private const string ViewFunctionIdFromAgent = "20400000";
  25. private const string AddFunctionIdFromAgent = "20400030";
  26. private const string SaveEditIdFromAgent = "20450020";
  27. // private const string SignatureFunctionIdFromAgent = "20400040";
  28. private bool isEdit = Convert.ToBoolean(GetStatic.ReadQueryString("edit", "false"));
  29. protected void Page_Load(object sender, EventArgs e)
  30. {
  31. Authenticate();
  32. signatureDiv.Visible = !CheckAddOrEdit() && _sl.HasRight(GetFunctionIdByUserType(ViewFunctionIdFromAgent, ViewFunctionIdFromMobile));
  33. isDisplaySignature.Value = !CheckAddOrEdit() && _sl.HasRight(GetFunctionIdByUserType(ViewFunctionIdFromAgent, ViewFunctionIdFromMobile)) ? "true" : "false";
  34. GetStatic.PrintMessage(Page);
  35. displayOnlyOnEdit.Visible = CheckAddOrEdit();
  36. addEditPanel.Attributes.Add("style", "display:" + (CheckAddOrEdit() ? "none" : ""));
  37. displayCounterVisit.Visible = !CheckAddOrEdit();
  38. var MethodName = Request.Form["MethodName"];
  39. if (!IsPostBack)
  40. {
  41. PopulateDdl();
  42. if (MethodName == "GetAddressDetailsByZipCode")
  43. {
  44. GetAddressDetailsByZipCode();
  45. }
  46. if (MethodName == "GetCustomerDetails")
  47. {
  48. GetCustomerDetails();
  49. }
  50. if (MethodName == "GetImageUrl")
  51. {
  52. GetImageUrl();
  53. }
  54. if (MethodName == "GetSignature")
  55. {
  56. GetSignature();
  57. }
  58. }
  59. if (GetVerificationType() == "verify")
  60. {
  61. SaveEditedData.Text = "Verify";
  62. }
  63. }
  64. protected string GetCustomerId()
  65. {
  66. return GetStatic.ReadQueryString("customerId", "");
  67. }
  68. protected string GetRequestFrom()
  69. {
  70. return GetStatic.ReadQueryString("requestFrom", "");
  71. }
  72. protected string GetVerificationType()
  73. {
  74. return GetStatic.ReadQueryString("type", "");
  75. }
  76. private void Authenticate()
  77. {
  78. if (CheckAddOrEdit())
  79. _sl.CheckAuthentication(GetFunctionIdByUserType(SaveEditIdFromAgent, SaveEditIdFromMobile));
  80. else
  81. _sl.CheckAuthentication(GetFunctionIdByUserType(AddFunctionIdFromAgent, AddFunctionIdFromMobile));
  82. string eId = GetStatic.ReadQueryString("customerId", "");
  83. var hasRight = false;
  84. if (eId == "")
  85. {
  86. hasRight = _sl.HasRight(GetFunctionIdByUserType(AddFunctionIdFromAgent, AddFunctionIdFromMobile));
  87. }
  88. else
  89. {
  90. hasRight = _sl.HasRight(GetFunctionIdByUserType(SaveEditIdFromAgent, SaveEditIdFromMobile));
  91. }
  92. }
  93. private bool CheckAddOrEdit()
  94. {
  95. if (isEdit)
  96. {
  97. customerType.Attributes.Add("hidden", "hidden");
  98. }
  99. else
  100. {
  101. customerType.Attributes.Remove("hidden");
  102. }
  103. return isEdit;
  104. }
  105. public string GetFunctionIdByUserType(string functionIdAgent, string functionIdAdmin)
  106. {
  107. return (GetStatic.GetUserType() == "HO") ? functionIdAdmin : functionIdAgent;
  108. }
  109. private void GetAddressDetailsByZipCode()
  110. {
  111. string zipCode = Request.Form["zipCode"];
  112. string rowID = Request.Form["RowID"];
  113. string customerId = GetCustomerId();
  114. var dr = _cd.GetAddressByZipCodeNew(zipCode, GetStatic.GetUser(), rowID, customerId);
  115. //CustomerAddress _cAddress = new CustomerAddress();
  116. //if (dr != null)
  117. //{
  118. // _cAddress.errrorCode = dr["errorCode"].ToString();
  119. // _cAddress.msg = dr["msg"].ToString();
  120. // if (dr["errorCode"].ToString() == "0")
  121. // {
  122. // _cAddress.State = dr["STATE_ID"].ToString();
  123. // _cAddress.City = dr["CITY_NAME"].ToString();
  124. // _cAddress.Street = dr["STREET_NAME"].ToString();
  125. // }
  126. //}
  127. var json = GetStatic.DataTableToJson(dr);
  128. GetStatic.JsonResponse(json, this);
  129. }
  130. private void GetCustomerDetails()
  131. {
  132. string eId = Request.Form["Id"];
  133. var dt = _cd.GetDetailsForEditCustomer(eId, GetStatic.GetUser());
  134. //hdnDocument.Value = populateDocument();
  135. Response.ContentType = "text/plain";
  136. var json = DataTableToJson(dt);
  137. Response.Write(json);
  138. Response.End();
  139. }
  140. public static string DataTableToJson(DataTable table)
  141. {
  142. if (table == null)
  143. return "";
  144. var list = new List<Dictionary<string, object>>();
  145. foreach (DataRow row in table.Rows)
  146. {
  147. var dict = new Dictionary<string, object>();
  148. foreach (DataColumn col in table.Columns)
  149. {
  150. dict[col.ColumnName] = string.IsNullOrEmpty(row[col].ToString()) ? "" : row[col];
  151. }
  152. list.Add(dict);
  153. }
  154. var serializer = new JavaScriptSerializer();
  155. string json = serializer.Serialize(list);
  156. return json;
  157. }
  158. private void PopulateDdl()
  159. {
  160. _sl.SetDDL(ref genderList, "EXEC proc_online_dropDownList @flag='GenderList',@user='" + GetStatic.GetUser() + "'", "valueId", "detailTitle", "", "Select..");
  161. _sl.SetDDL(ref countryList, "EXEC proc_online_dropDownList @flag='onlineCountrylist',@user='" + GetStatic.GetUser() + "'", "countryId", "countryName", "", "");
  162. _sl.SetDDL(ref nativeCountry, "EXEC proc_online_dropDownList @flag='allCountrylist',@user='" + GetStatic.GetUser() + "'", "countryId", "countryName", "", "Select..");
  163. _sl.SetDDL(ref occupation, "EXEC proc_online_dropDownList @flag='occupationList',@user='" + GetStatic.GetUser() + "'", "valueId", "detailTitle", "", "Select..");
  164. _sl.SetDDL(ref idType, "EXEC proc_online_dropDownList @flag='IdTypeWithDetails',@user='" + GetStatic.GetUser() + "',@countryId='" + countryList.SelectedValue + "'", "valueId", "detailTitle", "", "Select..");
  165. _sl.SetDDL(ref ddlCustomerType, "EXEC proc_online_dropDownList @flag='dropdownList',@user='" + GetStatic.GetUser() + "',@parentId=4700", "valueId", "detailTitle", ddlCustomerType.SelectedValue, "");
  166. _sl.SetDDL(ref ddlOrganizationType, "EXEC proc_online_dropDownList @flag='dropdownList',@user='" + GetStatic.GetUser() + "',@parentId=7002", "valueId", "detailTitle", "", "Select..");
  167. _sl.SetDDL(ref ddlnatureOfCompany, "EXEC proc_online_dropDownList @flag='dropdownList',@user='" + GetStatic.GetUser() + "',@parentId=7003", "valueId", "detailTitle", "", "Select..");
  168. _sl.SetDDL(ref ddlEmployeeBusType, "EXEC proc_online_dropDownList @flag='dropdownList',@user='" + GetStatic.GetUser() + "',@parentId=7004", "valueId", "detailTitle", "", "");
  169. _sl.SetDDL(ref ddlVisaStatus, "EXEC proc_online_dropDownList @flag='dropdownList',@user='" + GetStatic.GetUser() + "',@parentId=7005", "valueId", "detailTitle", "", "Select..");
  170. _sl.SetDDL(ref ddlPosition, "EXEC proc_online_dropDownList @flag='dropdownList',@user='" + GetStatic.GetUser() + "',@parentId=7006", "valueId", "detailTitle", "", "Select..");
  171. _sl.SetDDL(ref ddlState, "EXEC proc_online_dropDownList @flag='state',@countryId='" + countryList.SelectedValue + "'", "stateId", "stateName", "", "Select..");
  172. _sdd.SetDDL(ref ddlSearchBy, "exec proc_sendPageLoadData @flag='search-cust-by'", "VALUE", "TEXT", "", "");
  173. _sdd.SetStaticDdl(ref ddlDocType, "7009", "", "Select");
  174. }
  175. protected void register_Click(object sender, EventArgs e)
  176. {
  177. string eId = GetStatic.ReadQueryString("customerId", "");
  178. string verifyType = GetStatic.ReadQueryString("type", "");
  179. //string createdFrom = GetStatic.ReadQueryString("createdUserFrom", "");
  180. string createdFrom = hdnCreatedFrom.Value;
  181. if (eId == "")
  182. {
  183. if (!_sl.HasRight(GetFunctionIdByUserType(AddFunctionIdFromAgent, AddFunctionIdFromMobile)))
  184. {
  185. GetStatic.AlertMessage(this, "You are not authorized to Add Customer!");
  186. return;
  187. }
  188. }
  189. else
  190. {
  191. if (!_sl.HasRight(GetFunctionIdByUserType(SaveEditIdFromAgent, SaveEditIdFromMobile)))
  192. {
  193. GetStatic.AlertMessage(this, "You are not authorized to Edit Customer!");
  194. return;
  195. }
  196. }
  197. if (hddTxnsMade.Value == "Y" && (!email.Text.Equals(hddOldEmailValue.Value.ToString())))
  198. {
  199. GetStatic.AlertMessage(this, "You can not change the email of customer who have already done transaction!");
  200. return;
  201. }
  202. //if (_sl.HasRight(SignatureFunctionIdFromAgent) && !isEdit && (string.IsNullOrEmpty(customerPassword.Text) || string.IsNullOrWhiteSpace(customerPassword.Text)) && (string.IsNullOrEmpty(hddImgURL.Value) || string.IsNullOrWhiteSpace(hddImgURL.Value)))
  203. //{
  204. // GetStatic.AlertMessage(this, "Customer signature or customer password is required!");
  205. // return;
  206. //}
  207. //if (_sl.HasRight(SignatureFunctionIdFromMobile) && !isEdit && (string.IsNullOrEmpty(customerPassword.Text) || string.IsNullOrWhiteSpace(customerPassword.Text)) && (string.IsNullOrEmpty(hddImgURL.Value) || string.IsNullOrWhiteSpace(hddImgURL.Value)))
  208. //{
  209. // GetStatic.AlertMessage(this, "Customer signature or customer password is required!");
  210. // return;
  211. //}
  212. string trimmedfirstName = firstName.Text.Trim() == "" ? null : firstName.Text.Trim();
  213. string trimmedMiddleName = middleName.Text.Trim() == "" ? null : middleName.Text.Trim();
  214. string trimmedlastName = lastName.Text.Trim() == "" ? null : lastName.Text.Trim();
  215. string area = Request.Form["ctl00$ContentPlaceHolder1$txtStreet"];
  216. OnlineCustomerModel customerModel = new OnlineCustomerModel()
  217. {
  218. flag = "customer-register-core",
  219. firstName = trimmedfirstName,
  220. middleName = trimmedMiddleName,
  221. lastName1 = trimmedlastName,
  222. gender = genderList.SelectedValue,
  223. customerType = ddlCustomerType.SelectedValue,
  224. country = countryList.Text,
  225. address = addressLine1.Text,
  226. zipCode = zipCode.Text,
  227. street = Request.Form["ctl00$ContentPlaceHolder1$txtStreet"],
  228. AdditionalAddress = txtAdditionalAddress.Text,
  229. city = cityHidden.Value,
  230. state = ddlStateHidden.Value,
  231. senderCityjapan = txtsenderCityjapan.Text,
  232. email = email.Text,
  233. streetJapanese = txtstreetJapanese.Text,
  234. homePhone = phoneNumber.Text,
  235. mobile = mobile.Text,
  236. visaStatus = ddlVisaStatus.SelectedValue,
  237. employeeBusinessType = ddlEmployeeBusType.SelectedValue,
  238. nativeCountry = nativeCountry.SelectedValue,
  239. dob = dob.Text,
  240. occupation = occupation.Text,
  241. telNo = phoneNumber.Text,
  242. ipAddress = GetStatic.GetIp(),
  243. createdBy = GetStatic.GetUser(),
  244. idNumber = verificationTypeNo.Text,
  245. idIssueDate = IssueDate.Text,
  246. idExpiryDate = ExpireDate.Text,
  247. idType = idType.Text.Split('|')[0].ToString(),
  248. membershipId = txtMembershipId.Text,
  249. remitanceAllowed = (rbRemitanceAllowed.SelectedValue == "Enabled" ? true : false),
  250. onlineUser = (rbOnlineLogin.SelectedValue == "Enabled" ? true : false),
  251. mobileUser = (rbMobileLogin.SelectedValue == "Enabled" ? true : false),
  252. remarks = txtRemarks.Text,
  253. registrationNo = txtRegistrationNo.Text,
  254. natureOfCompany = ddlnatureOfCompany.Text,
  255. organizationType = ddlOrganizationType.SelectedValue,
  256. dateOfIncorporation = txtDateOfIncorporation.Text,
  257. position = ddlPosition.SelectedValue,
  258. nameofAuthoPerson = txtNameofAuthoPerson.Text,
  259. nameofEmployeer = txtNameofEmployeer.Text,
  260. companyName = txtCompanyName.Text,
  261. MonthlyIncome = ddlSalary.Text,
  262. IsCounterVisited = customerCounterVisit.Checked ? "Y" : "N",
  263. customerPassword = customerPassword.Text,
  264. agentId = GetStatic.GetAgent().ToInt(),
  265. DocumentType = ddlDocType.SelectedValue,
  266. occupationOther = occupationText.Text,
  267. otherIdNumber = otherVerificationTypeNo.Text
  268. };
  269. if (hdnCustomerId.Value != "")
  270. {
  271. customerModel.customerId = hdnCustomerId.Value;
  272. customerModel.flag = "customer-editeddata";
  273. }
  274. var dbResult = _cd.RegisterCustomerNewAgent(customerModel);
  275. if (dbResult.ErrorCode == "0" && !string.IsNullOrEmpty(hddImgURL.Value) && !string.IsNullOrWhiteSpace(hddImgURL.Value))
  276. {
  277. var customerDetails = _cd.GetRequiredCustomerDetails(dbResult.Id, GetStatic.GetUser());
  278. string membershipId = Convert.ToString(customerDetails["membershipId"]);
  279. string registrationDate = Convert.ToString(customerDetails["createdDate"]);
  280. var verificationCode = dbResult.Id;
  281. var customerId = dbResult.Id;
  282. var fileCollection = Request.Files;
  283. if (UploadSignatureImage(hddImgURL.Value, registrationDate, membershipId, customerId) == 0)
  284. {
  285. _cd.AddCustomerSignature(customerId, GetStatic.GetUser(), customerId + "_signature.png");
  286. }
  287. }
  288. if (dbResult.ErrorCode == "0")
  289. {
  290. saveCustomerDocument(dbResult);
  291. Approve(sender, e, createdFrom, verifyType);
  292. }
  293. GetStatic.SetMessage(dbResult.ErrorCode, dbResult.Msg);
  294. Page_Load(sender, e);
  295. return;
  296. }
  297. public int UploadSignatureImage(string imageData, string registerDate, string membershipId, string customerId)
  298. {
  299. int errorCode = 0;
  300. try
  301. {
  302. string path = GetStatic.ReadWebConfig("customerDocPath", "") + "CustomerDocument\\" + registerDate.Replace("-", "\\") + "\\" + membershipId;
  303. if (!Directory.Exists(path))
  304. Directory.CreateDirectory(path);
  305. string fileName = path + "\\" + customerId + "_signature" + ".png";
  306. using (FileStream fs = new FileStream(fileName, FileMode.CreateNew))
  307. {
  308. using (BinaryWriter bw = new BinaryWriter(fs))
  309. {
  310. byte[] data = Convert.FromBase64String(imageData);
  311. bw.Write(data);
  312. bw.Close();
  313. }
  314. }
  315. }
  316. catch (Exception)
  317. {
  318. errorCode = 1;
  319. }
  320. return errorCode;
  321. }
  322. protected void Approve(object sender, EventArgs e, string createdFrom, string verifyType)
  323. {
  324. string userCreatedFrm = GetStatic.ReadQueryString("createdUserFrom", "");
  325. DataSet ds = new DataSet();
  326. if (GetRequestFrom() == "agent")
  327. {
  328. ds = _cd.ApprovePending(GetCustomerId(), GetStatic.GetUser(), "");
  329. }
  330. else
  331. {
  332. ds = _cd.ApprovePendingFromMobile(GetCustomerId(), GetStatic.GetUser(), createdFrom, verifyType, "");
  333. }
  334. DbResult dbRes = _cd.ParseDbResult(ds.Tables[0]);
  335. if (dbRes.ErrorCode == "1")
  336. {
  337. GetStatic.AlertMessage(this.Page, dbRes.Msg);
  338. }
  339. else
  340. {
  341. dbRes.Msg = "Customer saved and approved successfully!!!";
  342. GetStatic.SetMessage(dbRes);
  343. if (dbRes.Extra.ToLower() == "y" && dbRes.Extra2.ToLower() == "approved")
  344. {
  345. Response.Redirect("/MobileRemit/Agent/ApproveCustomer/List.aspx");
  346. return;
  347. }
  348. if (dbRes.Extra.ToLower() == "y" && dbRes.Extra2.ToLower() == "verified")
  349. {
  350. Response.Redirect("/MobileRemit/Agent/ApproveCustomer/VerifyList.aspx");
  351. return;
  352. }
  353. if (GetRequestFrom() == "mobile" && dbRes.Extra2.ToLower() == "approved")
  354. {
  355. Response.Redirect("/AgentNew/Transaction/Letters/LetterForCustomerFromMobile.aspx?createdFrom=" + createdFrom + "&customerId=" + GetCustomerId() + "&membershipId=" + ds.Tables[1].Rows[0]["account"].ToString() + "");
  356. }
  357. else
  358. {
  359. Response.Redirect("/AgentNew/Transaction/Letters/LetterForCustomerFromOthers.aspx?customerId=" + GetCustomerId() + "&membershipId=" + ds.Tables[1].Rows[0]["account"].ToString() + "");
  360. }
  361. }
  362. }
  363. public void GetImageUrl()
  364. {
  365. var customerId = Request.Form["customerId"];
  366. var membershipId = Request.Form["membershipId"];
  367. var registerDate = Request.Form["registerDate"];
  368. var documentDetails = _cd.GetDocumentByCustomerId(customerId);
  369. string[] imageUrlArray = new string[documentDetails.Rows.Count+1];
  370. if (documentDetails != null)
  371. {
  372. int i = 0;
  373. int j = 1;
  374. foreach (DataRow item in documentDetails.Rows)
  375. {
  376. string imageUrl = "";
  377. string docName = "";
  378. if (item["documentType"].ToString() == "0")
  379. {
  380. docName = "Signature";
  381. imageUrl = "/Handler/CustomerSignature.ashx?registerDate=" + Convert.ToDateTime(registerDate).ToString("yyyy-MM-dd") + "&customerId=" + customerId + "&membershipNo=" + membershipId + "&fileName=" + item["fileName"]; ;
  382. imageUrlArray[i] = imageUrl;
  383. }
  384. else
  385. {
  386. docName = item["documentName"].ToString();
  387. imageUrl = "/Handler/CustomerSignature.ashx?registerDate=" + Convert.ToDateTime(registerDate).ToString("yyyy-MM-dd") + "&customerId=" + customerId + "&membershipNo=" + membershipId + "&fileName=" + item["fileName"];
  388. imageUrlArray[j] = imageUrl;
  389. j++;
  390. }
  391. }
  392. }
  393. Response.ContentType = "text/plain";
  394. var serializer = new JavaScriptSerializer();
  395. var json = serializer.Serialize(imageUrlArray);
  396. Response.Write(json);
  397. Response.End();
  398. }
  399. private void saveCustomerDocument(DbResult dbresult)
  400. {
  401. var result = dbresult.Id.Split('|');
  402. var customerId = result[0];
  403. var membershipId = result[1];
  404. var registerDate = result[2];
  405. HttpFileCollection fileCollection = Request.Files;
  406. for (int i = 0; i < fileCollection.AllKeys.Length; i++)
  407. {
  408. HttpPostedFile file = fileCollection[i];
  409. if (file != null)
  410. {
  411. string documentTypeName = "";
  412. string documentType = "";
  413. string fileType = "";
  414. if (i == 0)
  415. {
  416. documentTypeName = "Alien Registration Card(Front)";
  417. documentType = "11054";
  418. }
  419. else
  420. {
  421. documentTypeName = "Alien Registration Card(Back)";
  422. documentType = "11055";
  423. }
  424. string fileName = (!string.IsNullOrWhiteSpace(file.FileName) ? UploadDocument(file, customerId, documentTypeName, membershipId, registerDate, out fileType) : UploadDocument(file, customerId, documentType, membershipId, registerDate, out fileType));
  425. CustomerDocument cm = new CustomerDocument();
  426. cm.customerId = result[0];
  427. cm.fileDescription = "";
  428. cm.documentType = documentType;
  429. cm.fileUrl = fileName;
  430. cm.fileType = fileType;
  431. var res = _cd.UpdateCustomerDocument("", customerId, fileName, documentTypeName, fileType, documentType, GetStatic.GetUser());
  432. }
  433. }
  434. }
  435. private string UploadDocument(HttpPostedFile doc, string customerId, string documentType, string membershipId, string registeredDate, out string fileType)
  436. {
  437. fileType = "";
  438. string fName = "";
  439. try
  440. {
  441. fileType = doc.ContentType;
  442. string fileExtension = new FileInfo(doc.FileName).Extension;
  443. string documentExtension = GetStatic.ReadWebConfig("customerDocFileExtension", "");
  444. if (documentExtension.ToLower().Contains(fileExtension.ToLower()))
  445. {
  446. string fileName = customerId + "_" + documentType + "_" + DateTime.Now.Hour.ToString() + DateTime.Now.Millisecond.ToString() + "_" + registeredDate.Replace("-", "_") + fileExtension;
  447. string path = GetStatic.GetCustomerFilePath() + "CustomerDocument\\" + registeredDate.Replace("-", "\\") + "\\" + membershipId;
  448. if (!Directory.Exists(path))
  449. Directory.CreateDirectory(path);
  450. doc.SaveAs(path + "/" + fileName);
  451. fName = fileName;
  452. }
  453. else
  454. {
  455. fName = "notValid";
  456. }
  457. }
  458. catch (Exception ex)
  459. {
  460. fName = "";
  461. }
  462. return fName;
  463. }
  464. private void GetSignature()
  465. {
  466. var customerId = Request.Form["customerId"];
  467. var response = GetSignatrueHtml("Staff Visit - Customer Register(Customer Signature)", customerId);
  468. Response.ContentType = "text/plain";
  469. var serializer = new JavaScriptSerializer();
  470. var json = serializer.Serialize(response);
  471. Response.Write(json);
  472. Response.End();
  473. }
  474. public string GetSignatrueHtml(string fileDescription, string sessionId)
  475. {
  476. var membershipId = Request.Form["membershipId"];
  477. var customerId = Request.Form["customerId"];
  478. var registerDate = Request.Form["registerDate"];
  479. var documentDetails = _cd.GetDocumentByCustomerIdNew(customerId, fileDescription, sessionId);
  480. string imageUrl = "";
  481. if (documentDetails != null)
  482. {
  483. foreach (DataRow item in documentDetails.Rows)
  484. {
  485. var fileName = item["fileName"].ToString();
  486. imageUrl = "/Handler/CustomerSignature.ashx?registerDate=" + Convert.ToDateTime(registerDate).ToString("yyyy-MM-dd") + "&customerId=" + customerId + "&membershipNo=" + membershipId + "&fileName=" + fileName;
  487. }
  488. }
  489. return imageUrl;
  490. }
  491. }
  492. }