コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int        serialNum = Program.TechnicalFailures.Count() + 1;
            SqlCommand s         = new SqlCommand();

            s.CommandText = "EXECUTE [dbo].[SP_create_technical_call] @term_no, @term_dt, @term_roomId, @term_employeeId, @term_description";
            s.Parameters.AddWithValue("@term_no", serialNum);
            s.Parameters.AddWithValue("@term_dt", DateTime.Parse(dateTimePicker1.Value.ToShortDateString()));
            s.Parameters.AddWithValue("@term_roomId ", comboBox1.Text.ToString());
            s.Parameters.AddWithValue("@term_employeeId ", EmployeeId);
            s.Parameters.AddWithValue("@term_description ", richTextBox1.Text.ToString());

            SQL_CON SC = new SQL_CON();

            SC.execute_non_query(s);
            Program.init_TechnicalFailures();

            /* int serial = Program.TechnicalFailures.Count;
             * DateTime dt = dateTimePicker1.Value.Date;
             * ActivityRoom acr = Program.searchActivityRoom(int.Parse(comboBox1.ValueMember.ToString()));
             * Employee emp = Program.searchEmployee(int.Parse(comboBox2.ValueMember.ToString()));
             * string stri = richTextBox1.Text.ToString();
             * TechnicalFailure tf = new TechnicalFailure(serial, dt, acr, emp, stri);
             * Program.TechnicalFailures.Add(tf); */
        }
コード例 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            int        serialNum = Program.Activities.Count() + 1;
            SqlCommand c         = new SqlCommand();

            c.CommandText = "EXECUTE dbo.SP_Update_activities @term_no,  @term_age, @term_activity, @term_needChair, @term_needtable, @term_needComputer, @term_needBoard, @term_startActivity, @term_endActivity, @term_numOfParticipants, @term_embedCounselor, @term_embedRoom";
            c.Parameters.AddWithValue("@term_no", serialNum);
            c.Parameters.AddWithValue("@term_age", int.Parse((textBox2.Text.ToString())));
            c.Parameters.AddWithValue("@term_activity", comboBox1.Text.ToString());

            c.Parameters.AddWithValue("@term_needChair", chairValue);
            c.Parameters.AddWithValue("@term_needtable", tableValue);
            c.Parameters.AddWithValue("@term_needComputer", computerValue);
            c.Parameters.AddWithValue("@term_needBoard", boardValue);

            c.Parameters.AddWithValue("@term_startActivity", DateTime.Parse(dateTimePicker2.Value.ToShortDateString()));
            c.Parameters.AddWithValue("@term_endActivity", DateTime.Parse(dateTimePicker1.Value.ToShortDateString()));
            c.Parameters.AddWithValue("@term_numOfParticipants", int.Parse(textBox9.Text.ToString()));
            c.Parameters.AddWithValue("@term_embedCounselor", 0);
            c.Parameters.AddWithValue("@term_embedRoom", 0);


            SQL_CON SC = new SQL_CON();

            SC.execute_non_query(c);
            Program.init_Activities();
            Menu mn = new Menu();

            this.Hide();
            mn.Show();
        }
コード例 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            {
                int        serialNum = Program.Activities.Count + 1;
                SqlCommand s         = new SqlCommand();
                s.CommandText = "EXECUTE dbo.SP_Update_materialPerActivity @term_no	, @term_serialNumber, @term_quantity, @term_id";
                s.Parameters.AddWithValue("@term_no", activityNum);
                s.Parameters.AddWithValue("@term_serialNumber", material2.getSerialNumber());
                s.Parameters.AddWithValue("@term_quantity", int.Parse(textBox1.Text.ToString()));
                s.Parameters.AddWithValue("@term_id", i + 20);
                i = i + 20;

                SQL_CON SC = new SQL_CON();
                SC.execute_non_query(s);
                CounselorMenu mn = new CounselorMenu();
                this.Hide();
                mn.Show();
            }
        }
コード例 #4
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            int        serialNum = Program.EmbedEmployeesToActivities.Count() + 6;
            SqlCommand s         = new SqlCommand();

            s.CommandText = "EXECUTE [dbo].[SP_Update_embed_employee_to_activities] @term_embedId, @term_no, @term_employeeId";
            s.Parameters.AddWithValue("@term_embedId", serialNum);
            s.Parameters.AddWithValue("@term_no", activityNum);
            s.Parameters.AddWithValue("@term_employeeId", comboBox2.Text.ToString());

            SQL_CON SC = new SQL_CON();

            SC.execute_non_query(s);
            Program.init_EmbedEmployeesToActivities();
            Menu mn = new Menu();

            this.Hide();
            mn.Show();
        }
コード例 #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            int        serialNum = Program.TechnicalFailures.Count() + 1;
            SqlCommand s         = new SqlCommand();

            s.CommandText = "EXECUTE [dbo].[SP_create_technical_call] @term_no, @term_dt, @term_roomId, @term_employeeId, @term_description";
            s.Parameters.AddWithValue("@term_no", serialNum);
            s.Parameters.AddWithValue("@term_dt", DateTime.Parse(dateTimePicker1.Value.ToShortDateString()));
            s.Parameters.AddWithValue("@term_roomId ", comboBox1.Text.ToString());
            s.Parameters.AddWithValue("@term_employeeId ", EmployeeId);
            s.Parameters.AddWithValue("@term_description ", richTextBox1.Text.ToString());

            SQL_CON SC = new SQL_CON();

            SC.execute_non_query(s);
            Program.init_TechnicalFailures();
            CounselorMenu mn = new CounselorMenu();

            this.Hide();
            mn.Show();
        }