Ejemplo n.º 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); */
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 3
0
 public static void init_Materials()
 {
     SqlCommand c = new SqlCommand();
     c.CommandText = "EXECUTE dbo.Get_all_materials";
     SQL_CON SC = new SQL_CON();
     SqlDataReader rdr = SC.execute_query(c);
     Materials = new List<Material>();
     while (rdr.Read())
     {
         Material m = new ActivityRoom(int.Parse(rdr.GetValue(0).ToString()), rdr.GetValue(1).ToString());
         Materials.Add(m);
     }
 }
Ejemplo n.º 4
0
 public static void init_Activities()
 {
     SqlCommand c = new SqlCommand();
     c.CommandText = "EXECUTE dbo.Get_all_activities";
     SQL_CON SC = new SQL_CON();
     SqlDataReader rdr = SC.execute_query(c);
     Activities = new List<Activity>();
     while (rdr.Read())
     {
         Activity a = new ActivityRoom(int.Parse(rdr.GetValue(0).ToString()), rdr.GetValue(1).ToString(), int.Parse(rdr.GetValue(2).ToString()), int.Parse(rdr.GetValue(3).ToString()), rdr.GetValue(4).ToString());
         Activities.Add(a);
     }
 }
Ejemplo n.º 5
0
 public static void init_TechnicalFailures()
 {
     SqlCommand c = new SqlCommand();
     c.CommandText = "EXECUTE dbo.Get_all_technicalFailure";
     SQL_CON SC = new SQL_CON();
     SqlDataReader rdr = SC.execute_query(c);
     TechnicalFailures = new List<TechnicalFailure>();
     while (rdr.Read())
     {
         TechnicalFailure tf = new ActivityRoom(int.Parse(rdr.GetValue(0).ToString()), DateTime.Parse((rdr.GetValue(1).ToString())), DateTime.Parse((rdr.GetValue(2).ToString())), int.Parse(rdr.GetValue(3).ToString());
         TechnicalFailures.Add(tf);
     }
 }
Ejemplo n.º 6
0
 public static void init_Employees()//מילוי המערך מתוך בסיס הנתונים
 {
     SqlCommand c = new SqlCommand();
     c.CommandText = "EXECUTE dbo.Get_all_employees";
     SQL_CON SC = new SQL_CON();
     SqlDataReader rdr = SC.execute_query(c);
     Employees = new List<Employee>();
     while (rdr.Read())
     {
         Employee e = new Employee(rdr.GetValue(0).ToString(), rdr.GetValue(1).ToString(), rdr.GetValue(2).ToString(), rdr.GetValue(3).ToString(), rdr.GetValue(4).ToString(), int.Parse(rdr.GetValue(5).ToString()));
         Employees.Add(e);
     }
 }
Ejemplo n.º 7
0
 public static void init_EmbedEmployeesToActivities()
 {
     SqlCommand c = new SqlCommand();
     c.CommandText = "EXECUTE dbo.Get_all_embedEmployeesToActivities";
     SQL_CON SC = new SQL_CON();
     SqlDataReader rdr = SC.execute_query(c);
     EmbedEmployeesToActivities = new List<EmbedEmployeeToActivity>();
     while (rdr.Read())
     {
         EmbedEmployeeToActivity eetar = new ActivityRoom(int.Parse(rdr.GetValue(0).ToString()), DateTime.Parse((rdr.GetValue(1).ToString())), DateTime.Parse((rdr.GetValue(2).ToString())), int.Parse(rdr.GetValue(3).ToString()), int.Parse(rdr.GetValue(4).ToString()));
         EmbedEmployeesToActivities.Add(eetar);
     }
 }
Ejemplo n.º 8
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();
            }
        }
Ejemplo n.º 9
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();
        }
Ejemplo n.º 10
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();
        }