public void SetupTable() { if (!this.m_bEdit) { AxMSFlexGrid grdParameters = this.grdParameters; CfrmSUFIMain frmSUFIMain = this.frmMain.frmSUFIMain; Recordset dbParameters = frmSUFIMain.dbParameters; this.frmMain.frmSUFIMain.OpenCurrentParameters(ref dbParameters); frmSUFIMain.dbParameters = dbParameters; grdParameters.Cols = 4; frmSUFIMain = this.frmMain.frmSUFIMain; dbParameters = frmSUFIMain.dbParameters; frmSUFIMain.dbParameters = dbParameters; grdParameters.Rows = ReadSaveFunctions.RecordCount(ref dbParameters) + 1; grdParameters.FixedCols = 1; grdParameters.FixedRows = 1; grdParameters.set_TextMatrix(0, 0, "Name:"); grdParameters.set_TextMatrix(0, 1, "Min.:"); grdParameters.set_TextMatrix(0, 2, "Max.:"); grdParameters.set_TextMatrix(0, 3, "Strata:"); grdParameters.Row = 0; this.frmMain.frmSUFIMain.dbParameters.MoveFirst(); while (true) { if (this.frmMain.frmSUFIMain.dbParameters.EOF) { this.frmMain.frmSUFIMain.dbParameters.Close(); grdParameters = null; break; } grdParameters.Row++; grdParameters.set_TextMatrix(grdParameters.Row, 0, Conversions.ToString(this.frmMain.frmSUFIMain.dbParameters[]["Name"][]));
private void SubWeightsFromLayerThickness() { Recordset rs = new RecordsetClass(); Recordset recordset2 = rs; recordset2.Open("select * from [Soil profile] where R_id=" + Conversions.ToString((int)this.m_RunID), this.frmMain.DatabaseConnection, CursorTypeEnum.adOpenDynamic, LockTypeEnum.adLockPessimistic, -1); int num4 = ReadSaveFunctions.RecordCount(ref rs); int num2 = 1; while (true) { float num3; int num6 = num4; if (num2 > num6) { recordset2.MoveFirst(); short index = 1; int num5 = ReadSaveFunctions.RecordCount(ref rs); num2 = 1; while (true) { num6 = num5; if (num2 > num6) { recordset2 = null; this.DisplayWeights(); return; } if (Conversions.ToBoolean(Operators.AndObject(Operators.CompareObjectGreaterEqual(recordset2[]["layer_no"][], Conversions.ToShort(this.txtFrom.Text), false), Operators.CompareObjectLessEqual(recordset2[]["layer_no"][], Conversions.ToShort(this.lblToLayer.Text), false))))
private void Command2_Click(object eventSender, EventArgs eventArgs) { if (Strings.Len(this.Text2.Text) == 0) { MiscFUncs.MsgBox_Renamed("Enter project description", 0, ""); this.Text2.Focus(); } else if (Strings.Len(this.Text1.Text) == 0) { MiscFUncs.MsgBox_Renamed("Enter Run_name", 0, ""); this.Text1.Focus(); } else { Cursor.Current = Cursors.WaitCursor; string text = this.Text2.Text; string expression = this.Text4.Text; GlobalVariables.Run_name = this.Text1.Text; if (Strings.Len(expression) == 0) { expression = "No run-description"; } this.Hide(); this.IDCANCEL = false; this.frmMain.Refresh(); ReadSaveFunctions.SaveToDatabase(ref text, ref expression, ref GlobalVariables.project_name, ref GlobalVariables.ProjectIDno, ref true, ref this.frmMain); GlobalVariables.Run_dscrpt = expression; Cursor.Current = Cursors.Default; this.frmMain.Text = "Project: " + GlobalVariables.project_name + @" \ Simulation: " + GlobalVariables.Run_name; GlobalVariables.New_Project = false; this.frmMain.mnuToolsChangeParameters.Enabled = true; } }
private void Command2_Click(object eventSender, EventArgs eventArgs) { this.Text1.Text = Strings.Trim(this.Text1.Text); if (this.Text1.Text == "") { MiscFUncs.MsgBox_Renamed("Please enter a name for the project", 0x30, ""); this.Text1.Focus(); } else { GlobalVariables.project_name = this.Text1.Text; GlobalVariables.Project_dscrpt = this.Text2.Text; Cursor.Current = Cursors.WaitCursor; this.Refresh(); ReadSaveFunctions.ReadOptions(ref 1, ref this.m_frmMain); ReadSaveFunctions.ReadRun_ID(ref 1, ref this.m_frmMain); ReadSaveFunctions.ReadSite(ref 1, ref this.m_frmMain); ReadSaveFunctions.ReadSetup(ref 1, ref this.m_frmMain); ReadSaveFunctions.ReadIBcond(ref 1, ref this.m_frmMain); ReadSaveFunctions.ReadPhysicalParms(ref 1, ref this.m_frmMain); ReadSaveFunctions.ReadIrrigation(ref 1, ref this.m_frmMain); ReadSaveFunctions.ReadSoilProfile(ref 1, ref this.m_frmMain); ReadSaveFunctions.ReadSolute(ref 1, ref this.m_frmMain); ReadSaveFunctions.ReadCrop(ref 1, ref this.m_frmMain); ReadSaveFunctions.ReadOutput(ref 1, ref this.m_frmMain); Cursor.Current = Cursors.Default; this.m_frmMain.Editera.Enabled = true; this.m_frmMain.SaveProject.Enabled = true; this.m_frmMain.SaveAs.Enabled = true; this.m_frmMain.SaveToparameterFileToolStripMenuItem.Enabled = true; this.m_frmMain.current.Enabled = true; this.m_frmMain.NewProject.Enabled = true; this.m_frmMain.Text = "Project: " + GlobalVariables.project_name + " Simulation: " + GlobalVariables.Run_name; this.m_frmMain.mnuToolsChangeParameters.Enabled = true; GlobalVariables.Rainfall_file = MyProject.Application.Info.DirectoryPath + @"\" + GlobalVariables.Rainfall_file; GlobalVariables.Met_file = MyProject.Application.Info.DirectoryPath + @"\" + GlobalVariables.Met_file; GlobalVariables.TensionFile = MyProject.Application.Info.DirectoryPath + @"\" + GlobalVariables.TensionFile; GlobalVariables.Driving_file = MyProject.Application.Info.DirectoryPath + @"\" + GlobalVariables.Driving_file; CfrmMain frmMain = this.m_frmMain; frmMain.InitMyForms(); frmMain.frmParameters.ShowAll(); frmMain.OutputForm.Show(); frmMain.OutputForm.Hide(); frmMain.OutputForm.SaveOutputs(); frmMain = null; this.Hide(); } }
private static void PrepareParameterArrays(ref CfrmMain frmMain) { string str = ""; string str2 = ""; Recordset rs = new RecordsetClass(); Recordset recordset2 = new RecordsetClass(); CfrmMain main = frmMain; rs.Open("select * from ParameterInfo order by [Order]", frmMain.DatabaseConnection, CursorTypeEnum.adOpenDynamic, LockTypeEnum.adLockPessimistic, -1); nparameter_names = (short)ReadSaveFunctions.RecordCount(ref rs); while (true) { int num6; bool flag = !rs.EOF; if (!flag) { rs.MoveFirst(); GlobalVariables.pname = new string[nparameter_names + 1]; GlobalVariables.FirstPos = new short[(nparameter_names + 1) + 1]; P = new float[nparameters + 1]; pgroup = new short[nparameter_names + 1]; plength = new short[nparameter_names + 1]; GlobalVariables.FirstPos[1] = 1; i = 1; short num8 = (short)ReadSaveFunctions.RecordCount(ref rs); i = 1; while (true) { short num4; short num14 = num8; if (i > num14) { GlobalVariables.FirstPos[i] = (short)(nparameters + 1); main = null; return; } GlobalVariables.pname[i] = Conversions.ToString(rs[]["ParameterName"][]);