private DataTable ReadExcelDrillingParameters(string WellName) { DataTable dtbl = new DataTable(WellName); try { ReadFromExcel objClass = new ReadFromExcel(); string strPath = ""; string ExcelName = "Drilling Parameters"; strPath = Properties.Settings.Default.DrillingParametersPath; if (dtblDrillingParameter.Rows.Count == 0) { dtblDrillingParameter = objClass.ReadExcelFile(strPath, ExcelName, "YES"); } var dsStatus = (from row in dtblDrillingParameter.AsEnumerable() where row.Field <string>("Full Name") == WellName select new { WaitOnBit = row.Field <double>("Weight on Bit (k_daN)"), RPM = row.Field <double>("RPM (rpm)"), TorqAmps = row.Field <double>("Torq (amps)"), PumpPrussure = row.Field <double>("Pump Pressure (kPa)"), PumpFlow = row.Field <double>("Pump Flow (m3/min)"), MaxTorq = row.Field <double>("Max Torq (amps)"), }); dtbl.Columns.Add("Weight on Bit (k_daN)"); dtbl.Columns.Add("RPM (rpm)"); dtbl.Columns.Add("Torq (amps)"); dtbl.Columns.Add("Pump Pressure (kPa)"); dtbl.Columns.Add("Pump Flow (m3/min)"); dtbl.Columns.Add("Max Torq (amps)"); DataRow workRow; foreach (var item in dsStatus) { workRow = dtbl.NewRow(); workRow["Weight on Bit (k_daN)"] = item.WaitOnBit; workRow["RPM (rpm)"] = item.RPM; workRow["Torq (amps)"] = item.TorqAmps; workRow["Pump Pressure (kPa)"] = item.PumpPrussure; workRow["Pump Flow (m3/min)"] = item.PumpFlow; workRow["Max Torq (amps)"] = item.MaxTorq; dtbl.Rows.Add(workRow); } ExcelName = "Drilling Parameters"; } catch (Exception ex) { MessageBox.Show(ex.Message.ToString(), "EPMS-Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Common.WriteToFile(ex.Message, false); } return(dtbl); }
private DataTable ReadExcelCalcimetry(string WellName) { DataTable dtbl = new DataTable(WellName); try { ReadFromExcel objClass = new ReadFromExcel(); string strPath = ""; string ExcelName = "Calcimetry"; strPath = Properties.Settings.Default.CalcimetryPath; if (dtblCalcimetry.Rows.Count == 0) { dtblCalcimetry = objClass.ReadExcelFile(strPath, ExcelName, "YES"); } var dsStatus = (from row in dtblCalcimetry.AsEnumerable() where row.Field <string>("Full Name") == WellName select new { Calcium = row.Field <double>("Calcium (%)"), Carbonates = row.Field <double>("Carbonates (%)") }); dtbl.Columns.Add("Calcium"); dtbl.Columns.Add("Carbonates"); DataRow workRow; foreach (var item in dsStatus) { workRow = dtbl.NewRow(); workRow["Calcium"] = item.Calcium; workRow["Carbonates"] = item.Carbonates; dtbl.Rows.Add(workRow); } ExcelName = "Drilling Parameters"; } catch (Exception ex) { MessageBox.Show(ex.Message.ToString(), "EPMS-Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Common.WriteToFile(ex.Message, false); } return(dtbl); }
private DataTable ReadIntegretedLithology(string WellName) { DataTable dtbl = new DataTable(WellName); try { ReadFromExcel objClass = new ReadFromExcel(); string strPath = ""; string ExcelName = "Integreted Lithology"; strPath = Properties.Settings.Default.InterpretedLithologyPath; if (dtblIntegrtdLithology.Rows.Count == 0) { dtblIntegrtdLithology = objClass.ReadExcelFile(strPath, ExcelName, "YES"); } var dsStatus = (from row in dtblIntegrtdLithology.AsEnumerable() where row.Field <string>("Full Name") == WellName select new { LithologyCode = row.Field <double>("Lithology Code"), Description = row.Field <double>("Description") }); dtbl.Columns.Add("Lithology Code"); dtbl.Columns.Add("Description"); DataRow workRow; foreach (var item in dsStatus) { workRow = dtbl.NewRow(); workRow["Lithology Code"] = item.LithologyCode; workRow["Description"] = item.Description; dtbl.Rows.Add(workRow); } ExcelName = "Integreted Lithology"; } catch (Exception ex) { MessageBox.Show(ex.Message.ToString(), "EPMS-Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Common.WriteToFile(ex.Message, false); } return(dtbl); }
private DataTable ReadFromLithologyPercentage(string WellName) { DataTable dtbl = new DataTable(WellName); try { ReadFromExcel objClass = new ReadFromExcel(); string strPath = ""; string ExcelName = "LithologyPercentage"; strPath = Properties.Settings.Default.HCIndicatorNorthPath; if (dtblLithologyPercntg.Rows.Count == 0) { dtblLithologyPercntg = objClass.ReadExcelFile(strPath, ExcelName, "YES"); } var dsStatus = (from row in dtblHcIndicator.AsEnumerable() where row.Field <string>("Full Name") == WellName select new { LithoPercntg = row.Field <double>("Lithology Percentage") }); dtbl.Columns.Add("Lithology Percentage"); DataRow workRow; foreach (var item in dsStatus) { workRow = dtbl.NewRow(); workRow["Lithology Percentage"] = item.LithoPercntg; dtbl.Rows.Add(workRow); } ExcelName = "LithologyPercentage"; } catch (Exception ex) { MessageBox.Show("ReadFromLithologyPercentage: " + ex.Message.ToString(), "EPMS -Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Common.WriteToFile(ex.Message, false); } return(dtbl); }