コード例 #1
0
        private void Edit_data_Click(object sender, EventArgs e)
        {
            editData ob = new editData();

            ob.Show();
            this.Hide();
        }
コード例 #2
0
        private void Edit_Click(object sender, EventArgs e)
        {
            connection sv = new connection();

            sv.thisConnection.Open();
            OracleCommand thisCommand1 = sv.thisConnection.CreateCommand();

            thisCommand1.CommandText =
                "update HOSPITAL_LOGIN set username= '******', " +
                "designation='" + position.Text + "' where id= '" + em_id.Text + "'";

            thisCommand1.Connection  = sv.thisConnection;
            thisCommand1.CommandType = CommandType.Text;

            OracleCommand thisCommand2 = sv.thisConnection.CreateCommand();

            thisCommand2.CommandText =
                "update salary_account set name= '" + em_name.Text + "', salary='" + salaryBox.Text + "', " +
                "position='" + position.Text + "',accountid='" + acId.Text + "', duty_time= '" + DutyTime.Text + "' where id= '" + em_id.Text + "'";

            thisCommand2.Connection  = sv.thisConnection;
            thisCommand2.CommandType = CommandType.Text;

            OracleCommand thisCommand3 = sv.thisConnection.CreateCommand();

            thisCommand3.CommandText =
                "update doctor_data set doc_name= '" + em_name.Text + "', ward_no= '" + ward_no.Text + "', department = '" + depart.Text + "', " +
                "designation='" + Designation.Text + "', duty_time = '" + DutyTime.Text + "', appointment_time = '" + appt.Text + "' where doc_id= '" + em_id.Text + "'";

            thisCommand3.Connection  = sv.thisConnection;
            thisCommand3.CommandType = CommandType.Text;


            try
            {
                thisCommand1.ExecuteNonQuery();
                thisCommand2.ExecuteNonQuery();
                thisCommand3.ExecuteNonQuery();
                MessageBox.Show("Updated");
                this.Hide();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }


            sv.thisConnection.Close();
            this.Hide();
            editData ob = new editData();

            ob.Show();
        }