Esempio n. 1
0
        // management plan
        public void Insert(ManagementPlan planObj)
        {
            string sqlStr = string.Format("Insert Into ManagementPlan (MP_Name, MP_Company, MP_Address) Values" +
                                          "('{0}', '{1}', '{2}')",
                                          planObj.Name, planObj.Company, planObj.Address);

            using (SqlCommand cmd = new SqlCommand(sqlStr, SqlCn))
            {
                try
                {
                    cmd.ExecuteNonQuery();
                }
                catch (SqlException ex)
                {
                    Exception error = new Exception("Couldn't insert the Management Plan! " + ex.Message, ex);
                    throw error;
                }
            }
        }
Esempio n. 2
0
        public void Update(ManagementPlan planObj, int id)
        {
            string sqlStr =
                string.Format(
                    "Update ManagementPlan Set MP_Name = '{0}', MP_Company = '{1}', MP_Address = '{2}' Where MP_ID = '{3}'",
                    planObj.Name, planObj.Company, planObj.Address, id);

            using (SqlCommand cmd = new SqlCommand(sqlStr, this.SqlCn))
            {
                try
                {
                    cmd.ExecuteNonQuery();
                }
                catch (SqlException ex)
                {
                    Exception error = new Exception("Couldn't update the Management Plan! " + ex.Message, ex);
                    throw error;
                }
            }
        }
Esempio n. 3
0
 public void Update(ManagementPlan planObj, int id)
 {
     string sqlStr =
        string.Format(
        "Update ManagementPlan Set MP_Name = '{0}', MP_Company = '{1}', MP_Address = '{2}' Where MP_ID = '{3}'",
        planObj.Name, planObj.Company, planObj.Address, id);
     using (SqlCommand cmd = new SqlCommand(sqlStr, this.SqlCn))
     {
         try
         {
             cmd.ExecuteNonQuery();
         }
         catch (SqlException ex)
         {
             Exception error = new Exception("Couldn't update the Management Plan! " + ex.Message, ex);
             throw error;
         }
     }
 }
Esempio n. 4
0
 // management plan
 public void Insert(ManagementPlan planObj)
 {
     string sqlStr = string.Format("Insert Into ManagementPlan (MP_Name, MP_Company, MP_Address) Values" +
                                  "('{0}', '{1}', '{2}')",
                                  planObj.Name, planObj.Company, planObj.Address);
     using (SqlCommand cmd = new SqlCommand(sqlStr, SqlCn))
     {
         try
         {
             cmd.ExecuteNonQuery();
         }
         catch (SqlException ex)
         {
             Exception error = new Exception("Couldn't insert the Management Plan! " + ex.Message, ex);
             throw error;
         }
     }
 }