Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="bp_Type"></param>
        /// <returns></returns>
        public JsonResult GetBPHeader(string bp_Type, string Effective_from, string Effective_to, int Value)
        {
            string userCode    = _objCurrentInfo.GetUserCode();
            string companyCode = _objCurrentInfo.GetCompanyCode();
            //  StringBuilder bpHeaderRowsHTMLFormat = new StringBuilder();

            DataSet ds = _objSPData.GetBatchProcessingHeader(companyCode, bp_Type, userCode, Effective_from, Effective_to, Value);

            //if (ds != null && ds.Tables != null && ds.Tables.Count > 0 && ds.Tables[0].Rows != null && ds.Tables[0].Rows.Count > 0)
            //{

            //    DataRowCollection drCollection = ds.Tables[0].Rows;
            // Bind Error Details
            //    bpHeaderRowsHTMLFormat.Append("<table class='bpTable' border='0' cellspacing='0' cellpadding='0' style='margin-top:2%;'><thead><tr><th>File Name</th>");
            //    bpHeaderRowsHTMLFormat.Append("<th>Date of Upload</th><th>Uploaded By</th><th>Status of upload</th><th>Reupload</th></thead><tbody>");
            //    foreach (DataRow dr in drCollection)
            //    {
            //        string errorClass = string.Empty;
            //        errorClass = dr["Status"].ToString().ToUpper() == "ERROR" ? "ERR_ROW" : "";
            //        string fileName = string.Empty;
            //        if (dr["Upload_File_Name"].ToString().Contains("\\"))
            //        {
            //            fileName = dr["Upload_File_Name"].ToString().Substring(dr["Upload_File_Name"].ToString().LastIndexOf('\\')).Replace("\\", "");

            //        }
            //        else
            //        {
            //            fileName = dr["Upload_File_Name"].ToString();
            //        }
            //        bpHeaderRowsHTMLFormat.Append("<tr class='" + errorClass + "'><td>" + fileName + "</td>");
            //        bpHeaderRowsHTMLFormat.Append("<td>" + dr["Upload_Date"].ToString() + "</td>");
            //        bpHeaderRowsHTMLFormat.Append("<td>" + dr["User_Name"].ToString() + "</td>");
            //        if (errorClass.Trim().Length > 0)
            //        {
            //            bpHeaderRowsHTMLFormat.Append("<td><a href='#' onclick='BPPopup(\"" + dr["BP_ID"].ToString() + "\")'> " + dr["Status"].ToString() + "</a></td>");
            //        }
            //        else
            //        {
            //            if (!string.IsNullOrEmpty(dr["DB_Error"].ToString()))
            //            {
            //                bpHeaderRowsHTMLFormat.Append("<td>" + dr["Status"].ToString() + "-" + dr["DB_Error"].ToString() + "</td>");
            //            }
            //            else
            //            {
            //                bpHeaderRowsHTMLFormat.Append("<td>" + dr["Status"].ToString() + "</td>");
            //            }
            //            // bpHeaderRowsHTMLFormat.Append("<td>" + dr["Status"].ToString() + "</td>");
            //        }
            //        bpHeaderRowsHTMLFormat.Append("<td><a href='#' onclick='fnRedirectToUploadScreen()'>" + dr["Reupload"].ToString() + "</a></td>");
            //        bpHeaderRowsHTMLFormat.Append("</tr>");
            //    }
            //    bpHeaderRowsHTMLFormat.Append("</tbody></table>");
            //}
            //else
            //{
            //    bpHeaderRowsHTMLFormat.Append("<span> No Uploaded Found.</span>");
            //}
            DataControl.JSONConverter _objJson = new DataControl.JSONConverter();
            return(Json(_objJson.Serialize(ds), JsonRequestBehavior.AllowGet));
        }