private void searchButton_Click(object sender, EventArgs e) { if (mode != EDataSetMode.View) { return; } db.Lock(); try { ScheduleParamDataSet set = db.ScheduleParamSet; bookmark.Get(); if (string.IsNullOrWhiteSpace(searchStandardEdit.Text) == true) { set.Select(); } else { set.Select(searchStandardEdit.Text.Trim()); } } finally { db.Unlock(); } bookmark.Goto(); scheduleGrid.Focus(); }
private void LoadSchedule(int paramNo) { ScheduleParamDataSet schSet = Context.DB.ScheduleParamSet; schSet.SelectOrderByRecNo(paramNo); Context.Condition.Schedules.Clear(); for (int i = 0; i < schSet.GetRowCount(); i++) { ConditionSchedule sch = new ConditionSchedule(Context.Condition.Schedules.Count + 1); schSet.Fetch(i); SetSchedule(sch, schSet); Context.Condition.Schedules.Add(sch); } }
private void CtrlConfigSchedule_Load(object sender, EventArgs e) { db.Lock(); try { ScheduleParamDataSet set = db.ScheduleParamSet; set.Select(); scheduleGrid.DataSource = set.DataSet.Tables[0]; scheduleGridView.Appearance.EvenRow.BackColor = Color.FromArgb(244, 244, 236); scheduleGridView.OptionsView.EnableAppearanceEvenRow = true; } finally { db.Unlock(); } SetDataSetMode(EDataSetMode.View); }
private void saveButton_Click(object sender, EventArgs e) { standardEdit.Focus(); string standard = standardEdit.Text.Trim(); string name = nameEdit.Text.Trim(); if ((standard == "") || (name == "")) { MessageBox.Show("You must fill Standard and Name fields!", Resource.Caption, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); standardEdit.Focus(); return; } db.Lock(); try { ScheduleParamDataSet set = db.ScheduleParamSet; SetEditToDataSet(); if (mode == EDataSetMode.New) { set.RecNo = (int)db.GetGenNo("GN_SCHEDULEPARAM"); set.ParamNo = -1; set.Insert(); } else { db.ScheduleParamSet.Update(); } } finally { db.Unlock(); } SetDataSetMode(EDataSetMode.View); searchButton.PerformClick(); }
private void copyButton_Click(object sender, EventArgs e) { if (mode != EDataSetMode.View) { return; } if (scheduleGridView.FocusedRowHandle < 0) { return; } if (MessageBox.Show("Would you like to copy a record focused?", Resource.Caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } db.Lock(); try { ScheduleParamDataSet set = db.ScheduleParamSet; standardEdit.Focus(); SetEditToDataSet(); set.RecNo = (int)db.GetGenNo("GN_SCHEDULEPARAM"); set.Insert(); } finally { db.Unlock(); } searchButton.PerformClick(); }
private void SetEditToDataSet() { ScheduleParamDataSet set = db.ScheduleParamSet; set.Standard = standardEdit.Text; set.Name = nameEdit.Text; set.NoOfSteady = int.Parse(noSteadyEdit.Text); set.Preparation = int.Parse(preparationEdit.Text); set.Judgement = int.Parse(judgementEdit.Text); set.Repeat = int.Parse(repeatEdit.Text); set.ID1Use = chamberParams[0].Indoor1Use; set.ID1Mode1 = chamberParams[0].Indoor1Mode1; set.ID1Duct1 = chamberParams[0].Indoor1Duct1; set.ID1Mode2 = chamberParams[0].Indoor1Mode2; set.ID1Duct2 = chamberParams[0].Indoor1Duct2; set.ID1EdbSetup = float.Parse(id1EdbSetupEdit.Text); set.ID1EdbAvg = float.Parse(id1EdbAvgEdit.Text); set.ID1EdbDev = float.Parse(id1EdbDevEdit.Text); set.ID1EwbSetup = float.Parse(id1EwbSetupEdit.Text); set.ID1EwbAvg = float.Parse(id1EwbAvgEdit.Text); set.ID1EwbDev = float.Parse(id1EwbDevEdit.Text); set.ID1Ldb1Dev = float.Parse(id1Ldb1DevEdit.Text); set.ID1Lwb1Dev = float.Parse(id1Lwb1DevEdit.Text); set.ID1Af1Dev = float.Parse(id1Airflow1DevEdit.Text); set.ID1Ldb2Dev = float.Parse(id1Ldb2DevEdit.Text); set.ID1Lwb2Dev = float.Parse(id1Lwb2DevEdit.Text); set.ID1Af2Dev = float.Parse(id1Airflow2DevEdit.Text); set.ID1Cdp1Setup = float.Parse(id1Cdp1SetupEdit.Text); set.ID1Cdp1Avg = float.Parse(id1Cdp1AvgEdit.Text); set.ID1Cdp1Dev = float.Parse(id1Cdp1DevEdit.Text); set.ID1Cdp2Setup = float.Parse(id1Cdp2SetupEdit.Text); set.ID1Cdp2Avg = float.Parse(id1Cdp2AvgEdit.Text); set.ID1Cdp2Dev = float.Parse(id1Cdp2DevEdit.Text); set.ID2Use = chamberParams[0].Indoor2Use; set.ID2Mode1 = chamberParams[0].Indoor2Mode1; set.ID2Duct1 = chamberParams[0].Indoor2Duct1; set.ID2Mode2 = chamberParams[0].Indoor2Mode2; set.ID2Duct2 = chamberParams[0].Indoor2Duct2; set.ID2EdbSetup = float.Parse(id2EdbSetupEdit.Text); set.ID2EdbAvg = float.Parse(id2EdbAvgEdit.Text); set.ID2EdbDev = float.Parse(id2EdbDevEdit.Text); set.ID2EwbSetup = float.Parse(id2EwbSetupEdit.Text); set.ID2EwbAvg = float.Parse(id2EwbAvgEdit.Text); set.ID2EwbDev = float.Parse(id2EwbDevEdit.Text); set.ID2Ldb1Dev = float.Parse(id2Ldb1DevEdit.Text); set.ID2Lwb1Dev = float.Parse(id2Lwb1DevEdit.Text); set.ID2Af1Dev = float.Parse(id2Airflow1DevEdit.Text); set.ID2Ldb2Dev = float.Parse(id2Ldb2DevEdit.Text); set.ID2Lwb2Dev = float.Parse(id2Lwb2DevEdit.Text); set.ID2Af2Dev = float.Parse(id2Airflow2DevEdit.Text); set.ID2Cdp1Setup = float.Parse(id2Cdp1SetupEdit.Text); set.ID2Cdp1Avg = float.Parse(id2Cdp1AvgEdit.Text); set.ID2Cdp1Dev = float.Parse(id2Cdp1DevEdit.Text); set.ID2Cdp2Setup = float.Parse(id2Cdp2SetupEdit.Text); set.ID2Cdp2Avg = float.Parse(id2Cdp2AvgEdit.Text); set.ID2Cdp2Dev = float.Parse(id2Cdp2DevEdit.Text); set.ODUse = chamberParams[0].OutdoorUse; set.ODDp = chamberParams[0].OutdoorDpSensor; set.ODAutoVolt = chamberParams[0].OutdoorAutoVolt; set.ODEdbSetup = float.Parse(odEdbSetupEdit.Text); set.ODEdbAvg = float.Parse(odEdbAvgEdit.Text); set.ODEdbDev = float.Parse(odEdbDevEdit.Text); set.ODEwbSetup = float.Parse(odEwbSetupEdit.Text); set.ODEwbAvg = float.Parse(odEwbAvgEdit.Text); set.ODEwbDev = float.Parse(odEwbDevEdit.Text); set.ODEdpSetup = float.Parse(odEdpSetupEdit.Text); set.ODEdpAvg = float.Parse(odEdpAvgEdit.Text); set.ODEdpDev = float.Parse(odEdpDevEdit.Text); set.ODVolt1Setup = float.Parse(odVolt1SetupEdit.Text); set.ODVolt1Avg = float.Parse(odVolt1AvgEdit.Text); set.ODVolt1Dev = float.Parse(odVolt1DevEdit.Text); set.ODVolt2Setup = float.Parse(odVolt2SetupEdit.Text); set.ODVolt2Avg = float.Parse(odVolt2AvgEdit.Text); set.ODVolt2Dev = float.Parse(odVolt2DevEdit.Text); }
private void SetEditFromDataSet() { ScheduleParamDataSet set = db.ScheduleParamSet; standardEdit.Text = set.Standard; nameEdit.Text = set.Name; noSteadyEdit.EditValue = set.NoOfSteady; preparationEdit.EditValue = set.Preparation; judgementEdit.EditValue = set.Judgement; repeatEdit.EditValue = set.Repeat; chamberParams[0].Indoor1Use = set.ID1Use; chamberParams[0].Indoor1Mode1 = set.ID1Mode1; chamberParams[0].Indoor1Duct1 = set.ID1Duct1; chamberParams[0].Indoor1Mode2 = set.ID1Mode2; chamberParams[0].Indoor1Duct2 = set.ID1Duct2; id1EdbSetupEdit.EditValue = set.ID1EdbSetup; id1EdbAvgEdit.EditValue = set.ID1EdbAvg; id1EdbDevEdit.EditValue = set.ID1EdbDev; id1EwbSetupEdit.EditValue = set.ID1EwbSetup; id1EwbAvgEdit.EditValue = set.ID1EwbAvg; id1EwbDevEdit.EditValue = set.ID1EwbDev; id1Ldb1DevEdit.EditValue = set.ID1Ldb1Dev; id1Lwb1DevEdit.EditValue = set.ID1Lwb1Dev; id1Airflow1DevEdit.EditValue = set.ID1Af1Dev; id1Ldb2DevEdit.EditValue = set.ID1Ldb2Dev; id1Lwb2DevEdit.EditValue = set.ID1Lwb2Dev; id1Airflow2DevEdit.EditValue = set.ID1Af2Dev; id1Cdp1SetupEdit.EditValue = set.ID1Cdp1Setup; id1Cdp1AvgEdit.EditValue = set.ID1Cdp1Avg; id1Cdp1DevEdit.EditValue = set.ID1Cdp1Dev; id1Cdp2SetupEdit.EditValue = set.ID1Cdp2Setup; id1Cdp2AvgEdit.EditValue = set.ID1Cdp2Avg; id1Cdp2DevEdit.EditValue = set.ID1Cdp2Dev; chamberParams[0].Indoor2Use = set.ID2Use; chamberParams[0].Indoor2Mode1 = set.ID2Mode1; chamberParams[0].Indoor2Duct1 = set.ID2Duct1; chamberParams[0].Indoor2Mode2 = set.ID2Mode2; chamberParams[0].Indoor2Duct2 = set.ID2Duct2; id2EdbSetupEdit.EditValue = set.ID2EdbSetup; id2EdbAvgEdit.EditValue = set.ID2EdbAvg; id2EdbDevEdit.EditValue = set.ID2EdbDev; id2EwbSetupEdit.EditValue = set.ID2EwbSetup; id2EwbAvgEdit.EditValue = set.ID2EwbAvg; id2EwbDevEdit.EditValue = set.ID2EwbDev; id2Ldb1DevEdit.EditValue = set.ID2Ldb1Dev; id2Lwb1DevEdit.EditValue = set.ID2Lwb1Dev; id2Airflow1DevEdit.EditValue = set.ID2Af1Dev; id2Ldb2DevEdit.EditValue = set.ID2Ldb2Dev; id2Lwb2DevEdit.EditValue = set.ID2Lwb2Dev; id2Airflow2DevEdit.EditValue = set.ID2Af2Dev; id2Cdp1SetupEdit.EditValue = set.ID2Cdp1Setup; id2Cdp1AvgEdit.EditValue = set.ID2Cdp1Avg; id2Cdp1DevEdit.EditValue = set.ID2Cdp1Dev; id2Cdp2SetupEdit.EditValue = set.ID2Cdp2Setup; id2Cdp2AvgEdit.EditValue = set.ID2Cdp2Avg; id2Cdp2DevEdit.EditValue = set.ID2Cdp2Dev; chamberParams[0].OutdoorUse = set.ODUse; chamberParams[0].OutdoorDpSensor = set.ODDp; chamberParams[0].OutdoorAutoVolt = set.ODAutoVolt; odEdbSetupEdit.EditValue = set.ODEdbSetup; odEdbAvgEdit.EditValue = set.ODEdbAvg; odEdbDevEdit.EditValue = set.ODEdbDev; odEwbSetupEdit.EditValue = set.ODEwbSetup; odEwbAvgEdit.EditValue = set.ODEwbAvg; odEwbDevEdit.EditValue = set.ODEwbDev; odEdpSetupEdit.EditValue = set.ODEdpSetup; odEdpAvgEdit.EditValue = set.ODEdpAvg; odEdpDevEdit.EditValue = set.ODEdpDev; odVolt1SetupEdit.EditValue = set.ODVolt1Setup; odVolt1AvgEdit.EditValue = set.ODVolt1Avg; odVolt1DevEdit.EditValue = set.ODVolt1Dev; odVolt2SetupEdit.EditValue = set.ODVolt2Setup; odVolt2AvgEdit.EditValue = set.ODVolt2Avg; odVolt2DevEdit.EditValue = set.ODVolt2Dev; indoor1GridView.RefreshData(); indoor2GridView.RefreshData(); outdoorGridView.RefreshData(); }
private void SetSchedule(ConditionSchedule sch, ScheduleParamDataSet schSet) { sch.Standard = schSet.Standard; sch.Name = schSet.Name; sch.NoOfSteady = schSet.NoOfSteady; sch.PreRun = schSet.Preparation; sch.Judge = schSet.Judgement; sch.Repeat = schSet.Repeat; sch.Indoor1Use = schSet.ID1Use; sch.Indoor1Mode1 = schSet.ID1Mode1; sch.Indoor1Duct1 = schSet.ID1Duct1; sch.Indoor1Mode2 = schSet.ID1Mode2; sch.Indoor1Duct2 = schSet.ID1Duct2; sch.Indoor1DB = schSet.ID1EdbSetup; sch.Indoor1DBAvg = schSet.ID1EdbAvg; sch.Indoor1DBDev = schSet.ID1EdbDev; sch.Indoor1WB = schSet.ID1EwbSetup; sch.Indoor1WBAvg = schSet.ID1EwbAvg; sch.Indoor1WBDev = schSet.ID1EwbDev; sch.Indoor1LDB1Dev = schSet.ID1Ldb1Dev; sch.Indoor1LWB1Dev = schSet.ID1Lwb1Dev;; sch.Indoor1AirFlow1Dev = schSet.ID1Af1Dev; sch.Indoor1LDB2Dev = schSet.ID1Ldb2Dev; sch.Indoor1LWB2Dev = schSet.ID1Lwb2Dev;; sch.Indoor1AirFlow2Dev = schSet.ID1Af2Dev; sch.Indoor1CP1 = schSet.ID1Cdp1Setup; sch.Indoor1CP1Avg = schSet.ID1Cdp1Avg; sch.Indoor1CP1Dev = schSet.ID1Cdp1Dev; sch.Indoor1CP2 = schSet.ID1Cdp2Setup; sch.Indoor1CP2Avg = schSet.ID1Cdp2Avg; sch.Indoor1CP2Dev = schSet.ID1Cdp2Dev; sch.Indoor2Use = schSet.ID2Use; sch.Indoor2Mode1 = schSet.ID2Mode1; sch.Indoor2Duct1 = schSet.ID2Duct1; sch.Indoor2Mode2 = schSet.ID2Mode2; sch.Indoor2Duct2 = schSet.ID2Duct2; sch.Indoor2DB = schSet.ID2EdbSetup; sch.Indoor2DBAvg = schSet.ID2EdbAvg; sch.Indoor2DBDev = schSet.ID2EdbDev; sch.Indoor2WB = schSet.ID2EwbSetup; sch.Indoor2WBAvg = schSet.ID2EwbAvg; sch.Indoor2WBDev = schSet.ID2EwbDev; sch.Indoor2LDB1Dev = schSet.ID2Ldb1Dev; sch.Indoor2LWB1Dev = schSet.ID2Lwb1Dev;; sch.Indoor2AirFlow1Dev = schSet.ID2Af1Dev; sch.Indoor2LDB2Dev = schSet.ID2Ldb2Dev; sch.Indoor2LWB2Dev = schSet.ID2Lwb2Dev;; sch.Indoor2AirFlow2Dev = schSet.ID2Af2Dev; sch.Indoor2CP1 = schSet.ID2Cdp1Setup; sch.Indoor2CP1Avg = schSet.ID2Cdp1Avg; sch.Indoor2CP1Dev = schSet.ID2Cdp1Dev; sch.Indoor2CP2 = schSet.ID2Cdp2Setup; sch.Indoor2CP2Avg = schSet.ID2Cdp2Avg; sch.Indoor2CP2Dev = schSet.ID2Cdp2Dev; sch.OutdoorUse = schSet.ODUse; sch.OutdoorDpSensor = schSet.ODDp; sch.OutdoorAutoVolt = schSet.ODAutoVolt; sch.OutdoorDB = schSet.ODEdbSetup; sch.OutdoorDBAvg = schSet.ODEdbAvg; sch.OutdoorDBDev = schSet.ODEdbDev; sch.OutdoorWB = schSet.ODEwbSetup; sch.OutdoorWBAvg = schSet.ODEwbAvg; sch.OutdoorWBDev = schSet.ODEwbDev; sch.OutdoorDP = schSet.ODEdpSetup; sch.OutdoorDPAvg = schSet.ODEdpAvg; sch.OutdoorDPDev = schSet.ODEdpDev; sch.OutdoorVolt1 = schSet.ODVolt1Setup; sch.OutdoorVolt1Avg = schSet.ODVolt1Avg; sch.OutdoorVolt1Dev = schSet.ODVolt1Dev; sch.OutdoorVolt2 = schSet.ODVolt2Setup; sch.OutdoorVolt2Avg = schSet.ODVolt2Avg; sch.OutdoorVolt2Dev = schSet.ODVolt2Dev; }
private void InsertSchedule(int paramNo) { foreach (ConditionSchedule sch in Context.Condition.Schedules) { ScheduleParamDataSet schSet = Context.DB.ScheduleParamSet; schSet.RecNo = (int)Context.DB.GetGenNo("GN_SCHEDULEPARAM"); schSet.ParamNo = paramNo; schSet.Standard = sch.Standard; schSet.Name = sch.Name; schSet.NoOfSteady = sch.NoOfSteady; schSet.Preparation = sch.PreRun; schSet.Judgement = sch.Judge; schSet.Repeat = sch.Repeat; schSet.ID1Use = sch.Indoor1Use; schSet.ID1Mode1 = sch.Indoor1Mode1; schSet.ID1Duct1 = sch.Indoor1Duct1; schSet.ID1Mode2 = sch.Indoor1Mode2; schSet.ID1Duct2 = sch.Indoor1Duct2; schSet.ID1EdbSetup = sch.Indoor1DB; schSet.ID1EdbAvg = sch.Indoor1DBAvg; schSet.ID1EdbDev = sch.Indoor1DBDev; schSet.ID1EwbSetup = sch.Indoor1WB; schSet.ID1EwbAvg = sch.Indoor1WBAvg; schSet.ID1EwbDev = sch.Indoor1WBDev; schSet.ID1Ldb1Dev = sch.Indoor1LDB1Dev; schSet.ID1Lwb1Dev = sch.Indoor1LWB1Dev; schSet.ID1Af1Dev = sch.Indoor1AirFlow1Dev; schSet.ID1Ldb2Dev = sch.Indoor1LDB2Dev; schSet.ID1Lwb2Dev = sch.Indoor1LWB2Dev; schSet.ID1Af2Dev = sch.Indoor1AirFlow2Dev; schSet.ID1Cdp1Setup = sch.Indoor1CP1; schSet.ID1Cdp1Avg = sch.Indoor1CP1Avg; schSet.ID1Cdp1Dev = sch.Indoor1CP1Dev; schSet.ID1Cdp2Setup = sch.Indoor1CP2; schSet.ID1Cdp2Avg = sch.Indoor1CP2Avg; schSet.ID1Cdp2Dev = sch.Indoor1CP2Dev; schSet.ID2Use = sch.Indoor2Use; schSet.ID2Mode1 = sch.Indoor2Mode1; schSet.ID2Duct1 = sch.Indoor2Duct1; schSet.ID2Mode2 = sch.Indoor2Mode2; schSet.ID2Duct2 = sch.Indoor2Duct2; schSet.ID2EdbSetup = sch.Indoor2DB; schSet.ID2EdbAvg = sch.Indoor2DBAvg; schSet.ID2EdbDev = sch.Indoor2DBDev; schSet.ID2EwbSetup = sch.Indoor2WB; schSet.ID2EwbAvg = sch.Indoor2WBAvg; schSet.ID2EwbDev = sch.Indoor2WBDev; schSet.ID2Ldb1Dev = sch.Indoor2LDB1Dev; schSet.ID2Lwb1Dev = sch.Indoor2LWB1Dev; schSet.ID2Af1Dev = sch.Indoor2AirFlow1Dev; schSet.ID2Ldb2Dev = sch.Indoor2LDB2Dev; schSet.ID2Lwb2Dev = sch.Indoor2LWB2Dev; schSet.ID2Af2Dev = sch.Indoor2AirFlow2Dev; schSet.ID2Cdp1Setup = sch.Indoor2CP1; schSet.ID2Cdp1Avg = sch.Indoor2CP1Avg; schSet.ID2Cdp1Dev = sch.Indoor2CP1Dev; schSet.ID2Cdp2Setup = sch.Indoor2CP2; schSet.ID2Cdp2Avg = sch.Indoor2CP2Avg; schSet.ID2Cdp2Dev = sch.Indoor2CP2Dev; schSet.ODUse = sch.OutdoorUse; schSet.ODDp = sch.OutdoorDpSensor; schSet.ODAutoVolt = sch.OutdoorAutoVolt; schSet.ODEdbSetup = sch.OutdoorDB; schSet.ODEdbAvg = sch.OutdoorDBAvg; schSet.ODEdbDev = sch.OutdoorDBDev; schSet.ODEwbSetup = sch.OutdoorWB; schSet.ODEwbAvg = sch.OutdoorWBAvg; schSet.ODEwbDev = sch.OutdoorWBDev; schSet.ODEdpSetup = sch.OutdoorDP; schSet.ODEdpAvg = sch.OutdoorDPAvg; schSet.ODEdpDev = sch.OutdoorDPDev; schSet.ODVolt1Setup = sch.OutdoorVolt1; schSet.ODVolt1Avg = sch.OutdoorVolt1Avg; schSet.ODVolt1Dev = sch.OutdoorVolt1Dev; schSet.ODVolt2Setup = sch.OutdoorVolt2; schSet.ODVolt2Avg = sch.OutdoorVolt2Avg; schSet.ODVolt2Dev = sch.OutdoorVolt2Dev; schSet.Insert(Context.DB.Trans); } }