public void setData2From(int ID) { FACILITY f = facility.getFacility(ID); txtFacilityName.Text = f.FacilityName; listSite = siteBus.getData(); cbSites.Properties.Items.Add("", -1, -1); for (int i = 0; i < listSite.Count; i++) { cbSites.Properties.Items.Add(listSite[i].SiteName, i, i); if (listSite[i].SiteID == f.SiteID) { cbSites.SelectedIndex = i + 1; } } cbSites.Enabled = false; numManagementSystem.Value = f.ManagementFactor > 10 ? 10 : (decimal)f.ManagementFactor; FACILITY_RISK_TARGET f_Target = facilityRisk.getFacilityRiskTarget(ID); txtArea.Text = f_Target.RiskTarget_CA.ToString(); txtFinancial.Text = f_Target.RiskTarget_FC.ToString(); txtA.Text = f_Target.RiskTarget_A.ToString(); txtB.Text = f_Target.RiskTarget_B.ToString(); txtC.Text = f_Target.RiskTarget_C.ToString(); txtD.Text = f_Target.RiskTarget_D.ToString(); txtE.Text = f_Target.RiskTarget_E.ToString(); }
public override bool Equals(object obj) { var hIVTEST = obj as HIVTEST; return(hIVTEST != null && DATE.IsSameAs(hIVTEST.DATE) && RESULT.IsSameAs(hIVTEST.RESULT) && TYPE.IsSameAs(hIVTEST.TYPE) && FACILITY.IsSameAs(hIVTEST.FACILITY) && STRATEGY.IsSameAs(hIVTEST.STRATEGY)); }
public bool DeleteFacility(FACILITY facility) { try { db.Entry(facility).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); return(true); } catch (Exception ex) { return(false); } }
public bool PostFacility(FACILITY facility) { try { db.FACILITY.Add(facility); db.SaveChanges(); return(true); } catch (Exception e) { return(false); } }
public bool DeleteFacility(FACILITY facility) { var isDeleted = sportsSideService.DeleteFacility(facility); if (isDeleted) { return(true); } else { return(false); } }
public bool PutFacility(FACILITY facility) { var isUpdated = sportsSideService.PutFacility(facility); if (isUpdated) { return(true); } else { return(false); } }
public List <FACILITY> getDataSource() { List <FACILITY> list = new List <FACILITY>(); FACILITY obj = null; SqlConnection conn = MSSQLDBUtils.GetDBConnection(); conn.Open(); String sql = "USE[rbi]" + "SELECT [FacilityID]" + ",[SiteID]" + ",[FacilityName]" + ",[ManagementFactor]" + " FROM [rbi].[dbo].[FACILITY]"; try { SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandText = sql; using (DbDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { if (reader.HasRows) { obj = new FACILITY(); obj.FacilityID = reader.GetInt32(0); if (!reader.IsDBNull(1)) { obj.SiteID = reader.GetInt32(1); } obj.FacilityName = reader.GetString(2); obj.ManagementFactor = (float)reader.GetDouble(3); list.Add(obj); } } } } catch { MessageBox.Show("GET DATA SOURCE FAIL!"); } finally { conn.Close(); conn.Dispose(); } return(list); }
public FACILITY getFacilityName() { FACILITY faci = new FACILITY(); foreach (SITES s in listSite) { if (s.SiteName == cbSites.Text) { faci.SiteID = s.SiteID; } } faci.FacilityName = txtFacilityName.Text; faci.ManagementFactor = float.Parse(numManagementSystem.Value.ToString()); return(faci); }
private void init(FACILITY _f, SEVERITY _s) { Month[1] = "Jan "; Month[2] = "Feb "; Month[3] = "Mar "; Month[4] = "Apr "; Month[5] = "May "; Month[6] = "Jun "; Month[7] = "Jul "; Month[8] = "Aug "; Month[9] = "Sep "; Month[10] = "Oct "; Month[11] = "Nov "; Month[12] = "Dec "; port = 514; server = ""; facility = _f; severity = _s; }
public Syslog(FACILITY _facility, SEVERITY _severity) { init(_facility, _severity); }
public void delete(FACILITY obj) { DAL.delete(obj.FacilityID); }
public void edit(FACILITY obj) { DAL.edit(obj.FacilityID, obj.SiteID, obj.FacilityName, (float)obj.ManagementFactor); }
public void add(FACILITY obj) { DAL.add(obj.SiteID, obj.FacilityName, obj.ManagementFactor); }
public static HRESULT Make(bool severe, FACILITY facility, int code) { return(new HRESULT((severe ? int.MinValue : 0) | ((int)facility << 16) | code)); }