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();
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
 public bool DeleteFacility(FACILITY facility)
 {
     try
     {
         db.Entry(facility).State = System.Data.Entity.EntityState.Deleted;
         db.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Exemplo n.º 4
0
 public bool PostFacility(FACILITY facility)
 {
     try
     {
         db.FACILITY.Add(facility);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Exemplo n.º 5
0
        public bool DeleteFacility(FACILITY facility)
        {
            var isDeleted = sportsSideService.DeleteFacility(facility);

            if (isDeleted)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 6
0
        public bool PutFacility(FACILITY facility)
        {
            var isUpdated = sportsSideService.PutFacility(facility);

            if (isUpdated)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
        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);
        }
Exemplo n.º 9
0
 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;
 }
Exemplo n.º 10
0
 public Syslog(FACILITY _facility, SEVERITY _severity)
 {
     init(_facility, _severity);
 }
Exemplo n.º 11
0
 public void delete(FACILITY obj)
 {
     DAL.delete(obj.FacilityID);
 }
Exemplo n.º 12
0
 public void edit(FACILITY obj)
 {
     DAL.edit(obj.FacilityID, obj.SiteID, obj.FacilityName, (float)obj.ManagementFactor);
 }
Exemplo n.º 13
0
 public void add(FACILITY obj)
 {
     DAL.add(obj.SiteID, obj.FacilityName, obj.ManagementFactor);
 }
Exemplo n.º 14
0
 public static HRESULT Make(bool severe, FACILITY facility, int code)
 {
     return(new HRESULT((severe ? int.MinValue : 0) | ((int)facility << 16) | code));
 }