private void button2_Click(object sender, EventArgs e) { try { t1 = textBox2.Text; t2 = textBox1.Text; الصفحه_الرئيسيه_للمنظار f = new الصفحه_الرئيسيه_للمنظار(); con1.OpenConection(); //create procedure update_time(@s nvarchar(50),@end nvarchar(50) ,@d nvarchar(50),@ss nvarchar(50),@n nvarchar(50)) // as // update setescope_operation set start_time=@s,end_time=@end where Datee=@d and start_time=@ss and EndoscopeCode // in(select EndoscopeCode from Endoscope_settings_data where EndoscopeName=@n ); //cmd = new SqlCommand("update_time", con); //cmd.CommandType = CommandType.StoredProcedure; //cmd.Parameters.AddWithValue("@end", t2); //cmd.Parameters.AddWithValue("@d", الصفحه_الرئيسيه_للمنظار.d); //cmd.Parameters.AddWithValue("@s", t1); //cmd.Parameters.AddWithValue("@ss", الصفحه_الرئيسيه_للمنظار.start); //cmd.Parameters.AddWithValue("@n", الصفحه_الرئيسيه_للمنظار.endo); //cmd.ExecuteNonQuery(); types = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar }; name_input = new string[] { "@end", "@d", "@s", "@ss", "@n" }; values = new string[] { t2, الصفحه_الرئيسيه_للمنظار.d, t1, الصفحه_الرئيسيه_للمنظار.start, الصفحه_الرئيسيه_للمنظار.endo }; con1.ExecuteNonQueryProcedure("update_time", name_input, values, types); الصفحه_الرئيسيه_للمنظار ff6 = new الصفحه_الرئيسيه_للمنظار(); ff6.Focus(); this.DialogResult = DialogResult.OK; ff6.Focus(); } catch (Exception v) { MessageBox.Show(v.Message); } finally { con1.CloseConnection(); } }
private void button1_Click_1(object sender, EventArgs e) { try { end = textBox2.Text; con1.OpenConection(); //create procedure setescope_flag_finish(@end nvarchar(50),@d nvarchar(50),@s nvarchar(50),@id int) //as //update setescope_operation set flag='finish',end_time=@end where Datee =@d and start_time=@s and id=@id types = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.Int }; name_input = new string[] { "@end", "@d", "@s", "@id" }; values = new string[] { end, الصفحه_الرئيسيه_للمنظار.d, الصفحه_الرئيسيه_للمنظار.start, الصفحه_الرئيسيه_للمنظار.opid }; con1.ExecuteNonQueryProcedure("setescope_flag_finish", name_input, values, types); الصفحه_الرئيسيه_للمنظار.flag = "finish"; الصفحه_الرئيسيه_للمنظار ff6 = new الصفحه_الرئيسيه_للمنظار(); ff6.Focus(); this.DialogResult = DialogResult.OK; ff6.Focus(); } catch (Exception v) { MessageBox.Show(v.Message); } finally { con1.CloseConnection(); } }