EXPLAIN ABOUT ACTIVE X DATA OBJECT?

Rajesh Goswami

Total Post:85

Points:425
Posted by  Rajesh Goswami
 1648  View(s)
Ratings:
Rate this:
  1. hanmandlu vasani

    Post:30

    Points:150
    Explain about Active X data object?

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    namespace DDSolutionBE

    {

        public class ViewBankExceptionsBE

        {

            public int MasterDataID { get; set; }

            public string ParticipantID { get; set; }

            public string GroupNumber { get; set; }

            public DateTime TransactionDate { get; set; }

            public string CustFirstName { get; set; }

            public string CustLastName { get; set; }

           // public string CustomerName { get; set; }

            public string AccountNumber { get; set; }

            public string ExceptionType { get; set; }

            public string ErrorCode { get; set; }

            public string ErrorDescription { get; set; }

            public string BankName { get; set; }

            public int FileId { get; set; }

            public double Amount { get; set; }

            public int TotalRecords { get; set; }

            public string FileName { get; set; }

            public string FileType { get; set; }

            public DateTime FileGenerationDateTime { get; set; }

            public DateTime FileGenerationEndDateTime { get; set; }

            public string FilePath { get; set; }

            public bool isActive { get; set; }

            public DateTime CreatedDateTime { get; set; }

            public int UserID { get; set; }

            public int ParentFileID { get; set; }

            public string MasterData { get; set; }

            public string Date { get; set; }

            public string Adress1 { get; set; }

            public string Adress2 { get; set; }

            public string Adress3 { get; set; }

            public string PostalCode { get; set; }

            public string Parish { get; set; }

            public string GrpName { get; set; }

        }

    }

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    using System.Data;

    using DDSolutionDALC;

    using DDSolutionBE;

    namespace DDSolutionBO

    {

        public class ViewBankExceptionsBO

        {

            PolicyholderDAL dalPH = new PolicyholderDAL();

            ViewBankExceptionsDAL vbedal = new ViewBankExceptionsDAL();

          

            public IEnumerable<LuminXParticipantsBE> GetPolicyholdersFromLuminx(string strFname, stringstrLname, string strMInit, string strParticID, string strGrpID)

            {

                try

                {

                    return dalPH.GetPolicyholdersFromLuminx(strFname, strLname, strMInit, strParticID, strGrpID);

                }

                catch (Exception ex)

                {

                    throw new Exception(ex.Message);

                }

            }

            public IEnumerable<LuminXParticipantsBE> GetPolicyholdersFromLuminxByGroup(string strGrpID, stringstrGrName)

            {

                try

                {

                    return dalPH.GetPolicyholdersFromLuminxByGroup(strGrpID, strGrName);

                }

                catch (Exception ex)

                {

                    throw new Exception(ex.Message);

                }

            }

            public DataTable GetAllDDExceptionRecords(string BankName,string PHolder,string FromDate,stringToDate)

            {

                try

                {

                    return vbedal.GetAllDDExceptionRecords(BankName, PHolder,FromDate, ToDate);

                }

                catch (Exception ex)

                {

                    throw new Exception(ex.Message);

                }

            }

            public IEnumerable<ViewBankExceptionsBE> GetExceptionByParticpants(string strBankName, stringstrFromDate, string strToDate)

            {

                return vbedal.GetExceptionByParticpants(strBankName, strFromDate, strToDate);

            }

            public IEnumerable<ViewBankExceptionsBE> GetExceptionByGroup(string strBankName, string strFromDate,string strToDate)

            {

                return vbedal.GetExceptionByGroup(strBankName, strFromDate, strToDate);

            }

            public DataTable CheckFileGeneration(string IndorGrp)

            {

                return vbedal.CheckFileGeneration(IndorGrp);

            }

            public IEnumerable<ViewBankExceptionsBE> GetExceptionsFileType()

            {

                try

                {

                    return vbedal.GetExceptionsFileType();

                }

                catch (Exception ex)

                {

                    throw new Exception(ex.Message);

                }

            }

            public String InsertintoLuminXPaymentPostingHeader(ViewBankExceptionsBE vbebe)

            {

                try

                {

                    return vbedal.InsertintoLuminXPaymentPostingHeader(vbebe);

                }

                catch (Exception ex)

                {

                    throw new Exception(ex.Message);

                }

            }

            public String InsertintoLuminXPaymentPostingDetails(ViewBankExceptionsBE vbebe)

            {

                try

                {

                    return vbedal.InsertintoLuminXPaymentPostingDetails(vbebe);

                }

                catch (Exception ex)

                {

                    throw new Exception(ex.Message);

                }

            }

            public String UpdateLuminXPaymentPostingHeader(ViewBankExceptionsBE vbebe)

            {

                try

                {

                    return vbedal.UpdateLuminXPaymentPostingHeader(vbebe);

                }

                catch (Exception ex)

                {

                    throw new Exception(ex.Message);

                }

            }

            public void DeleteEntry(ViewBankExceptionsBE vbebe)

            {

                try

                {

                    vbedal.DeleteEntry(vbebe);

                }

                catch (Exception ex)

                {

                    throw ex;

                }

            }

        }

    }

    using System;

    using System.Collections.Generic;

    using System.Collections.ObjectModel;

    using System.Linq;

    using System.Text;

    using System.Data;

    using DDSolutionBE;

    namespace DDSolutionDALC

    {

        public class ViewDDExceptionsDAL

        {

            DDSolutionClassDataContext context = new DDSolutionClassDataContext();

            GeneralDAL gnl = new GeneralDAL();

            LoadOPPFileBE lopbe = new LoadOPPFileBE();

            public DataTable GetDDExcepRecords(string FundType,string Fromdate, string Todate)

            {

                try

                {

                    var Records = context.usp_GetACHExceptionsByDate(FundType, Fromdate, Todate);

                    return gnl.ObtainDataTableFromIEnumerable(Records); // collection;

                }

                catch (Exception ex)

                {

                    throw new Exception(ex.Message);

                }

            }

            public DataTable GetDDAS400ExcepRecords(string Fundtype, string Fromdate, string Todate)

            {

                try

                {

                    var Records = context.usp_GetDDAS400ExcepionsByDate(Fundtype, Fromdate, Todate);

                    return gnl.ObtainDataTableFromIEnumerable(Records); // collection;

                }

                catch (Exception ex)

                {

                    throw new Exception(ex.Message);

                }

            }

        }

    }

    using System;

    using System.Collections.Generic;

    using System.Globalization;

    using System.Linq;

    using System.Web;

    using System.Web.UI;

    using System.Web.UI.WebControls;

    using System.Data;

    using DDSolutionBO;

    using DDSolutionBE;

    using System.Text;

    using DDSolutionDALC;

    using System.Configuration;

    using System.IO;

    public partial class UI_BankExceptionManagement : System.Web.UI.Page

    {

        PolicyholderBO boPH = new PolicyholderBO();

        General gnl = new General();

        DataTable dtMailingAddress = new DataTable();

        DataTable dtGetdata = new DataTable();

        ViewBankExceptionsBO vbebo = new ViewBankExceptionsBO();

        ViewBankExceptionsBE vbebe = new ViewBankExceptionsBE();

        string FilePath = "";

        string fileDate = "";

        string FilType = "";

        int ParentID;

        string rtnmsg = "";

        int UserID;

        string GeneratedFileId;

        DateTime FilegeneratedDateTime;

        double TotalAmt = 0.00;

        int Recordcount;

        string strFileName = "";

        protected void Page_Load(object sender, EventArgs e)

        {

            // To Clear Cache

            Response.Buffer = true;

            Response.ExpiresAbsolute = DateTime.Now;

            Response.CacheControl = "no-cache";

            // To Clear Cache

            //CE3.SelectedDate = DateTime.Today;

            //CE4.SelectedDate = DateTime.Today;

            try

            {

                if (Request.Cookies["UserInfo"] == null) Response.Redirect("Login.aspx");

                if (!IsPostBack)

                {

                    //txtFromDate.Text = gnl.GetASTDate().ToShortDateString();

                    //txtToDate.Text = gnl.GetASTDate().ToShortDateString();

                    //BindExceptions();

                }

                if(Request.Cookies["UserInfo"].Values["RoleName"].ToString().ToUpper().Trim().Contains("VIEWER"))

                {

                    btnGenerateLetter.Enabled = false;

                }

                UserID = Convert.ToInt32(Request.Cookies["UserInfo"]["UserId"]);

            }

            catch (Exception ex)

            {

                errMsg.Attributes["class"] = "MsgBox error";

                errMsg.InnerHtml = ex.Message;

            }

        }

        protected void btnClose_Click(object sender, EventArgs e)

        {

            Response.Redirect("../UI/MainPage.aspx");

        }

        private void GenerateINDLetter()

        {

            try

            {

                StringBuilder sb = new StringBuilder();

                IEnumerable<ViewBankExceptionsBE> ieGetExcepByParticip;

                ieGetExcepByParticip = vbebo.GetExceptionByParticpants(ddlBankName.SelectedItem.Text, txtFromDate.Text, txtToDate.Text);

                //dtGetdata = vbebo.GetExceptionByParticpants(ddlBankName.SelectedItem.Text, txtFromDate.Text, txtToDate.Text);

                if (ieGetExcepByParticip.Count() > 0)

                //if (dtGetdata.Rows.Count > 0)

                {

                    Append.FileName = ConfigurationManager.AppSettings["GenerateLetter"].ToString();

                    fileDate = gnl.GenerateFileName("");//.GetASTDate().ToString("MMddyyyy_HHmmss");// Convert.ToDateTime(ctx.fn_GetDaylightSavingsASTTime()).ToString("MMddyyyy_HHmmss");

                    FilePath = Append.FileName + "_" + ddlPholder.SelectedValue + fileDate + ".txt";

                    strFileName = FilePath.Substring(FilePath.LastIndexOf('\\'), (FilePath.Length - FilePath.LastIndexOf('\\'))).Replace("\\", "");

                    InsertintoLuminXPaymentPostingHeader();

                    foreach (var item in ieGetExcepByParticip)

                    {

                        //vbebe.ParticipantID = drow[0].ToString();

                        //vbebe.GroupNumber = drow[1].ToString();

                        //vbebe.TransactionDate = Convert.ToDateTime(drow[2].ToString());

                        //vbebe.CustFirstName = drow[3].ToString();

                        //vbebe.CustLastName = drow[4].ToString();

                        //CustomerName = vbebe.CustFirstName + " " + vbebe.CustLastName;

                        //vbebe.AccountNumber = drow[5].ToString();

                        //vbebe.ErrorDescription = drow[6].ToString();

                        //TransactionDate1 = vbebe.TransactionDate;

                        //IEnumerable<LuminXParticipantsBE> ieLxParticips = null;

                        //ieLxParticips = vbebo.GetPolicyholdersFromLuminx(null, null, null, vbebe.ParticipantID, vbebe.GroupNumber);

                        //foreach (var item in ieLxParticips)

                        //{

                        //string str = item.MailingAddress;

                        //string[] words = str.Split('%');

                        //string Address1 = words[0].ToString();

                        //string Addressstr = words[1].ToString();

                        ////string[] Addressstr2 = Addressstr.Split(',');

                        ////string Address2 = Addressstr2[0].ToString();

                        ////string Address3 = Addressstr2[1].ToString();

                        //// string Address4 = Addressstr2[2].ToString();

                        //string mainstr = null;

                        //string[] splitstr = Addressstr.Split(new Char[] { ',' });

                        //foreach (string line in splitstr)

                        //{

                        //    //array for the measurement

                        //    // string[] measurementArray = line.

                        //    mainstr = mainstr + line;

                        //    mainstr = mainstr + " ";

                        //}

                        sb.Append(item.Date.ToString().PadRight(10) + "|");

                        sb.Append(item.CustFirstName.ToString().PadRight(15) + "|");

                        sb.Append(item.CustLastName.ToString().PadRight(15) + "|");

                        sb.Append(item.Adress1.ToString().PadRight(25) + "|");

                        sb.Append(item.Adress2.ToString().PadRight(25) + "|");

                        sb.Append(item.Adress3.ToString().PadRight(25) + "|");

                        sb.Append(item.PostalCode.ToString().PadRight(9) + "|");

                        sb.Append(item.AccountNumber.ToString().PadRight(6) + "|");

                        sb.Append(item.ErrorDescription.ToString().PadRight(20) + "|");

                        sb.Append(item.TransactionDate.ToString("dd-MMM-yyyy"));

                        vbebe.ParticipantID = item.ParticipantID.ToString();

                        vbebe.GroupNumber = item.GroupNumber.ToString();//drow[11].ToString();

                        vbebe.AccountNumber = item.AccountNumber.ToString();//drow[7].ToString();

                        vbebe.FileGenerationDateTime = FilegeneratedDateTime;

                        vbebe.Amount = item.Amount;//Convert.ToDouble(drow[12]);

                        vbebe.UserID = UserID;

                        vbebe.FileId = Convert.ToInt32(GeneratedFileId);

                        vbebo.InsertintoLuminXPaymentPostingDetails(vbebe);

                        TotalAmt += item.Amount;//Convert.ToDouble(drow[12]);

                        Recordcount++;

                        //sb.Append(vbebe.TransactionDate.ToString("MM-dd-yyyy").ToString().PadRight(10) + '|');

                        //sb.Append(CustomerName.ToString().PadRight(50) + '|');

                        //sb.Append(Address1.ToString().PadRight(50) + '|');

                        //sb.Append(mainstr.ToString().PadRight(100) + '|');

                        //// sb.Append(Address2.ToString().PadRight(15));

                        ////sb.Append(Address3.ToString().PadRight(15));

                        //// sb.Append(Address4.ToString().PadRight(15) + '|');

                        //sb.Append(vbebe.AccountNumber.ToString().PadRight(20) + '|');

                        //sb.Append(vbebe.ErrorDescription.ToString().PadRight(250) + '|');

                        //sb.Append(TransactionDate1.ToString("dd-MMM-yyyy").ToString().PadRight(11));//.ToString("dd-MMM-yy");

                        sb.AppendLine();

                        //}

                    }

                    using (StreamWriter wtr = File.CreateText(FilePath))

                    {

                        UpdateDtls();

                        wtr.Write(sb.ToString());

                        //ScriptManager.RegisterStartupScript(this, this.GetType(), "myscript", "alert('File Generated Successfully');", true);

                        errMsg.Attributes["class"] = "MsgBox success";

                        errMsg.InnerHtml = "File generated successfully. Please check LetterFeedFiles folder.";

                    }

                }

                else

                {

                    //ScriptManager.RegisterStartupScript(this, this.GetType(), "myscript", "alert('Please Select Policyholder');", true);

                    errMsg.Attributes["class"] = "MsgBox warning";

                    errMsg.InnerHtml = " No records were found for given transaction date range";

                    //ddlPholder.Focus();

                    return;

                }

            }

            catch (Exception ex)

            {

                DeleteEntry();

                throw new Exception(ex.Message);

            }

        }

        protected void btnGenerateLetter_Click(object sender, EventArgs e)

        {

            errMsg.Attributes["class"] = "";

            errMsg.InnerHtml = "";

            try

            {

                if (ddlPholder.SelectedValue == "Individual")

                    GenerateINDLetter();

                else

                    GenerateGRPLetter();

            }

            catch (Exception ex)

            {

                //throw new Exception(ex.Message);

                errMsg.Attributes["class"] = "MsgBox error";

                errMsg.InnerHtml = ex.Message;

                if (File.Exists(FilePath))

                {

                    File.Delete(FilePath);

                }

            }

        }

        private void GenerateGRPLetter()

        {

            try

            {

                StringBuilder sb = new StringBuilder();

                IEnumerable<ViewBankExceptionsBE> ieGetExcepByGRP;

                ieGetExcepByGRP = vbebo.GetExceptionByGroup(ddlBankName.SelectedItem.ToString(), txtFromDate.Text, txtToDate.Text);

                //dtGetdata = vbebo.GetExceptionByGroup(ddlBankName.SelectedItem.ToString(), txtFromDate.Text, txtToDate.Text);

                if (ieGetExcepByGRP.Count() > 0)

                {

                    Append.FileName = ConfigurationManager.AppSettings["GenerateLetter"].ToString();

                    fileDate = gnl.GenerateFileName(""); //gnl.GetASTDate().ToString("MMddyyyy_HHmmss"); // Convert.ToDateTime(ctx.fn_GetDaylightSavingsASTTime()).ToString("MMddyyyy_HHmmss");

                    FilePath = Append.FileName + "_" + ddlPholder.SelectedValue + fileDate + ".txt";

                    strFileName = FilePath.Substring(FilePath.LastIndexOf('\\'), (FilePath.Length - FilePath.LastIndexOf('\\'))).Replace("\\", "");

                    InsertintoLuminXPaymentPostingHeader();

                    foreach (var item in ieGetExcepByGRP)

                    {

                        sb.Append(item.Date.ToString().PadRight(10) + "|");

                        sb.Append(item.GrpName.ToString().PadRight(30) + "|");

                        sb.Append(item.Adress1.ToString().PadRight(25) + "|");

                        sb.Append(item.Adress2.ToString().PadRight(25) + "|");

                        sb.Append(item.Parish.ToString().PadRight(20) + "|");

                        sb.Append(item.PostalCode.ToString().PadRight(10) + "|");

                        sb.Append(item.GroupNumber.ToString().PadLeft(5, '0') + "|");

                        sb.Append(item.ErrorDescription.ToString().PadRight(20) + "|");

                        sb.Append(item.TransactionDate.ToString("dd-MMM-yyyy"));

                        vbebe.ParticipantID = item.ParticipantID.ToString();

                        vbebe.GroupNumber = item.GroupNumber.ToString();//drow[11].ToString();

                        vbebe.AccountNumber = item.AccountNumber.ToString();//drow[7].ToString();

                        vbebe.FileGenerationDateTime = FilegeneratedDateTime;

                        vbebe.Amount = item.Amount;//Convert.ToDouble(drow[12]);

                        vbebe.UserID = UserID;

                        vbebe.FileId = Convert.ToInt32(GeneratedFileId);

                        vbebo.InsertintoLuminXPaymentPostingDetails(vbebe);

                        TotalAmt += item.Amount;//Convert.ToDouble(drow[12]);

                        Recordcount++;

                        sb.AppendLine();            

                    }               

                    using (StreamWriter wtr = File.CreateText(FilePath))

                    {

                        UpdateDtls();

                        wtr.Write(sb.ToString());                   

                        errMsg.Attributes["class"] = "MsgBox success";

                        errMsg.InnerHtml = "File generated successfully..";

                    }

                }

                else

                {

                    errMsg.Attributes["class"] = "MsgBox warning";

                    errMsg.InnerHtml = " No records were found for given date range";               

                    return;

                }

            }

            catch (Exception ex)

            {

                DeleteEntry();

                throw new Exception(ex.Message);

            }

        }

        protected void InsertintoLuminXPaymentPostingHeader()

        {

            try

            {

                // vbebe.FileName = fileName;      

                IEnumerable<ViewBankExceptionsBE> iegetfiletype;

                iegetfiletype = vbebo.GetExceptionsFileType();

                foreach (var ftype in iegetfiletype)

                {

                    FilType = ftype.MasterData.ToString();

                    ParentID = ftype.ParentFileID;

                }

                // FileFenerateDateTime =Convert.ToDateTime( fileDate);

                //FilePath = ConfigurationManager.AppSettings["GenerateLetter"].ToString();

                vbebe.FileName = strFileName;

                vbebe.FileType = FilType;

                FilegeneratedDateTime = gnl.GetASTDate(); // Convert.ToDateTime(ctx.fn_GetDaylightSavingsASTTime());

                vbebe.FileGenerationDateTime = FilegeneratedDateTime;

                string spath = ConfigurationManager.AppSettings["GenerateLetter"].ToString();

                string[] words = spath.Split('\\');

                string spath1 = words[0].ToString();

                string spath2 = words[1].ToString();

                string spath3 = words[2].ToString();

                //string Address1 = words[0].ToString();

                vbebe.FilePath = spath1 + "\\" + spath3;

                vbebe.ParentFileID = ParentID;

                vbebe.isActive = true;

                vbebe.UserID = UserID;

                vbebe.CreatedDateTime = gnl.GetASTDate();

                GeneratedFileId = vbebo.InsertintoLuminXPaymentPostingHeader(vbebe);

                vbebe.FileId = Convert.ToInt32(GeneratedFileId);

                errMsg.Attributes["class"] = "MsgBox success";

                errMsg.InnerHtml = rtnmsg;

            }

            catch (Exception ex)

            {

                //throw new Exception(ex.Message);

                errMsg.Attributes["class"] = "MsgBox error";

                errMsg.InnerHtml = ex.Message;

                return;

            }

        }

        public void UpdateDtls()

        {

            try

            {

                vbebe.Amount = TotalAmt;

                vbebe.TotalRecords = Recordcount;

                vbebe.FileId = Convert.ToInt32(GeneratedFileId);

                vbebe.FileGenerationEndDateTime = gnl.GetASTDate();

                vbebo.UpdateLuminXPaymentPostingHeader(vbebe);

            }

            catch (Exception ex)

            {

                throw ex;

            }

        }

        public void DeleteEntry()

        {

            try

            {

                vbebo.DeleteEntry(vbebe);

            }

            catch (Exception ex)

            {

                throw ex;

            }

        }

    }

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="BankExceptionManagement.aspx.cs"

        Inherits="UI_BankExceptionManagement" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <%@ Register Src="~/UserControls/HeaderControl.ascx" TagName="Header" TagPrefix="hdr" %>

    <%@ Register Src="~/UserControls/FooterControl.ascx" TagName="Footer" TagPrefix="ftr" %>

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head id="Head1" runat="server">

        <link rel="shortcut icon" href="../Images/favicon.ico" />

        <title>Bank Exception Management</title>

        <link href="~/Styles/Style.css" rel="stylesheet" type="text/css" />

        <script type="text/javascript" src="../Scripts/jquery-1.4.1.min.js"></script>

        <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

        <script language="javascript" type="text/javascript">

            /*  $(document).ready(function () {

            // This code is used to validate the search on search button click.

            //            $('[id$=chkSelectAll]').click(function () {

            //                $("[id$='chkSelect']").attr('checked', this.checked);

            //            });

            $("[id*=chkSelectAll]").live("click", function () {

            var chkHeader = $(this);

            var grid = $(this).closest("table");

            $("input[type=checkbox]", grid).each(function () {

            if (chkHeader.is(":checked")) {

            $(this).attr("checked", "checked");

            $("td", $(this).closest("tr")).addClass("selected");

            } else {

            $(this).removeAttr("checked");

            $("td", $(this).closest("tr")).removeClass("selected");

            }

            });

            });

            $("[id*=chkSelect]").live("click", function () {

            var grid = $(this).closest("table");

            var chkHeader = $("[id*=chkSelectAll]", grid);

            if (!$(this).is(":checked")) {

            $("td", $(this).closest("tr")).removeClass("selected");

            chkHeader.removeAttr("checked");

            } else {

            $("td", $(this).closest("tr")).addClass("selected");

            if ($("[id*=chkSelect]", grid).length == $("[id*=chkSelect]:checked", grid).length) {

            chkHeader.attr("checked", "checked");

            }

            }

            });

            });*/

            function Close() {

                var confrm = window.confirm("Are you sure, you want to close this window?");

                if (confrm == true) {

                    return true;

                }

                else {

                    return false;

                }

            }

        </script>

        <style type="text/css">

            .selected

            {

                background-color: #A1DCF2;

            }

        </style>

        <script type="text/javascript">

            $(document).ready(function () {

                $('#btnGenerateLetter').click(function () {

                    document.getElementById("errMsg").style.visibility = "hidden";

                    if ($("#ddlBankName").val() == '-Select-') {

                        document.getElementById("errMsg").style.visibility = "visible";

                        document.getElementById("errMsg").className = "MsgBox warning";

                        $('#errMsg').html("Select the BankName");

                        $('#ddlBankName').focus();

                        return false;

                    }

                    if ($("#ddlPholder").val() == '-Select-') {

                        document.getElementById("errMsg").style.visibility = "visible";

                        document.getElementById("errMsg").className = "MsgBox warning";

                        $('#errMsg').html( Select the policyholder");

                        $('#ddlPholder').focus();

                        return false;

                    }

                    var FromDate = $.trim($(".txtFromDate").val());

                    if (FromDate.length == 0) {

                        document.getElementById("errMsg").style.visibility = "visible";

                        document.getElementById("errMsg").className = "MsgBox warning";

                        $('#errMsg').html( Enter Transaction From Date");

                        // $('#txtFromDate').focus();

                        return false;

                    }

                    // txtFromDate = document.getElementById('txtTranDate').value;

                    var txtFromDate = $.trim($(".txtFromDate").val());

                    var Datepattern = "^(0?[1-9]|1[012])[-/]?(0?[1-9]|[12][0-9]|3[01])[-/]?(19[\\d]{2}|20[\\d]{2}|2100)$";

                    if (!txtFromDate.match(Datepattern)) {

                        document.getElementById("errMsg").style.visibility = "visible";

                        document.getElementById("errMsg").className = "MsgBox warning";

                        $('#errMsg').html( Enter Transaction from date in 'MM/dd/yy' format");

                        // $('#txtFromDate').focus();

                        return false;

                    }

                    var ToDate = $.trim($(".txtToDate").val());

                    if (ToDate.length == 0) {

                        document.getElementById("errMsg").style.visibility = "visible";

                        document.getElementById("errMsg").className = "MsgBox warning";

                        $('#errMsg').html( Enter Transaction To Date");

                        //$('#txtToDate').focus();

                        return false;

                    }

                    var txtToDate = $.trim($(".txtToDate").val());

                    if (!txtToDate.match(Datepattern)) {

                        document.getElementById("errMsg").style.visibility = "visible";

                        document.getElementById("errMsg").className = "MsgBox warning";

                        $('#errMsg').html( Enter Transaction To Date 'MM/dd/yy' Format");

                        // $('#txtFromDate').focus();

                        return false;

                    }

                    // var startDate = $('#txtFromDate').val().replace('/', '-');

                    var startDate = $('#txtFromDate').val();

                    var endDate = $('#txtToDate').val();

                    date1 = new Date(startDate.split("/")[2], startDate.split("/")[0], startDate.split("/")[1]);

                    date2 = new Date(endDate.split("/")[2], endDate.split("/")[0], endDate.split("/")[1]);

                    if (date1 > date2) {

                        document.getElementById("errMsg").style.visibility = "visible";

                        document.getElementById("errMsg").className = "MsgBox warning";

                        $('#errMsg').html( To Date Should be greater than From Date");

                        // $('#txtFromDate').focus();

                        return false;

                    }

                    ShowProgress();

                    return true;

                });

                $('.ddlBankName').focusout(function () {

                    //debugger;

                    document.getElementById("errMsg").style.visibility = "hidden";

                    // var value = $('.txtHidBankAccNo').val().length;

                    //var BankName = $("#ddlBankName").get(0).selectedIndex;}

                });

                $('.ddlPholder').focusout(function () {

                    //debugger;

                    document.getElementById("errMsg").style.visibility = "hidden";

                    // var value = $('.txtHidBankAccNo').val().length;

                    //var BankName = $("#ddlBankName").get(0).selectedIndex;}

                });

                $('.txtFromDate').focusout(function () {

                    //debugger;

                    document.getElementById("errMsg").style.visibility = "hidden";

                    var value = $('.txtFromDate').val().length;

                });

                $('.txtToDate').focusout(function () {

                    document.getElementById("errMsg").style.visibility = "hidden";

                    var value = $('.txtToDate').val().length;

                });

            });

        </script>

        <script type="text/javascript">

            function ClearFields() {

                //            document.getElementById("ddlBankName").options[0].selected = true;

                //            document.getElementById("txtFromDate").value = "";

                //            document.getElementById("txtToDate").value = "";

                //            document.getElementById("errMsg").style.visibility = "hidden";

                window.location.href = "BankExceptionManagement.aspx";

                return true;

            }

        </script>

        <script type="text/javascript">

            //This javascript function is used to display Loader when page is submitting to server

            function ShowProgress() {

                setTimeout(function () {

                    var modal = $('<div />');

                    modal.addClass("modal");

                    $('body').append(modal);

                    var loading = $(".loading");

                    loading.show();

                    var top = Math.max($(window).height() / 2 - loading[0].offsetHeight / 2, 0);

                    var left = Math.max($(window).width() / 2 - loading[0].offsetWidth / 2, 0);

                    loading.css({ top: top, left: left });

                }, 200);

            }      

        </script>

    </head>

    <body>

        <form id="form1" runat="server" defaultbutton="btnGenerateLetter">

        <div>

            <hdr:Header ID="headerMain" runat="server" />

            <center>

                <div id="content">

                    <div class="content_section">

                        <table width="70%" border="0" style="border-color: Blue">

                            <tr>

                                <td align="center">

                                    <asp:Label ID="lblUserMgmnt" runat="server" Text="Bank Exception Management"Font-Bold="True"

                                        Font-Size="Medium"></asp:Label>

                                </td>

                            </tr>

                            <tr>

                                <td align="center">

                                    <%--<asp:Label ID="lblException" runat="server" ForeColor="Red"></asp:Label>--%>

                                    <div id="errMsg" runat="server" style="width: 45%; height: auto">

                                    </div>

                                </td>

                            </tr>

                            <tr>

                                <td align="center">

                                    <table border="1" style="border-color: Blue" width="50%">

                                        <tr>

                                            <td>

                                                <table>

                                                    <tr>

                                                        <td align="right">

                                                            <asp:Label ID="lblBankName" runat="server"Text="BankName"></asp:Label><span style="color: Red">*</span>

                                                        </td>

                                                        <td align="left">

                                                            <asp:DropDownList ID="ddlBankName" runat="server"Width="76%" CssClass="StyleDrpDown">

                                                                <asp:ListItem Text="BNTB" Value="BNTB"Selected="True"></asp:ListItem>

                                                                <%--<asp:ListItem Text="HSBC" Value="HSBC"></asp:ListItem>--%>

                                                                <%--<asp:ListItem Text="BNTB" Value="BNTB"></asp:ListItem>--%>

                                                                <%-- <asp:ListItem Text="Capital-G" Value="Capital-G"></asp:ListItem>--%>

                                                            </asp:DropDownList>

                                                        </td>

                                                    </tr>

                                                    <tr>

                                                        <td align="right">

                                                            <asp:Label ID="lblPholder" runat="server"Text="Policyholder"></asp:Label><span

                                                                style="color: Red">*</span>

                                                        </td>

                                                        <td align="left">

                                                            <asp:DropDownList ID="ddlPholder" runat="server"Width="76%" CssClass="StyleDrpDown">

                                                                <asp:ListItem Text="-Select-" Value="-Select-"Selected="True"></asp:ListItem>

                                                                <asp:ListItem Text="Group" Value="Group"></asp:ListItem>

                                                                <asp:ListItem Text="Individual"Value="Individual"></asp:ListItem>

                                                            </asp:DropDownList>

                                                        </td>

                                                    </tr>

                                                    <tr>

                                                        <td align="right">

                                                            <asp:Label ID="lblFromDate" runat="server"Text="Transaction from date"></asp:Label><span style="color: Red">*</span>

                                                        </td>

                                                        <td align="left">

                                                            <asp:TextBox ID="txtFromDate" CssClass="txtFromDate"runat="server" Width="75%" ReadOnly="false"></asp:TextBox>

                                                            <asp:CalendarExtender ID="CE3" runat="server"TargetControlID="txtFromDate" TodaysDateFormat="MMM dd, yyyy"

                                                                Enabled="True">

                                                            </asp:CalendarExtender>

                                                        </td>

                                                    </tr>

                                                    <tr>

                                                        <td align="right">

                                                            <asp:Label ID="lblToDate" runat="server"Text="Transaction to date"></asp:Label><span style="color: Red">*</span>

                                                        </td>

                                                        <td align="left">

                                                            <asp:TextBox ID="txtToDate" CssClass="txtToDate"runat="server" Width="75%" ReadOnly="false"></asp:TextBox>

                                                            <asp:CalendarExtender ID="CE4" runat="server"TargetControlID="txtToDate" TodaysDateFormat="MMM dd, yyyy"

                                                                Enabled="True">

                                                            </asp:CalendarExtender>

                                                        </td>

                                                    </tr>

                                                    <tr>

                                                        <td align="right">

                                                            <asp:Button ID="btnGenerateLetter"CssClass="btnGenerate" Text="Generate File" runat="server"

                                                                Width="105px" OnClick="btnGenerateLetter_Click"/>

                                                        </td>

                                                        <td align="left">

                                                            <input id="Reset1" type="reset" value="Reset"class="button" onclick="ClearFields()" />

                                                            <asp:Button ID="btnClose" Text="Close"CssClass="button" runat="server" Width="50px"

                                                                OnClick="btnClose_Click" />

                                                        </td>

                                                    </tr>

                                                </table>

                                            </td>

                                        </tr>

                                    </table>

                                    <div class="loading" align="center">

                                        Generating...<br />

                                        <br />

                                        <br />

                                        <br />

                                        <img src="../Images/loader.gif" alt="" />

                                    </div>

                                </td>

                            </tr>

                        </table>

                    </div>

                </div>

            </center>

            <ftr:Footer ID="footermain" runat="server" />

        </div>

        </form>

    </body>

    </html>

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!