private string varifySUS(string FName, string MName, string LName) { try { string ofacVerify = string.Empty; ofacservice.OFACService service; service = new ofacservice.OFACService(); string token = service.Logon(1881, "abimatu", "b3t5vi113"); string xml = service.OFACScanName(token, FName + " " + MName + " " + LName); if (xml != "") { ofacVerify = ProcessXML(xml, FName, MName, LName); //ofacVerify = "N"; if (ofacVerify == "Y") { return("Y"); //SUS } else { return("N");// Not SUS } } } catch (Exception ex) { return("N"); } return("N"); }
private void checkOFAC(string name) { try { string ofacVerify = string.Empty; ofacservice.OFACService service; service = new ofacservice.OFACService(); string token = service.Logon(3317, "KoromStar", "NRzhq8kc"); string xml = service.OFACScanName(token, name); if (xml != "") { ofacVerify = ProcessXML(xml, name); if (ofacVerify == "Y") { txtName.BackColor = System.Drawing.Color.Red; } else { txtName.BackColor = System.Drawing.Color.Green; } } } catch (Exception ex) { lblmessage.Text = "OFAC Login Problem...<br/> So without Checking OFAC we are adding this Customer.<br/>Please Contact with OFAC Office or better the Develeoper of this software(Anam)"; } }
protected void Button1_Click(object sender, EventArgs e) { string ofacVerify = string.Empty; ofacservice.OFACService service; service = new ofacservice.OFACService(); string token = service.Logon(1881, "abimatu", "b3t5vi113"); string xml = service.OFACScanName(token, txtCUSTFNAME.Text + " " + txtCUSTMNAME.Text + " " + txtCUSTLNAME.Text); if (xml != "") { ofacVerify = ProcessXML(xml); } Label1.Text = ofacVerify; }
protected void btnSave_Click(object sender, EventArgs e) { if (txtCUSTFNAME.Text != "" && txtCUSTCPHONE.Text != "") { lblOfacMessage.Text = ""; //lblCheckSus.Text = ""; lblMessage.Text = ""; CUSTOMER cUSTOMER = new CUSTOMER(); cUSTOMER.EMTID = ""; cUSTOMER.USERNAME = ""; cUSTOMER.CUSTFNAME = txtCUSTFNAME.Text; cUSTOMER.CUSTMNAME = txtCUSTMNAME.Text; cUSTOMER.CUSTLNAME = txtCUSTLNAME.Text; cUSTOMER.CUSTADDRESS1 = txtCUSTADDRESS1.Text; cUSTOMER.CUSTADDRESS2 = txtCUSTADDRESS2.Text; cUSTOMER.CUSTCITY = txtCUSTCITY.Text; cUSTOMER.CUSTSTATE = txtCUSTSTATE.Text; cUSTOMER.CUSTZIP = txtCUSTZIP.Text; cUSTOMER.CUSTHPHONE = txtCUSTHPHONE.Text; cUSTOMER.CUSTCPHONE = txtCUSTCPHONE.Text; cUSTOMER.CUSTWPHONE = txtCUSTWPHONE.Text; cUSTOMER.CUSTSSN = txtCUSTSSN.Text; cUSTOMER.CUSTDRIVINGLICENSE = txtDrivingLicense.Text; cUSTOMER.CUSTIDTYPE = Int32.Parse(ddlCUST.SelectedValue); cUSTOMER.CUSTIDNUMBER = txtCUSTIDNUMBER.Text; cUSTOMER.CUSTDOB = DateTime.Parse(txtCUSTDOB.Text); cUSTOMER.CUSTISSUEDATE = DateTime.Parse(txtCUSTISSUEDATE.Text); cUSTOMER.CUSTEXPIREDATE = DateTime.Parse(txtCUSTEXPIREDATE.Text); cUSTOMER.ISOFACVERIFIED = "Y"; cUSTOMER.CUSTREMARKS = txtCUSTREMARKS.Text; cUSTOMER.SCANURL = ""; cUSTOMER.CREATEDBY = 1; cUSTOMER.CREATEDON = DateTime.Now; cUSTOMER.UPDATEDBY = 1; cUSTOMER.UPDATEDON = DateTime.Now; if (uplFile.PostedFile != null && uplFile.PostedFile.ContentLength > 0) { try { string dirUrl = "~/Uploads/Customer"; string dirPath = Server.MapPath(dirUrl); if (!Directory.Exists(dirPath)) { Directory.CreateDirectory(dirPath); } string fileName = Path.GetFileName(uplFile.PostedFile.FileName); string fileUrl = dirUrl + "/" + Path.GetFileName(uplFile.PostedFile.FileName); string filePath = Server.MapPath(fileUrl); uplFile.PostedFile.SaveAs(filePath); cUSTOMER.SCANURL = dirUrl + "/" + fileName; } catch (Exception ex) { lblMessage.Text = ex.Message.ToString(); } } else { cUSTOMER.SCANURL = "~/Uploads/Customer/no_image.jpeg"; } int resutl = 0; try { string ofacVerify = string.Empty; ofacservice.OFACService service; service = new ofacservice.OFACService(); string token = service.Logon(1881, "abimatu", "b3t5vi113"); string xml = service.OFACScanName(token, txtCUSTFNAME.Text + " " + txtCUSTMNAME.Text + " " + txtCUSTLNAME.Text); if (xml != "") { ofacVerify = ProcessXML(xml); //ofacVerify = "N"; if (ofacVerify == "Y") { cUSTOMER.ISOFACVERIFIED = ofacVerify; lblOfacMessage.Text = "Suspecious Activity Found."; //lblOfacMessage.Text = ofacVerify.ToString(); List <CUSTOMER> cUSTOMER1 = new List <CUSTOMER>(); cUSTOMER1 = CUSTOMERManager.GetAllCUSTOMERsByCUSTIDNUMBER_CUSTDOB(txtCUSTIDNUMBER.Text, DateTime.Parse(txtCUSTDOB.Text)); //lblMessage.Text = cUSTOMER1.Count.ToString(); if (cUSTOMER1.Count == 0) { panlIFrame.Visible = true; if (lblCheckSus.Text == "1") { if (chkSuspicious.Checked == true) { cUSTOMER.ISOFACVERIFIED = "N"; } else { cUSTOMER.ISOFACVERIFIED = "Y"; } resutl = CUSTOMERManager.InsertCUSTOMER(cUSTOMER); } } else { panlIFrame.Visible = false; cUSTOMER.ISOFACVERIFIED = "N"; resutl = CUSTOMERManager.InsertCUSTOMER(cUSTOMER); } } else { lblOfacMessage.Text = "Suspecious Activity Not Found."; //lblOfacMessage.Text = ofacVerify.ToString(); panlIFrame.Visible = false; cUSTOMER.ISOFACVERIFIED = "Y"; resutl = CUSTOMERManager.InsertCUSTOMER(cUSTOMER); } } //int resutl = CUSTOMERManager.InsertCUSTOMER(cUSTOMER); if (resutl > 0) { lblMessage.Text = "Saved Successfully .<br/><a href='SearchFoodReceiverPage.aspx'>Next</a>"; Session["snFoodsenderID"] = resutl.ToString(); //Response.Redirect("SearchReceiverPage.aspx"); } } catch (Exception ex) { lblMessage.Text = "OFAC Login Problem...<br/> So without Checking OFAC we are adding this Customer.<br/>Please Contact with OFAC Office or better the Develeoper of this software(Anam)"; cUSTOMER.ISOFACVERIFIED = "Y"; resutl = CUSTOMERManager.InsertCUSTOMER(cUSTOMER); if (resutl > 0) { lblMessage.Text += "<br/>Saved Successfully .<br/>Go for <a href='SearchFoodReceiverPage.aspx' style='font-size:30px;'>Next >></a>"; Session["snFoodsenderID"] = resutl.ToString(); //Response.Redirect("SearchReceiverPage.aspx"); } } //if (resutl > 0) //{ // lblMessage.Text = "Saved Successfully"; // Session["snFoodsenderID"] = resutl.ToString(); // Response.Redirect("SearchFoodReceiverPage.aspx"); //} } else { lblMessage.Text = "Please enter the First Name and Cell #..."; lblMessage.ForeColor = System.Drawing.Color.Red; } }