Beispiel #1
0
        public void Update_Risk(Risk myRisk)  // my update method
        {
            Risk_RiskDB   da   = new Risk_RiskDB();
            SqlConnection conn = Connection.GetConnection();
            SqlCommand    cmd  = new SqlCommand("spUpdateRisk", conn);

            cmd.CommandType = CommandType.StoredProcedure;


            cmd.Parameters.AddWithValue("@status_id", myRisk.Status_id); // first is table name and second is my variable
            cmd.Parameters.AddWithValue("@closing_date", myRisk.Closing_date);
            cmd.Parameters.AddWithValue("@value", myRisk.risk_orginal_id);
            cmd.Parameters.AddWithValue("@description", myRisk.Description);
            cmd.Parameters.AddWithValue("@mitigation", myRisk.Mitigation);
            cmd.Parameters.AddWithValue("@user_id", myRisk.User_id);
            cmd.Parameters.AddWithValue("@sch_likelihood", myRisk.Sch_likelihood);
            cmd.Parameters.AddWithValue("@sch_impact", myRisk.Sch_impact);
            cmd.Parameters.AddWithValue("@cost_likelihood", myRisk.Cost_likelihood);
            cmd.Parameters.AddWithValue("@cost_impact", myRisk.Cost_impact);
            cmd.Parameters.AddWithValue("@qty_likelihood", myRisk.Qty_likelihood);
            cmd.Parameters.AddWithValue("@qty_impact", myRisk.Qty_impact);
            cmd.Parameters.AddWithValue("@comment", myRisk.Comment);
            cmd.Parameters.AddWithValue("@userClient", myRisk.UserClient);
            cmd.Parameters.AddWithValue("@priority_id", myRisk.Priority_id);
            cmd.Parameters.AddWithValue("@response_id", myRisk.Response_id);
            cmd.Parameters.AddWithValue("@risk_orginal_id", myRisk.risk_orginal_id);
            cmd.Parameters.AddWithValue("@calculate", myRisk.Calculate);


            try
            {
                conn.Open();
                cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                conn.Close();
            }
        }
Beispiel #2
0
        public void Update_Query(Risk myRisk)
        {
            Risk_RiskDB rb = new Risk_RiskDB();

            rb.Update_Risk(myRisk);
        }
Beispiel #3
0
        public void Insert_Query(Risk myRisk)
        {
            Risk_RiskDB rb = new Risk_RiskDB();

            rb.Insert_Risk(myRisk);
        }