Esempio n. 1
0
        public static string SaveFileInfo(string information, string viewName, string reference)
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iWrapFunctions   = dbManagerFactory.GetDBManager();

            return(iWrapFunctions.SaveFileInfo(information, viewName, reference));
        }
Esempio n. 2
0
        public static string GetInfoForThisFile(string viewName, string fileName)
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iWrapFunctions   = dbManagerFactory.GetDBManager();

            return(iWrapFunctions.GetInfoForThisFile(viewName, fileName));
        }
Esempio n. 3
0
        public static string GetListQueryByListName(string sqlFrom, string whereClause, string rep_code, string listName)
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iWrapFunctions   = dbManagerFactory.GetDBManager();

            string[] listQueryAndDescription = GetListQueryAndDescriptionByName(listName, rep_code).Split(new string[] { "@@@@" }, StringSplitOptions.None);
            string   listQuery = listQueryAndDescription[0];

            string[]      fields      = HIT.OB.STD.CommonUtil.ExtractFieldNameFromQuery(listQuery).Split(',');
            List <string> columnField = new List <string>();

            DataTable dtData = iWrapFunctions.GetDataTable("SELECT * FROM " + sqlFrom);

            listQuery = RemoveFieldsFromWhereClauseWhichValuesAreNotAvailable(listQuery, fields, columnField, dtData);


            string sqlQuery = "select " + string.Join(",", columnField.ToArray()) + " FROM " + sqlFrom + " WHERE " + whereClause;

            dtData = iWrapFunctions.GetDataTable(sqlQuery);
            foreach (string field in columnField)
            {
                listQuery = listQuery.Replace("%" + field + "%", "'" + dtData.Rows[0][field].ToString().Trim() + "'");
            }

            return(listQuery);
        }
Esempio n. 4
0
        public static string ValidateDeepLink(ref string deepLinkReport, string whereClause)
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iWrapFunctions   = dbManagerFactory.GetDBManager();

            return(iWrapFunctions.ValidateDeepLink(ref deepLinkReport, whereClause));
        }
Esempio n. 5
0
        public static string GetItemInfoByItemNo(string sqlFrom, string whereClause, string selectedFields)
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iWrapFunctions   = dbManagerFactory.GetDBManager();
            //string strSql = "Select " + string.Join(",", selectedFields.Split(';')) + " from " + sqlFrom + " where " + whereClause;
            string    strSql         = "Select distinct " + selectedFields + " from " + sqlFrom + " where " + whereClause;
            DataTable dtPartlistInfo = iWrapFunctions.GetDataTable(strSql);

            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("ItemInfo:[");
            //int rowNum = 1;

            for (int i = 0; i < dtPartlistInfo.Rows.Count; i++)
            {
                DataRow currentRow = dtPartlistInfo.Rows[i];
                // stringBuilder.Append("[\"" + (i + 1).ToString() + "\",");
                stringBuilder.Append("[");
                foreach (DataColumn column in dtPartlistInfo.Columns)
                {
                    stringBuilder.AppendFormat("\"{0}\",", GetJSONFormat(currentRow[column.ColumnName].ToString()));
                }

                stringBuilder = stringBuilder.Remove(stringBuilder.ToString().LastIndexOf(','), 1);
                stringBuilder.Append("]");
                if (i < dtPartlistInfo.Rows.Count - 1)
                {
                    stringBuilder.Append(",");
                }
            }

            stringBuilder.Append("]");
            return("{" + stringBuilder + "}");
        }
Esempio n. 6
0
        public static string UpdateBusket(string sqlFrom)
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iWrapFunctions   = dbManagerFactory.GetDBManager();
            DataTable        dtPartlistInfo   = iWrapFunctions.GetDataTable(sqlFrom);

            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("ItemInfo:[");
            //int rowNum = 1;

            for (int i = 0; i < dtPartlistInfo.Rows.Count; i++)
            {
                DataRow currentRow = dtPartlistInfo.Rows[i];
                // stringBuilder.Append("[\"" + (i + 1).ToString() + "\",");
                stringBuilder.Append("[");
                foreach (DataColumn column in dtPartlistInfo.Columns)
                {
                    stringBuilder.AppendFormat("\"{0}\",", GetJSONFormat(currentRow[column.ColumnName].ToString()));
                }

                stringBuilder = stringBuilder.Remove(stringBuilder.ToString().LastIndexOf(','), 1);
                stringBuilder.Append("]");
                if (i < dtPartlistInfo.Rows.Count - 1)
                {
                    stringBuilder.Append(",");
                }
            }

            stringBuilder.Append("]");
            return("{" + stringBuilder + "}");
        }
Esempio n. 7
0
        public static string GetReportList(string roleName)
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iWrapFunctions   = dbManagerFactory.GetDBManager();

            DataTable     dtReportInfo  = iWrapFunctions.GetReportList(roleName);
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("reportList:[");
            for (int r = 0; r < dtReportInfo.Rows.Count; r++)
            {
                DataRow reportInfoRow = dtReportInfo.Rows[r];
                stringBuilder.Append("{");
                stringBuilder.AppendFormat("report_code: '{0}'", reportInfoRow["report_code"].ToString());
                stringBuilder.AppendFormat(",report_name: '{0}'", reportInfoRow["report_name"].ToString());
                stringBuilder.Append("}");
                if (r < dtReportInfo.Rows.Count - 1)
                {
                    stringBuilder.Append(",");
                }
            }
            dtReportInfo.Dispose();
            stringBuilder.Append("]");
            return("{" + stringBuilder + "}");
        }
Esempio n. 8
0
        public static DataTable GetReportCodeList()
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iWrapFunctions   = dbManagerFactory.GetDBManager();

            return(iWrapFunctions.GetReportList());
        }
Esempio n. 9
0
        public static string UpdateFileInfo(string information, string viewName, string relfilename)
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iWrapFunctions   = dbManagerFactory.GetDBManager();

            return(iWrapFunctions.UpdateFileInfo(information, viewName, relfilename));
        }
Esempio n. 10
0
        public static bool InsertGroupColor(string REPORT_CODE, string GROUP_BY, string GROUP_CODE, string COLOR_CODE)
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iOBFunctions     = dbManagerFactory.GetDBManager();
            bool             result           = iOBFunctions.InsertGroupColor(REPORT_CODE, GROUP_BY, GROUP_CODE, COLOR_CODE);

            return(result);
        }
Esempio n. 11
0
        internal static bool CreateNewReportWithSettings(string REPORT_CODE, string REPORT_NAME, string SQL_WHERE, string GROUP_BY, string ORDER_BY, string ORDER_BY_DIR, string field_caps, string report_settings, string sid, string reports, string obs)
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iOBFunctions     = dbManagerFactory.GetDBManager();

            iOBFunctions.CreateNewReportWithSettings(REPORT_CODE, REPORT_NAME, SQL_WHERE, GROUP_BY, ORDER_BY, ORDER_BY_DIR, field_caps, report_settings, sid, reports, obs);
            return(true);
        }
Esempio n. 12
0
        public static bool DeleteReport(string rep_code)
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iWrapFunctions   = dbManagerFactory.GetDBManager();
            string           result           = iWrapFunctions.DeleteReport(rep_code);

            return(result == "success" ? true : false);
        }
Esempio n. 13
0
        internal static bool UpdateUserDefinedReportSettings(string REPORT_CODE, string SQL_WHERE, string GROUP_BY, string ORDER_BY, string ORDER_BY_DIR, string report_settings)
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iOBFunctions     = dbManagerFactory.GetDBManager();

            iOBFunctions.UpdateUserDefinedReportSettings(REPORT_CODE, SQL_WHERE, GROUP_BY, ORDER_BY, ORDER_BY_DIR, report_settings);
            return(true);
        }
Esempio n. 14
0
        public static string GetReportConfigInfo(string rep_code)
        {
            DBManagerFactory dbManagerFactory    = new DBManagerFactory();
            IWrapFunctions   iWrapFunctions      = dbManagerFactory.GetDBManager();
            DataRow          drRepportConfigInfo = iWrapFunctions.GetReportConfigInfo(rep_code);

            return(drRepportConfigInfo["SQL_FROM"].ToString());
        }
Esempio n. 15
0
        public static string GetListQueryAndDescriptionByName(string listName, string rep_code)
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iWrapFunctions   = dbManagerFactory.GetDBManager();

            DataTable listInfoTable = iWrapFunctions.GetReportExtensionInfo(rep_code);

            return(listInfoTable.Rows[0]["list_" + listName + "sql"].ToString() + "@@@@" + listInfoTable.Rows[0]["description_list_" + listName + "sql"].ToString());
        }
Esempio n. 16
0
        public static string GetPartlistQueryAndKeys(string sqlFrom, string whereClause, string rep_code)
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iWrapFunctions   = dbManagerFactory.GetDBManager();

            string artCodeRevisonAndQuery = iWrapFunctions.GetArticleCodeAndRevisionAndPartlistDataQuery(sqlFrom, whereClause.Replace("|", "'"), rep_code);

            string[] partlistInfoArray = artCodeRevisonAndQuery.Split(new string[] { "@@@@" }, StringSplitOptions.None);

            string artRevInfo = "Keys:['" + partlistInfoArray[0] + "','" + partlistInfoArray[1] + "'],";

            return("{" + artRevInfo + "Query:[\"" + partlistInfoArray[2] + "\"]}");
        }
Esempio n. 17
0
        public static string GetAvailableListQueryPair(string sqlFrom, string whereClause, string rep_code)
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iWrapFunctions   = dbManagerFactory.GetDBManager();

            DataTable listInfoTable = iWrapFunctions.GetReportExtensionInfo(rep_code);

            List <string> columnsNamelist = new List <string>();

            foreach (DataColumn column in listInfoTable.Columns)
            {
                if (column.ColumnName.StartsWith("list"))
                {
                    columnsNamelist.Add(column.ColumnName);
                }
            }

            StringBuilder listNameQueryPair = new StringBuilder();

            listNameQueryPair.Append("{listNameQueryPair:[");

            if (listInfoTable.Rows.Count > 0)
            {
                int    i          = 0;
                string queryValue = string.Empty;
                foreach (string column in columnsNamelist)
                {
                    if (!listInfoTable.Rows[0][column].ToString().Equals(string.Empty))
                    {
                        //queryDescription.AppendFormat("['{0}','{1}']", listInfoTable.Rows[0][column], listInfoTable.Rows[0]["description_" + column]);
                        queryValue = listInfoTable.Rows[0][column].ToString();
                        if (queryValue.Contains("AS"))
                        {
                            queryValue.Replace("\"", ";double;Quote;");
                        }

                        listNameQueryPair.AppendFormat("['{0}','{1}']", column.Replace("sql", string.Empty).Replace("list_", string.Empty).ToUpperFirstChar(), queryValue);
                        if (i < columnsNamelist.Count - 1)
                        {
                            listNameQueryPair.Append(",");
                        }
                    }
                    i++;
                }
            }

            listNameQueryPair.Append("]}");

            return(listNameQueryPair.ToString());
        }
Esempio n. 18
0
        public static bool CheckForReportCodeAvailability(string rep_code)
        {
            bool isAvailable = true;

            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iWrapFunctions   = dbManagerFactory.GetDBManager();
            DataTable        dt = iWrapFunctions.GetDataTable("select * from dfn_repdetail where upper(report_code) = '" + rep_code.ToUpper() + "'");

            if (dt.Rows.Count > 0)
            {
                isAvailable = false;
            }
            return(isAvailable);
        }
Esempio n. 19
0
        public static string GetPartlistInfo(string sqlFrom, string whereClause, string rep_code)
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iWrapFunctions   = dbManagerFactory.GetDBManager();

            string artCodeRevisonAndQuery = iWrapFunctions.GetArticleCodeAndRevisionAndPartlistDataQuery(sqlFrom, whereClause.Replace("|", "'"), rep_code);

            string[]      partlistInfoArray = artCodeRevisonAndQuery.Split(new string[] { "@@@@" }, StringSplitOptions.None);
            DataTable     dtPartlistInfo    = iWrapFunctions.GetPartlistInfo(partlistInfoArray[2]);
            StringBuilder stringBuilder     = new StringBuilder();

            stringBuilder = GetColumnInfoGridInfoFromDataTable(dtPartlistInfo, stringBuilder);

            string artRevInfo = "Keys:['" + partlistInfoArray[0] + "','" + partlistInfoArray[1] + "'],";

            return("{" + artRevInfo + stringBuilder + "}");
        }
Esempio n. 20
0
        public static string GetBaseMaterialDetail(string keyNameValues, string rep_code)
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iWrapFunctions   = dbManagerFactory.GetDBManager();
            DataTable        dtBaseMaterial   = iWrapFunctions.GetBaseMaterialDetail(keyNameValues, rep_code);
            StringBuilder    stringBuilder    = new StringBuilder();

            stringBuilder.Append("\"columnInfo\":[");
            string columns = string.Empty;

            foreach (DataColumn column in dtBaseMaterial.Columns)
            {
                columns += "\"" + column.ColumnName + "\",";
            }
            stringBuilder.Append(columns);
            stringBuilder = stringBuilder.Remove(stringBuilder.ToString().LastIndexOf(','), 1);
            stringBuilder.Append("],");

            stringBuilder.Append("gridInfo:[");
            //int rowNum = 1;

            for (int i = 0; i < dtBaseMaterial.Rows.Count; i++)
            {
                DataRow currentRow = dtBaseMaterial.Rows[i];
                //stringBuilder.Append("[\"" + rowNum + "\",");
                stringBuilder.Append("[");

                foreach (DataColumn column in dtBaseMaterial.Columns)
                {
                    stringBuilder.AppendFormat("\"{0}\",", GetJSONFormat(currentRow[column.ColumnName].ToString()));
                }

                stringBuilder = stringBuilder.Remove(stringBuilder.ToString().LastIndexOf(','), 1);
                stringBuilder.Append("]");
                if (i < dtBaseMaterial.Rows.Count - 1)
                {
                    stringBuilder.Append(",");
                }
            }
            stringBuilder.Append("]");
            return("{" + stringBuilder + "}");
        }
Esempio n. 21
0
        public static string GetReportArguments(string reportCode)
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iWrapFunctions   = dbManagerFactory.GetDBManager();

            DataTable     dtReportInfo    = iWrapFunctions.GetReportArguments(reportCode);
            StringBuilder settingsBuilder = new StringBuilder();
            string        sqlSelect       = string.Empty;
            string        FieldList       = "";
            StringBuilder sqlkeyfields    = new StringBuilder();
            StringBuilder detailSqlFields = new StringBuilder();
            string        fieldTypesJson  = "";

            string keyfields          = string.Empty;
            string detailSqlFieldSets = string.Empty;

            if (dtReportInfo.Rows.Count > 0)
            {
                DataRow reportInfoRow  = dtReportInfo.Rows[0];
                string  sqlFrom        = reportInfoRow["sql_from"].ToString();
                string  reportSettings = reportInfoRow["report_settings"].ToString();
                string  orderBy        = reportInfoRow["sql_orderby"].ToString();
                string  groupBy        = reportInfoRow["sql_groupby"].ToString();
                if (string.IsNullOrEmpty(groupBy))
                {
                    groupBy = "NONE";
                }
                string fieldNameAndType = GetFieldAndTypeList(reportInfoRow["sql_from"].ToString(), reportCode);
                string sqlWhere         = reportInfoRow["sql_where"].ToString();
                if (!string.IsNullOrEmpty(sqlWhere))
                {
                    string isWhereValid = HIT.OB.STD.Core.BLL.OBController.ValidateWhereClause(reportCode, sqlFrom, sqlWhere);
                    if (isWhereValid != "true")
                    {
                        sqlWhere = "INVALID_WHERE";
                    }
                }
                string fieldCaps = reportInfoRow["field_caps"].ToString().Replace(',', ';').Trim(new char[] { ';' });
                FieldList      = fieldNameAndType.Split(new string[] { "$$$$" }, StringSplitOptions.None)[0];
                fieldTypesJson = fieldNameAndType.Split(new string[] { "$$$$" }, StringSplitOptions.None)[1];

                settingsBuilder.AppendFormat("report_code: \"{0}\"", GetJSONFormat(reportCode));
                settingsBuilder.AppendFormat(",report_name: \"{0}\"", GetJSONFormat(reportInfoRow["report_name"].ToString()));
                settingsBuilder.AppendFormat(",field_caps: \"{0}\"", GetJSONFormat(fieldCaps));

                string selectedFields = FieldList.Replace("'", "").Replace(',', ';').Trim(';');
                settingsBuilder.AppendFormat(",sql_select: \"{0}\"", GetJSONFormat(selectedFields));

                settingsBuilder.AppendFormat(",sql_from: \"{0}\"", GetJSONFormat(sqlFrom));
                settingsBuilder.AppendFormat(",sql_where: \"{0}\"", GetJSONFormat(sqlWhere));
                settingsBuilder.AppendFormat(",sql_groupby: \"{0}\"", GetJSONFormat(groupBy));
                settingsBuilder.AppendFormat(",gis_theme_layer: \"{0}\"", reportInfoRow["gis_theme_layer"].ToString().ToLower());

                settingsBuilder.AppendFormat(",sql_orderby: \"{0}\"", GetJSONFormat(orderBy));
                settingsBuilder.AppendFormat(",sql_orderdir: \"{0}\"", GetJSONFormat(reportInfoRow["sql_orderdir"].ToString()));
                settingsBuilder.AppendFormat(",report_settings: \"{0}\"", GetJSONFormat(reportSettings));
                string multiSelect = reportInfoRow["multiselect"].ToString().ToLower();
                settingsBuilder.AppendFormat(",multiselect: \"{0}\"", multiSelect);

                // sqlSelect = reportInfoRow["sql_select"].ToString();
                detailSqlFieldSets = reportInfoRow["detail_fieldsets"].ToString().Replace(",", ";").Trim(';');
                detailSqlFields.AppendFormat("detailsqlfields: \"{0}\"", GetJSONFormat(detailSqlFieldSets));

                keyfields = reportInfoRow["sql_keyfields"].ToString().Replace(',', ';').Trim(';');
                sqlkeyfields.AppendFormat("sqlkeyfields: {0}", GetJSONFormat(SQLKeyFieldsJSON(keyfields)));
            }
            dtReportInfo.Dispose();

            //***Report function processing
            DataTable     dtFunctionReportInfo = iWrapFunctions.GetReportFunctionsList(reportCode);
            StringBuilder functionList         = new StringBuilder();
            StringBuilder sqlMandatory         = new StringBuilder();
            string        parameters           = string.Empty;
            string        sqlFunList           = string.Empty;
            string        imageUrls            = string.Empty;
            string        orderPos             = string.Empty;
            string        temp         = string.Empty;
            string        commonParams = string.Empty;
            string        iscustom     = string.Empty;

            if (dtFunctionReportInfo.Rows.Count > 0)
            {
                foreach (DataRow dr in dtFunctionReportInfo.Rows)
                {
                    sqlFunList = dr["function_name"].ToString();
                    orderPos   = dr["order_position"].ToString();
                    parameters = dr["parameters"].ToString().Replace(',', ';').Trim(new char[] { ';' });
                    iscustom   = dr["iscustom"].ToString().ToLower();

                    // getting sqlparameters as semicolon separated.
                    parameters = parameters.Trim(';');
                    StringBuilder param = new StringBuilder();
                    param.Append("'").Append(parameters.Replace(";", "','")).Append("'");

                    // checking common parameters.
                    commonParams = CommonParameters(parameters, commonParams);
                    functionList.AppendFormat("['{0}','{1}','{2}',[{3}]]", sqlFunList.ToUpper(), orderPos, iscustom, param.ToString());
                    functionList.Append(",");
                } // END of foreach

                commonParams = CompareSqlManSqlKey(commonParams, keyfields);
                functionList.Remove(functionList.ToString().LastIndexOf(','), 1);
                sqlMandatory.Append("'").Append(commonParams).Append("'");
            }
            else
            {
                sqlMandatory.Append("");
                functionList.Append("");
            }
            dtFunctionReportInfo.Dispose();

            return("{settings:{" + settingsBuilder.ToString() +
                   "},fieldTypes:{" + fieldTypesJson + "},fieldList:[" + FieldList + "]" +
                   ",sqlmandatory:[" + sqlMandatory.ToString() +
                   "],functionlist:[" + functionList.ToString() +
                   "]," + sqlkeyfields.ToString() + "," + detailSqlFields.ToString() + "}");
        }
Esempio n. 22
0
        public static string GetListItemInfo(string sqlFrom, string whereClause, string rep_code, string listName, string selectedFields)
        {
            DBManagerFactory dbManagerFactory = new DBManagerFactory();
            IWrapFunctions   iWrapFunctions   = dbManagerFactory.GetDBManager();

            string[] listQueryAndDescription = GetListQueryAndDescriptionByName(listName, rep_code).Split(new string[] { "@@@@" }, StringSplitOptions.None);
            string   listQuery = listQueryAndDescription[0];

            string[]      fields      = HIT.OB.STD.CommonUtil.ExtractFieldNameFromQuery(listQuery).Split(',');
            List <string> columnField = new List <string>();

            DataTable dtData = iWrapFunctions.GetDataTable("SELECT * FROM " + sqlFrom);

            listQuery = RemoveFieldsFromWhereClauseWhichValuesAreNotAvailable(listQuery, fields, columnField, dtData);

            string[] requiredField = selectedFields.Split(';');

            string currentRevision = string.Empty;

            string sqlQuery = "select " + string.Join(",", columnField.ToArray()) + (selectedFields.Length > 0 ? ("," + selectedFields.Replace(';', ',')) : "") + " FROM " + sqlFrom + " WHERE " + whereClause.Substring(0, whereClause.IndexOf("AND"));

            dtData = iWrapFunctions.GetDataTable(sqlQuery);



            foreach (string field in columnField)
            {
                if (field.Contains("revision"))
                {
                    listQuery = listQuery.Replace("%revision%", whereClause.Split('=')[2].ToString().Trim());
                }
                else
                {
                    listQuery = listQuery.Replace("%" + field + "%", "'" + dtData.Rows[0][field].ToString().Trim() + "'");
                }

                if (field.Contains("rev"))
                {
                    //currentRevision = dtData.Rows[0]["revision"].ToString();
                    currentRevision = whereClause.Split('=')[2].ToString().Replace("'", "").Trim();
                }
            }

            DataTable dtPartlistInfo = iWrapFunctions.GetPartlistInfo(listQuery);


            DataTable dtMainPartList = dtPartlistInfo.Clone();

            foreach (DataRow row in dtPartlistInfo.Rows)
            {
                DataRow newMainRow = dtMainPartList.NewRow();
                newMainRow[0] = row[0];
                newMainRow[1] = row[1];
                newMainRow[2] = row[2];
                newMainRow[3] = row[3];
                newMainRow[4] = row[4];
                newMainRow[5] = row[5];
                newMainRow[6] = row[6];
                newMainRow[7] = row[7];
                newMainRow[8] = row[8];
                newMainRow[9] = row[9];
                dtMainPartList.Rows.Add(newMainRow);
                string childComp_itemNo = row["comp_item"].ToString();
                string childItemNo      = row["item"].ToString();

                string childRevNo = row["revision"].ToString();
                //childQuery = "SELECT * FROM rc_bom WHERE item='" + childItemNo + "'  AND revision='" + childRevNo + "'  ORDER BY pos_nr";
                if (!childComp_itemNo.Equals(childItemNo))
                {
                    string childQuery = listQueryAndDescription[0];

                    childQuery = childQuery.Replace("%item%", "'" + childComp_itemNo + "'");
                    childQuery = childQuery.Replace("%revision%", "'" + childRevNo + "'");

                    DataTable dtChildPartList = iWrapFunctions.GetPartlistInfo(childQuery);

                    foreach (DataRow childRow in dtChildPartList.Rows)
                    {
                        //dtMainPartList.ImportRow(childRow);
                        DataRow newrow = dtMainPartList.NewRow();
                        newrow[0] = childRow[0];
                        newrow[1] = childRow[1];
                        newrow[2] = childRow[2];
                        newrow[3] = childRow[3];
                        newrow[4] = childRow[4];
                        newrow[5] = childRow[5];
                        newrow[6] = childRow[6];
                        newrow[7] = childRow[7];
                        newrow[8] = childRow[8];
                        newrow[9] = childRow[9];
                        //newrow = childRow;
                        //newrow[ = childRow;
                        dtMainPartList.Rows.Add(newrow);
                    }
                }
            }

            StringBuilder stringBuilder = new StringBuilder();

            //stringBuilder = GetColumnInfoGridInfoFromDataTable(dtPartlistInfo, stringBuilder);
            stringBuilder = GetColumnInfoGridInfoFromDataTable(dtMainPartList, stringBuilder);



            string firstLabel = columnField[0].ToUpperFirstChar() + " : " + dtData.Rows[0][0].ToString();

            string secondLabel = string.Empty;

            if (dtData.Rows[0][requiredField[0]].ToString() != string.Empty && (!columnField.Contains(requiredField[0])))
            {
                secondLabel = requiredField[0].ToUpperFirstChar() + " : " + dtData.Rows[0][requiredField[0]].ToString();
            }

            string thirdLabel = string.Empty;

            if (dtData.Rows[0][requiredField[1]].ToString() != string.Empty && (!columnField.Contains(requiredField[1])))
            {
                thirdLabel = requiredField[1].ToUpperFirstChar() + " : " + dtData.Rows[0][requiredField[1]].ToString();
            }

            string artRevInfo = "Keys:['" + firstLabel + "','" + secondLabel + "','" + thirdLabel + "','" + listQueryAndDescription[1] + "','" + currentRevision + "'],";
            string revision   = GetRevision(whereClause, sqlFrom, iWrapFunctions);

            return("{" + artRevInfo + revision + stringBuilder + "}");
        }