protected Target GetTargetObjectBasedOnUI() // Do not get the Target object (except for the TargetFormFields) from the database. { Target target = new Target(); target.TargetID = GetTargetIDBasedOnUI(); target.AccountID = Convert.ToUInt32(tbAccountID.Text); target.Enabled = cbEnabled.Checked; target.Name = tbName.Text; target.URL = tbURL.Text; target.MonitorIntervalAsInt = Convert.ToInt32(tbMonitorInterval.Text); //target.LastMonitoredAt = ; MonitorTypeCollectionMember mtcm = MonitorTypeCollection.FindUsingUIString(ddlMonitorType.SelectedValue); if (mtcm != null) { target.MonitorType = mtcm.MonitorType; } else { target.MonitorType = Target.DefaultMonitorType; } target.LastTargetLogID = Convert.ToUInt32(tbLastTargetLogID.Text); //target.TargetAddedAt = ; //target.LastFailedAt = ; MySqlConnection con = GetMySqlConnection(); target.FinishConstruction(con); return(target); }
protected void SetMonitorTypeDDL(MonitorType mt) { MonitorTypeCollectionMember mtcm = MonitorTypeCollection.FindUsingMonitorType(mt); ddlMonitorType.SelectedValue = mtcm.UIString; }