/// <summary> /// Add Uda SalesOrderAttr /// </summary> /// <param name="dataset">dataset for add items cloumns and values</param> /// <returns>dataset</returns> public DataSet AddUdaSalesOrderAttr(DataSet dataset) { //get dynamic dataset constructor DataSet dataDs = AllCommonFunctions.GetDynamicTwoColumnsDataSet(); //define sql string sql = ""; try { if (dataset.Tables.Count > 0) { if (dataset.Tables[0].Rows.Count > 0) { sql += "INSERT INTO POR_SALES_ORDER_ATTR("; //repeated check for (int i = 0; i < dataset.Tables[0].Rows.Count; i++) { if (i == 0) { sql += dataset.Tables[0].Rows[i][0].ToString(); } else { sql += ", " + dataset.Tables[0].Rows[i][0].ToString(); } } sql += ") VALUES ("; for (int i = 0; i < dataset.Tables[0].Rows.Count; i++) { if (i == 0) { sql += dataset.Tables[0].Rows[i][1]; } else { sql += ", " + dataset.Tables[0].Rows[i][1]; } } sql += " )"; //excute insert dbEngine.ExecuteNonQuery(sql); SolarViewer.Hemera.Share.Common.ReturnMessageUtils.AddServerReturnMessage(dataDs, ""); } } } catch (Exception ex) { SolarViewer.Hemera.Share.Common.ReturnMessageUtils.AddServerReturnMessage(dataDs, ex.Message); LogService.LogError("AddUdaSalesOrderAttr Error: " + ex.Message); } return(dataDs); }