Exemplo n.º 1
0
    public static string cancel_app1(appointment_mg name)
    {
        string query = string.Format("select app_id from appointment inner join employee_doctor on employee_doctor.emp_doc_id = appointment.emp_doc_id where employee_doctor.emp_doc_name = '{0}'", name.emp_doc_name);

        try
        {
            conn.Open();
            command.CommandText = query;
            // string app_id = command.ExecuteScalar().ToString();

            int app_id = (int)command.ExecuteScalar();


            query = String.Format("Update appointment set status_approve = 0,status_app = 0 where app_id = {0}", app_id);
            //  conn.Open();
            command.CommandText = query;
            command.ExecuteNonQuery();
            return("อัพเดตข้อมูลเรียบร้อย");
        }
        finally
        {
            conn.Close();
        }
        //   return null;
    }
Exemplo n.º 2
0
 public static string cancel_app(appointment_mg app)
 {
     try
     {
         string query = String.Format("Update appointment set status_approve = 0,status_app = 0 where app_id = {0}", app.app_id);
         conn.Open();
         command.CommandText = query;
         command.ExecuteNonQuery();
         return("อัพเดตข้อมูลเรียบร้อย");
     }
     finally
     {
         conn.Close();
     }
 }