From 9ad7b9560244463503e21592ac28918f5ad1c4ec Mon Sep 17 00:00:00 2001 From: gagan Date: Wed, 19 Aug 2020 12:02:51 +0000 Subject: [PATCH] --- .../PublishProfiles/FolderProfile.pubxml.user | 14 ++- .../Scripts/AddIdPitcure/addPicture.js | 6 + JMEAgentSystem/Site.Master | 1 + .../WebPages/AddIdPicture/Manage.aspx | 101 +++++++++++++++ .../WebPages/AddIdPicture/Manage.aspx.cs | 118 ++++++++++++++++++ .../AddIdPicture/Manage.aspx.designer.cs | 60 +++++++++ 6 files changed, 296 insertions(+), 4 deletions(-) create mode 100644 JMEAgentSystem/Scripts/AddIdPitcure/addPicture.js create mode 100644 JMEAgentSystem/WebPages/AddIdPicture/Manage.aspx create mode 100644 JMEAgentSystem/WebPages/AddIdPicture/Manage.aspx.cs create mode 100644 JMEAgentSystem/WebPages/AddIdPicture/Manage.aspx.designer.cs diff --git a/JMEAgentSystem/Properties/PublishProfiles/FolderProfile.pubxml.user b/JMEAgentSystem/Properties/PublishProfiles/FolderProfile.pubxml.user index dfd5bd3..e329896 100644 --- a/JMEAgentSystem/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/JMEAgentSystem/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -55,10 +55,10 @@ by editing this MSBuild file. In order to learn more about this please visit htt 08/11/2020 16:56:02 - 08/19/2020 14:58:27 + 08/19/2020 17:26:43 - 08/19/2020 14:58:27 + 08/19/2020 17:26:43 08/11/2020 16:56:02 @@ -771,6 +771,9 @@ by editing this MSBuild file. In order to learn more about this please visit htt 08/11/2020 16:56:08 + + 08/19/2020 16:51:33 + 08/11/2020 16:56:08 @@ -877,7 +880,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt 08/11/2020 16:56:08 - 08/19/2020 12:34:34 + 08/19/2020 16:41:48 08/11/2020 16:56:08 @@ -889,7 +892,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt 08/11/2020 16:56:08 - 08/17/2020 12:28:30 + 08/19/2020 16:59:11 10/25/2019 16:47:02 @@ -1305,6 +1308,9 @@ by editing this MSBuild file. In order to learn more about this please visit htt 08/11/2020 16:56:09 + + 08/19/2020 17:03:14 + 08/12/2020 15:58:42 diff --git a/JMEAgentSystem/Scripts/AddIdPitcure/addPicture.js b/JMEAgentSystem/Scripts/AddIdPitcure/addPicture.js new file mode 100644 index 0000000..ac07bc0 --- /dev/null +++ b/JMEAgentSystem/Scripts/AddIdPitcure/addPicture.js @@ -0,0 +1,6 @@ +function ValidateRequiredfields() { + var reqField = "reg_back_id,reg_front_id,"; + if (ValidRequiredFieldWithDoc(reqField) === false) { + return false; + } +} \ No newline at end of file diff --git a/JMEAgentSystem/Site.Master b/JMEAgentSystem/Site.Master index a620df4..18a1e0a 100644 --- a/JMEAgentSystem/Site.Master +++ b/JMEAgentSystem/Site.Master @@ -163,6 +163,7 @@
  • Register Customer
  • Add Beneficiary
  • Send Money - Request
  • +
  • Add ID Picture
  • diff --git a/JMEAgentSystem/WebPages/AddIdPicture/Manage.aspx b/JMEAgentSystem/WebPages/AddIdPicture/Manage.aspx new file mode 100644 index 0000000..cafd1b4 --- /dev/null +++ b/JMEAgentSystem/WebPages/AddIdPicture/Manage.aspx @@ -0,0 +1,101 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Manage.aspx.cs" Inherits="JMEAgentSystem.WebPages.AddIdPicture.Manage" %> + + +
    + +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    Upload Id Picture
    +
    +
    +
    + +
    + +
    + sample image +
    + sample image +
    +
    +
    +
    + + <%----%> + + + + +
    +
    +
    + +
    +
    + +
    + +
    + sample image +
    + sample image +
    +
    +
    +
    + + <%----%> + + +
    +
    +
    +
    +
    + <%----%> + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + diff --git a/JMEAgentSystem/WebPages/AddIdPicture/Manage.aspx.cs b/JMEAgentSystem/WebPages/AddIdPicture/Manage.aspx.cs new file mode 100644 index 0000000..78a61fa --- /dev/null +++ b/JMEAgentSystem/WebPages/AddIdPicture/Manage.aspx.cs @@ -0,0 +1,118 @@ +using Business.Configuration; +using Business.Customer; +using Common.Helper; +using Common.Model.CustomerModel; +using Common.Utility; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace JMEAgentSystem.WebPages.AddIdPicture +{ + public partial class Manage : System.Web.UI.Page + { + private readonly ICustomerServices _customerServices = AutoFacContainer.Resolve(); + protected void Page_Load(object sender, EventArgs e) + { + + } + + protected void upload_Click(object sender, EventArgs e) + { + try + { + //checked file extention + HttpFileCollection fileCollectionNew = Request.Files; + string documentExtension = GetStatic.ReadWebConfig("customerDocFileExtension", ""); + for (int i = 0; i < fileCollectionNew.AllKeys.Length; i++) + { + HttpPostedFile file = fileCollectionNew[i]; + string fileExtension = new FileInfo(file.FileName).Extension; + + if (!documentExtension.ToLower().Contains(fileExtension.ToLower())) + { + GetStatic.AlertMessage(this, "Invalid File Extenstion"); + return; + } + } + + + DbResult response = saveCustomerDocument(); + GetStatic.AlertMessage(this.Page, response.Msg); + } + catch (Exception ex) + { + GetStatic.AlertMessage(this.Page, ex.Message); + } + } + private DbResult saveCustomerDocument() + { + HttpFileCollection fileCollection = Request.Files; + DbResult res = new DbResult(); + + for (int i = 0; i < fileCollection.AllKeys.Length; i++) + { + HttpPostedFile file = fileCollection[i]; + if (file != null) + { + string documentTypeName = ""; + string documentType = ""; + string fileType = ""; + if (i == 0) + { + documentTypeName = "Alien Registration Card(Front)"; + documentType = "11054"; + } + else + { + documentTypeName = "Alien Registration Card(Back)"; + documentType = "11055"; + } + string fileName = (!string.IsNullOrWhiteSpace(file.FileName) ? UploadDocument(file, GetStatic.GetUser(), documentTypeName, out fileType) : UploadDocument(file, GetStatic.GetUser(), documentTypeName, out fileType)); + CustomerDocument cm = new CustomerDocument(); + cm.customerId = ""; + cm.fileDescription = ""; + cm.documentType = documentType; + cm.fileUrl = fileName; + cm.fileType = fileType; + res = _customerServices.UpdateCustomerDocument("", "0", fileName, documentType, "image/png", documentType, GetStatic.GetUser()); + } + } + return res; + } + private string UploadDocument(HttpPostedFile doc, string user, string documentTypeName, out string fileType) + { + fileType = ""; + string fName = ""; + try + { + fileType = doc.ContentType; + string fileExtension = new FileInfo(doc.FileName).Extension; + string documentExtension = GetStatic.ReadWebConfig("customerDocFileExtension", ""); + if (documentExtension.ToLower().Contains(fileExtension.ToLower())) + { + string fileName = user + "_" + documentTypeName + "_" + DateTime.Now.Hour.ToString() + DateTime.Now.Millisecond.ToString() + fileExtension; + string path = GetStatic.GetCustomerFilePath() + "CustomerDocument\\" + "ID Collection\\" + user; + if (!Directory.Exists(path)) + Directory.CreateDirectory(path); + doc.SaveAs(path + "/" + fileName); + fName = fileName; + } + else + { + fName = "notValid"; + } + + } + catch (Exception ex) + { + fName = ""; + } + return fName; + } + } +} \ No newline at end of file diff --git a/JMEAgentSystem/WebPages/AddIdPicture/Manage.aspx.designer.cs b/JMEAgentSystem/WebPages/AddIdPicture/Manage.aspx.designer.cs new file mode 100644 index 0000000..a186d25 --- /dev/null +++ b/JMEAgentSystem/WebPages/AddIdPicture/Manage.aspx.designer.cs @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace JMEAgentSystem.WebPages.AddIdPicture { + + + public partial class Manage { + + /// + /// regUp control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl regUp; + + /// + /// addEditPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl addEditPanel; + + /// + /// reg_front_id control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.FileUpload reg_front_id; + + /// + /// reg_back_id control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.FileUpload reg_back_id; + + /// + /// upload control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button upload; + } +}