예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserId"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            else
            {
                Int32  UserId   = Convert.ToInt32(Session["UserId"].ToString());
                User   user     = IUserService.GetSingle(UserId);
                string userType = Session["UserType"].ToString();
                string userRole = Session["UserRole"].ToString();


                if (Request.QueryString["hdnNumberPerPage"] != "" && Request.QueryString["hdnNumberPerPage"] != null)
                {
                    hdnNumberPerPage.Value = Request.QueryString["hdnNumberPerPage"].ToString();
                }
                if (Request.QueryString["hdnCurrentPageNo"] != "" && Request.QueryString["hdnCurrentPageNo"] != null)
                {
                    hdnCurrentPageNo.Value = Request.QueryString["hdnCurrentPageNo"].ToString();
                }
                if (Request.QueryString["hdnTotalRecordsCount"] != "" && Request.QueryString["hdnTotalRecordsCount"] != null)
                {
                    hdnTotalRecordsCount.Value = Request.QueryString["hdnTotalRecordsCount"].ToString();
                }

                StringBuilder filter = new StringBuilder();
                filter.Append(" join batches b on b.id = s.batch_id ");
                // filter.Append(" and s.status = '1' ");
                filter.Append(" and s.status in (1,9) ");

                List <Branch> branchList = IBranchService.GetDataByFilter(" status='1'", 0, 0, false);

                if (userRole == "Regional Admin")
                {
                    List <Branch> Branches = new List <Branch>();
                    if (user.IsAll == 0)
                    {
                        List <BranchUser> userBranches = IBranchUserService.GetDataByFilter(" user_id = '" + user.Id + "' and status='1'", 0, 0, false);
                        branchList = IBranchService.GetDataByFilter(" ID not in (" + String.Join(",", userBranches.Select(x => x.BranchId).ToArray()) + ")", 0, 0, false);
                    }
                }
                if (userRole == "Branch Admin")
                {
                    if (user.BranchId != 0)
                    {
                        Branch        branch   = IBranchService.GetSingle(user.BranchId);
                        List <Branch> branches = new List <Branch>();
                        branches.Add(branch);
                        branchList = branches;
                    }
                }

                if (userRole == "Regional Admin")
                {
                    filter.Append(" and b.branch_id in (" + String.Join(",", branchList.Select(x => x.Id).ToArray()) + ") ");
                }
                else if (userRole == "Branch Admin")
                {
                    filter.Append(" and b.branch_id in (" + user.BranchId + ") ");
                }

                if (Request.QueryString["IsNewSearch"] != "" && Request.QueryString["IsNewSearch"] != null)
                {
                    IsNewSearch.Value = Request.QueryString["IsNewSearch"].ToString();
                }
                if (IsNewSearch.Value == "1")
                {
                    hdnCurrentPageNo.Value = "";
                }
                if (Request.QueryString["Search"] != "" && Request.QueryString["Search"] != null)
                {
                    Search.Value = Request.QueryString["Search"].ToString();
                    bool isNumber = long.TryParse(Search.Value, out long number);
                    if (isNumber)
                    {
                        Search.Value = number.ToString();
                    }
                    string columnNameAaNo = Converter.GetColumnNameByPropertyName <Set>(nameof(Set.AaNo));
                    filter.Append(" and (s." + columnNameAaNo + " like '%" + Search.Value + "%'");
                    string columnNameAcNo = Converter.GetColumnNameByPropertyName <Set>(nameof(Set.AccountNo));
                    filter.Append(" or s." + columnNameAcNo + " like '%" + Search.Value + "%'");
                    string columnNameBatchNo = Converter.GetColumnNameByPropertyName <Batch>(nameof(Batch.BatchNo));
                    filter.Append(" or b." + columnNameBatchNo + " like '%" + Search.Value + "%')");
                }
                string fromdate = ""; string toDate = "";
                if (!string.IsNullOrEmpty(Request.QueryString["FromDate"]))
                {
                    FromDate.Value = fromdate = Request.QueryString["FromDate"];
                }

                if (!string.IsNullOrEmpty(Request.QueryString["ToDate"]))
                {
                    ToDate.Value = toDate = Request.QueryString["ToDate"];
                }

                if (!string.IsNullOrEmpty(fromdate) && !string.IsNullOrEmpty(toDate))
                {
                    filter.Append("  and s.created_date between '" + fromdate + "' and  '" + toDate + "'");
                }

                int skip = 0, take = 10;
                if (hdnCurrentPageNo.Value == "")
                {
                    skip = 0;
                    take = 10;
                    hdnNumberPerPage.Value     = "10";
                    hdnCurrentPageNo.Value     = "1";
                    hdnTotalRecordsCount.Value = ISetService.GetCountByFilterNew(filter.ToString()).ToString();
                }
                else
                {
                    skip = (Convert.ToInt32(hdnCurrentPageNo.Value) - 1) * 10;
                    take = 10;
                }

                List <Set> objs = ISetService.GetDataByFilterNew(filter.ToString(), skip, take, true);

                StringBuilder asb   = new StringBuilder();
                int           index = 1;
                foreach (Set set in objs)
                {
                    Batch b = IBatchService.GetSingle(set.BatchId);

                    int setsCount      = ISetService.GetCountByFilter(" batch_id='" + b.Id + "'");
                    int scanPagesCount = 0;

                    filter = new StringBuilder();
                    filter.Append(" 1=1");
                    string BatchIdColumnName = Converter.GetColumnNameByPropertyName <BatchLog>(nameof(BatchLog.BatchId));
                    filter.Append(" and " + BatchIdColumnName + " = '" + b.Id + "'");

                    List <BatchLog> batchLogs    = IBatchLogService.GetDataByFilter(filter.ToString(), 0, 0, false);
                    StringBuilder   batchLogHTML = new StringBuilder();
                    foreach (BatchLog batchLog in batchLogs)
                    {
                        batchLogHTML.Append(@"
                                                    <div class='mini-stat clearfix text-left'>
                                                        " + (batchLog.StageId == 1 ?
                                                             @"<span class='mini-stat-icon orange'><i class='fa fa-print'></i></span>" :
                                                             (batchLog.StageId == 2 ?
                                                              "<span class='mini-stat-icon tar'><i class='fa fa-check-square-o'></i></span>" :
                                                              (batchLog.StageId == 3 ?
                                                               "<span class='mini-stat-icon pink'><i class='fa fa-external-link'></i></span>" :
                                                               (batchLog.StageId == 4 ?
                                                                "<span class='mini-stat-icon green'><i class='fa fa-puzzle-piece'></i></span>" :
                                                                (batchLog.StageId == 5 ?
                                                                 "<span class='mini-stat-icon yellow-b'><i class='fa fa-files-o'></i></span>" :
                                                                 (batchLog.StageId == 6 ?
                                                                  "<span class='mini-stat-icon yellow-b'><i class='fa fa-hdd-o'></i></span>" : "")))))) + @"
                                                        <div class='mini-stat-info'>
                                                            " + (batchLog.StageId == 1 ?
                                                                 "<span>Scan</span>" :
                                                                 (batchLog.StageId == 2 ?
                                                                  "<span>Index</span>" :
                                                                  (batchLog.StageId == 3 ?
                                                                   "<span><span>Export</span> <small>To Server</small></span>" :
                                                                   (batchLog.StageId == 4 ?
                                                                    "<span><span>Integrate</span> <small>Sync Control</small></span>" :
                                                                    (batchLog.StageId == 5 ?
                                                                     "<span><span>Release</span> <small>To Mimzy</small></span>" :
                                                                     (batchLog.StageId == 6 ?
                                                                      "<span><span>Document</span> <small>By Mimzy</small></span>" : "")))))) + @"
                                                            " + batchLog.UpdatedDate.ToString("dd/MM/yyyy HH:mm:ss") + @" - <strong>" + batchLog.BatchUser + @"</strong>
                                                        </div>
                                                    </div>
                                ");
                    }
                    BatchLog firstBatchLog = batchLogs.FirstOrDefault();
                    BatchLog lastBatchLog  = batchLogs.LastOrDefault();
                    TimeSpan timeSpan      = lastBatchLog.UpdatedDate.Subtract(firstBatchLog.UpdatedDate);

                    Branch     branch     = IBranchService.GetSingle(b.BranchId);
                    Department department = IDepartmentService.GetSingle(b.DepartmentId);
                    Stage      stage      = IStageService.GetSingle(b.StageId);
                    filter = new StringBuilder();
                    filter.Append(" 1=1");
                    filter.Append(" and " + Converter.GetColumnNameByPropertyName <SetDocument>(nameof(SetDocument.SetId)) + "='" + set.Id + "'");
                    filter.Append(" and " + Converter.GetColumnNameByPropertyName <SetDocument>(nameof(SetDocument.Status)) + "='1'");
                    List <SetDocument> setDocuments     = ISetDocumentService.GetDataByFilter(filter.ToString(), 0, 0, false);
                    StringBuilder      setDocumentsHTML = new StringBuilder();
                    foreach (SetDocument setDocument in setDocuments)
                    {
                        scanPagesCount += setDocument.PageCount;
                        //    string fileName = Path.GetFileName(setDocument.DocumentUrl);
                        //    string localUrl = Server.MapPath("/Content/Files/" + fileName);

                        //    if (!File.Exists(localUrl))
                        //        File.Copy(setDocument.DocumentUrl, localUrl);
                        //    setDocumentsHTML.Append(@"<div style='min-width: 150px;'><a href='/Content/Files/" + fileName + "' target='_blank' data-original-title='Click to view' data-trigger='hover' data-placement='bottom' class='popovers text-info'><strong>" + setDocument.DocType + @"</strong></a> ( <small> pages: <strong>" + setDocument.PageCount + @"</strong></small> )</div>");
                        setDocumentsHTML.Append(@"<div style='min-width: 150px;'><a href='#' data-original-title='Click to view' data-trigger='hover' data-placement='bottom' class='popovers text-info'><strong>" + setDocument.DocType + @"</strong></a> ( <small> pages: <strong>" + setDocument.PageCount + @"</strong></small> )</div>");
                    }
                    string xmlFileName = Path.GetFileName(set.SetXmlPath);
                    string localXMLUrl = Server.MapPath("/Content/Files/" + xmlFileName);
                    if (!string.IsNullOrEmpty(set.SetXmlPath))
                    {
                        //if (File.Exists(set.SetXmlPath) && !File.Exists(localXMLUrl))
                        //    File.Copy(set.SetXmlPath, localXMLUrl);
                        string departmentCode = department.Code;
                        string deptCode       = departmentCode.Split('-')[0];
                        string jobCode        = departmentCode.Split('-')[1];
                        string columnData     = "";
                        if (departmentCode == "E-LIBRARY")
                        {
                            //AA NUMBER
                            //ACCOUNT NUMBER
                            columnData  = "AA No: " + set.AaNo;
                            columnData += "<br/>Account No: " + set.AccountNo;
                        }
                        else if (deptCode == "ETP")
                        {
                            if (jobCode == "LN")
                            {
                                columnData  = "AA No: " + set.AaNo;
                                columnData += "<br/>Account No: " + set.AccountNo;
                            }
                            else if (jobCode == "LL")
                            {
                                columnData = "AA No: " + set.AaNo;
                            }
                            else if (jobCode == "PR")
                            {
                                columnData = "Project Code: " + set.AaNo;
                            }
                            else if (jobCode == "WF")
                            {
                                columnData = "Welfare Code: " + set.AaNo;
                            }
                        }
                        else if (deptCode == "LOS")
                        {
                            columnData = "AA No: " + set.AaNo;
                        }

                        asb.Append(@"<tr>
                                    <td class='" + (set.IsReleased == 0 ? "" : "text-success") + @"'>
                                        " + index + @"
                                    </td>
                                    <td>" + branch.Code + @"</td>
                                    <td>" + department.Code + @"</td>
                                    <td class='text-center mb-5'>
                                        " + b.BatchNo + @"
                                        <a href='javascript:;' class='text-info view_batch_log'><sup>View Log</sup></a>
                                        <div class='div_batch_log hide draggableDiv'>
                                            <span class='log_close'>X</span>
                                            <table>
                                                <tr><td><strong>Set Log</strong></td><td>Batch No: <strong>" + b.BatchNo + @"</strong></td></tr>
                                                <tr><td colspan='2'><small>Duration: <label class='label label-primary'>" + timeSpan.Days + @" days, " + timeSpan.Hours + @" hours, " + timeSpan.Minutes + @" minutes, " + timeSpan.Seconds + @" seconds</label></small></tr>
                                            </table>
                                            " + batchLogHTML.ToString() + @"
                                            <div>
                                                M-Files Status: <span clas='fs-14'>" + (set.IsReleased == 1 ? "<i class='fa fa-file text-muted'></i>" : (set.IsReleased == 2 && set.Status == 1 ? "<i class='fa fa-file text-success'></i>" : "<i class='fa fa-file text-danger'></i>")) + @"</span>
                                            </div>
                                        </div>
                                    </td>
                                    <td>
                                        <div><strong>" + columnData + @"</strong><div>
                                        <a data-original-title='Click to view' data-trigger='hover' data-placement='bottom' class='popovers text-info' href='SetView.aspx?setId=" + set.Id + @"' target='_blank'><i class='fa fa-eye'></i></a>
                                    </td>
                                    <td>" + setDocumentsHTML.ToString() + @"</td>
                                    <td>" + stage.Name + @"</td>
                                    <td>" + (b.StageId == 6 && set.IsReleased == 1 ? "<i class='fa fa-file text-muted'></i>" : (b.StageId == 6 && set.IsReleased == 2 && set.Status == 1 ? "<i class='fa fa-file text-success'></i> Success " : (b.StageId == 6 && set.IsReleased == 2 && set.Status == 9 ? " < i class='fa fa-file text-danger'></i>" + set.Remarks : ""))) + @"</td>
                                    <td>" + (set.UpdatedDate == null ? set.CreatedDate.ToString("dd/MM/yyyy HH:mm:ss") : set.UpdatedDate.Value.ToString("dd/MM/yyyy HH:mm:ss")) + @"</td>
                                </tr>");
                    }
                    index++;
                }
                setsTbody.InnerHtml = asb.ToString();
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserId"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            else
            {
                Int32  UserId   = Convert.ToInt32(Session["UserId"].ToString());
                User   user     = IUserService.GetSingle(UserId);
                string userType = Session["UserType"].ToString();
                string userRole = Session["UserRole"].ToString();
                string setId    = "";

                if (!string.IsNullOrEmpty(Request.QueryString["hdnNumberPerPage"]))
                {
                    hdnNumberPerPage.Value = Request.QueryString["hdnNumberPerPage"].ToString();
                }
                if (Request.QueryString["hdnCurrentPageNo"] != "" && Request.QueryString["hdnCurrentPageNo"] != null)
                {
                    hdnCurrentPageNo.Value = Request.QueryString["hdnCurrentPageNo"].ToString();
                }
                if (Request.QueryString["hdnTotalRecordsCount"] != "" && Request.QueryString["hdnTotalRecordsCount"] != null)
                {
                    hdnTotalRecordsCount.Value = Request.QueryString["hdnTotalRecordsCount"].ToString();
                }

                StringBuilder filter = new StringBuilder();
                filter.Append(" join batches b on b.id = s.batch_id ");
                // filter.Append(" and s.status in (1,9) ");
                if (!string.IsNullOrEmpty(Request.QueryString["setId"]))
                {
                    filter.Append(" and s.ID=" + Request.QueryString["setId"] + " ");
                }

                List <Branch> branchList = IBranchService.GetDataByFilter(" status='1'", 0, 0, false);

                if (userRole == "Regional Admin")
                {
                    List <Branch> Branches = new List <Branch>();
                    if (user.IsAll == 0)
                    {
                        List <BranchUser> userBranches = IBranchUserService.GetDataByFilter(" user_id = '" + user.Id + "' and status='1'", 0, 0, false);
                        branchList = IBranchService.GetDataByFilter(" ID not in (" + String.Join(",", userBranches.Select(x => x.BranchId).ToArray()) + ")", 0, 0, false);
                    }
                }
                if (userRole == "Branch Admin")
                {
                    if (user.BranchId != 0)
                    {
                        Branch        branch   = IBranchService.GetSingle(user.BranchId);
                        List <Branch> branches = new List <Branch>();
                        branches.Add(branch);
                        branchList = branches;
                    }
                }

                if (userRole == "Regional Admin")
                {
                    filter.Append(" and b.branch_id in (" + String.Join(",", branchList.Select(x => x.Id).ToArray()) + ") ");
                }
                else if (userRole == "Branch Admin")
                {
                    filter.Append(" and b.branch_id in (" + user.BranchId + ") ");
                }

                if (Request.QueryString["IsNewSearch"] != "" && Request.QueryString["IsNewSearch"] != null)
                {
                    IsNewSearch.Value = Request.QueryString["IsNewSearch"].ToString();
                }
                if (IsNewSearch.Value == "1")
                {
                    hdnCurrentPageNo.Value = "";
                }
                if (Request.QueryString["Search"] != "" && Request.QueryString["Search"] != null)
                {
                    //Search.Value = Request.QueryString["Search"].ToString();
                    //bool isNumber = long.TryParse(Search.Value, out long number);
                    //if (isNumber)
                    //    Search.Value = number.ToString();
                    //string columnNameAaNo = Converter.GetColumnNameByPropertyName<Set>(nameof(Set.AaNo));
                    //filter.Append(" and (s." + columnNameAaNo + " like '%" + Search.Value + "%'");
                    //string columnNameAcNo = Converter.GetColumnNameByPropertyName<Set>(nameof(Set.AccountNo));
                    //filter.Append(" or s." + columnNameAcNo + " like '%" + Search.Value + "%'");
                    //string columnNameBatchNo = Converter.GetColumnNameByPropertyName<Batch>(nameof(Batch.BatchNo));
                    //filter.Append(" or b." + columnNameBatchNo + " like '%" + Search.Value + "%')");
                }


                int skip = 0, take = 10;
                if (hdnCurrentPageNo.Value == "")
                {
                    skip = 0;
                    take = 10;
                    hdnNumberPerPage.Value     = "10";
                    hdnCurrentPageNo.Value     = "1";
                    hdnTotalRecordsCount.Value = ISetService.GetCountByFilterNew(filter.ToString()).ToString();
                }
                else
                {
                    skip = (Convert.ToInt32(hdnCurrentPageNo.Value) - 1) * 10;
                    take = 10;
                }

                List <Set> objs = ISetService.GetDataByFilterNew(filter.ToString(), skip, take, true);

                StringBuilder asb   = new StringBuilder();
                int           index = 1;
                foreach (Set set in objs)
                {
                    Batch b = IBatchService.GetSingle(set.BatchId);

                    int setsCount      = ISetService.GetCountByFilter(" batch_id='" + b.Id + "'");
                    int scanPagesCount = 0;

                    filter = new StringBuilder();
                    filter.Append(" 1=1");
                    string BatchIdColumnName = Converter.GetColumnNameByPropertyName <BatchLog>(nameof(BatchLog.BatchId));
                    filter.Append(" and " + BatchIdColumnName + " = '" + b.Id + "'");

                    List <BatchLog> batchLogs    = IBatchLogService.GetDataByFilter(filter.ToString(), 0, 0, false);
                    StringBuilder   batchLogHTML = new StringBuilder();
                    foreach (BatchLog batchLog in batchLogs)
                    {
                        batchLogHTML.Append(@"
                                                    <div class='mini-stat clearfix text-left'>
                                                        " + (batchLog.StageId == 1 ?
                                                             @"<span class='mini-stat-icon orange'><i class='fa fa-print'></i></span>" :
                                                             (batchLog.StageId == 2 ?
                                                              "<span class='mini-stat-icon tar'><i class='fa fa-check-square-o'></i></span>" :
                                                              (batchLog.StageId == 3 ?
                                                               "<span class='mini-stat-icon pink'><i class='fa fa-external-link'></i></span>" :
                                                               (batchLog.StageId == 4 ?
                                                                "<span class='mini-stat-icon green'><i class='fa fa-puzzle-piece'></i></span>" :
                                                                (batchLog.StageId == 5 ?
                                                                 "<span class='mini-stat-icon yellow-b'><i class='fa fa-files-o'></i></span>" :
                                                                 (batchLog.StageId == 6 ?
                                                                  "<span class='mini-stat-icon yellow-b'><i class='fa fa-hdd-o'></i></span>" : "")))))) + @"
                                                        <div class='mini-stat-info'>
                                                            " + (batchLog.StageId == 1 ?
                                                                 "<span>Scan</span>" :
                                                                 (batchLog.StageId == 2 ?
                                                                  "<span>Index</span>" :
                                                                  (batchLog.StageId == 3 ?
                                                                   "<span><span>Export</span> <small>To Server</small></span>" :
                                                                   (batchLog.StageId == 4 ?
                                                                    "<span><span>Integrate</span> <small>Sync Control</small></span>" :
                                                                    (batchLog.StageId == 5 ?
                                                                     "<span><span>Release</span> <small>To Mimzy</small></span>" :
                                                                     (batchLog.StageId == 6 ?
                                                                      "<span><span>Document</span> <small>By Mimzy</small></span>" : "")))))) + @"
                                                            " + batchLog.UpdatedDate.ToString("dd/MM/yyyy HH:mm:ss") + @" - <strong>" + batchLog.BatchUser + @"</strong>
                                                        </div>
                                                    </div>
                                ");
                    }
                    BatchLog firstBatchLog = batchLogs.FirstOrDefault();
                    BatchLog lastBatchLog  = batchLogs.LastOrDefault();
                    TimeSpan timeSpan      = lastBatchLog.UpdatedDate.Subtract(firstBatchLog.UpdatedDate);

                    Branch     branch     = IBranchService.GetSingle(b.BranchId);
                    Department department = IDepartmentService.GetSingle(b.DepartmentId);
                    Stage      stage      = IStageService.GetSingle(b.StageId);
                    filter = new StringBuilder();
                    filter.Append(" 1=1");
                    filter.Append(" and " + Converter.GetColumnNameByPropertyName <SetDocument>(nameof(SetDocument.SetId)) + "='" + set.Id + "'");
                    filter.Append(" and " + Converter.GetColumnNameByPropertyName <SetDocument>(nameof(SetDocument.Status)) + "='1'");
                    List <SetDocument> setDocuments     = ISetDocumentService.GetDataByFilter(filter.ToString(), 0, 0, false);
                    StringBuilder      setDocumentsHTML = new StringBuilder();
                    StringBuilder      setDocumentsPdf  = new StringBuilder();



                    string departmentCode = department.Code;
                    string deptCode       = departmentCode.Split('-')[0];
                    string jobCode        = departmentCode.Split('-')[1];
                    string columnData     = "";
                    string accountNumber  = "";
                    if (departmentCode == "E-LIBRARY")
                    {
                        //AA NUMBER
                        //ACCOUNT NUMBER
                        columnData     = "AA No: " + set.AaNo;
                        columnData    += "<br/>Account No: " + set.AccountNo;
                        accountNumber += " <tr><td> AA Number </td><td> " + set.AaNo + " </td></tr>";
                        accountNumber += " <tr><td> Acount Number </td><td> " + set.AccountNo + " </td></tr>";
                    }
                    else if (deptCode == "ETP")
                    {
                        if (jobCode == "LN")
                        {
                            columnData     = "AA No: " + set.AaNo;
                            columnData    += "<br/>Account No: " + set.AccountNo;
                            accountNumber += " <tr><td> AA Number </td><td> " + set.AaNo + " </td></tr>";
                            accountNumber += " <tr><td> Acount Number </td><td> " + set.AccountNo + " </td></tr>";
                        }
                        else if (jobCode == "LL")
                        {
                            columnData     = "AA No: " + set.AaNo;
                            accountNumber += " <tr><td> AA Number </td><td> " + set.AaNo + " </td></tr>";
                        }
                        else if (jobCode == "PR")
                        {
                            columnData     = "Project Code: " + set.AaNo;
                            accountNumber += " <tr><td> Project Code </td><td> " + set.AaNo + " </td></tr>";
                        }
                        else if (jobCode == "WF")
                        {
                            columnData     = "Welfare Code: " + set.AaNo;
                            accountNumber += " <tr><td> Welfare Code </td><td> " + set.AaNo + " </td></tr>";
                        }
                    }
                    else if (deptCode == "LOS")
                    {
                        columnData     = "AA No: " + set.AaNo;
                        accountNumber += " <tr><td> AA Number </td><td> " + set.AaNo + " </td></tr>";
                    }


                    setDocumentsPdf.Append(@"<button class='rotate90' id='metaTag'>Meta Tag</button>
            <button class='rotate90' id='preView'>Preview</button>
            <h5><i class='fa fa-file-pdf-o'></i> <strong>" + department.Code + @" - " + set.AaNo + @"</strong></h5>
            <table id='tblView' class='table table-condensed table-striped'>" + accountNumber + @"
                           <tr><td> Branch </td><td>" + branch.Code + @"</td></tr>
                           <tr><td> Department </td><td>" + department.Code + @"</ td ></ tr >    
                                <tr><td> Date </td><td> " + set.CreatedDate + @" </td></tr>
                                <tr><td> M - File Status </td><td> " + (set.IsReleased == 1 ? "<i class='fa fa-file text-muted'></i>Pending " : (set.IsReleased == 2 && set.Status == 1 ? "<i class='fa fa-file text-success'></i>Mfile update has been Success" : "<i class='fa fa-file text-danger'></i>Mfile update has been Failed")) + @" </td></tr>
                                       <tr><td> Remarks </td><td>" + set.Remarks + @"</td></tr>
                                   </table> ");
                    foreach (SetDocument setDocument in setDocuments)
                    {
                        scanPagesCount += setDocument.PageCount;
                        string fileName = Path.GetFileName(setDocument.DocumentUrl);
                        string localUrl = Server.MapPath("/Content/Files/" + fileName);

                        if (File.Exists(setDocument.DocumentUrl) && !File.Exists(localUrl))
                        {
                            File.Copy(setDocument.DocumentUrl, localUrl);
                        }
                        setDocumentsHTML.Append(@" <div class='pdf-document'>
                            <a href='javascript:;' id='" + setDocument.DocType + @"' onclick='pdfview(this)'><i class='fa fa-file-pdf-o'></i> " + setDocument.DocType + @" Shown Documents from " + setDocument.UpdatedDate + @"</p>
                        </a> </div>");
                        // setDocumentsHTML.Append(@"<div style='min-width: 150px;'><a href='/Content/Files/" + fileName + "' target='_blank' data-original-title='Click to view' data-trigger='hover' data-placement='bottom' class='popovers text-info'><strong>" + setDocument.DocType + @"</strong></a> ( <small> pages: <strong>" + setDocument.PageCount + @"</strong></small> )</div>");
                        setDocumentsPdf.Append(@"<div class='pdfView' id='pdf-" + setDocument.DocType + @"' style='display: none'> <iframe width='100%' height='100%' src='/Content/Files/" + fileName + @"'> </iframe></div>");
                    }
                    ResultHolder.InnerHtml = setDocumentsHTML.ToString();
                    FileHolder.InnerHtml   = setDocumentsPdf.ToString();
                    string xmlFileName = Path.GetFileName(set.SetXmlPath);
                    string localXMLUrl = Server.MapPath("/Content/Files/" + xmlFileName);
                    if (set.SetXmlPath != null && set.SetXmlPath != "")
                    {
                        if (File.Exists(set.SetXmlPath) && !File.Exists(localXMLUrl))
                        {
                            File.Copy(set.SetXmlPath, localXMLUrl);
                        }

                        asb.Append(@" <div>
                        " + columnData + @"
                       <br /> Branch : " + branch.Code + @" 
                       <br /> Department : " + department.Code + @"
                       <br /> Batch No : " + b.BatchNo + @"
                    </div>");
                        //  PropsHolder.InnerHtml = asb.ToString();
                        //                        asb.Append(@"<tr>
                        //                                    <td class='" + (set.IsReleased == 0 ? "" : "text-success") + @"'>
                        //                                        " + index + @"
                        //                                    </td>
                        //                                    <td>branch Code " + branch.Code + @"<br />Department - " + department.Code + @"<br />User Batch No " + b.BatchNo + @"<br />
                        //AA No " + b.BatchNo + @"<br />
                        //Acount Number " + b.BatchNo + @"<br /></td>
                        //                                    <td><a href='/Content/Files/" + xmlFileName + @"' target='_blank' data-original-title='Click to view XML' data-trigger='hover' data-placement='bottom' class='popovers text-info'><strong>" + columnData + @"</strong></a></td>
                        //                                    <td style='text-align:left'>
                        //Created On " + (set.UpdatedDate == null ? set.CreatedDate.ToString("dd/MM/yyyy HH:mm:ss") : set.UpdatedDate.Value.ToString("dd/MM/yyyy HH:mm:ss")) + @"<br />
                        //                        "+ setDocumentsPdf.ToString() + @" </td>
                        //                                </tr>");
                    }
                    index++;
                }
                PropsHolder.InnerHtml = asb.ToString();
            }
        }