private void RequestDetails_Load(object sender, EventArgs e)
        {
            // TODO: Ten wiersz kodu wczytuje dane do tabeli 'rSSDataSet.ACTIVITY' . Możesz go przenieść lub usunąć.
            //this.aCTIVITYTableAdapter.Fill(this.rSSDataSet.ACTIVITY);
            var dataSource = new List <string>();

            if (_status == "ACT")
            {
                dataSource.Add("ACT");
                dataSource.Add("CAN");
                dataSource.Add("EXP");
            }

            else if (_status == "CAN")
            {
                dataSource.Add("CAN");
                dataSource.Add("ACT");
                dataSource.Add("EXP");
            }

            else
            {
                dataSource.Add("EXP");
                dataSource.Add("ACT");
                dataSource.Add("CAN");
            }


            comboBox1.DataSource = dataSource;


            var result = SQLmanager.SearchActivity(this.textBox1.Text.ToString());

            dataGridView1.DataSource = result;
        }
Пример #2
0
        private void AddVehicle_Load(object sender, EventArgs e)
        {
            // TODO: Ten wiersz kodu wczytuje dane do tabeli 'rSSDataSet.OBJECT' . Możesz go przenieść lub usunąć.
            //this.oBJECTTableAdapter.Fill(this.rSSDataSet.OBJECT);

            // TODO: Ten wiersz kodu wczytuje dane do tabeli 'rSSDataSet.OBJ_TYPE' . Możesz go przenieść lub usunąć.
            //this.oBJ_TYPETableAdapter.Fill(this.rSSDataSet.OBJ_TYPE);
            if (_ifRequest == true)
            {
                var result0 = Baza.SQLmanager.SearchCustomers(_id);
                dataGridView1.DataSource = result0;
            }
            else
            {
                var result0 = Baza.SQLmanager.SearchCustomers("", "", "");
                dataGridView1.DataSource = result0;
            }


            var types = SQLmanager.GetAllObjectTypes().ToList();

            comboBox1.DataSource = types;

            var clients = SQLmanager.GetAllClients().ToList();
            //comboBox2.DataSource = clients;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            var nr_object = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();

            //var obj = SQLmanager.GetSingleObjectFull(nr_object);

            VehicleDetails a1 = new VehicleDetails();

            a1.textBox6.Text  = this.dataGridView1.CurrentRow.Cells[0].Value.ToString(); //reg
            a1.textBox10.Text = this.dataGridView1.CurrentRow.Cells[1].Value.ToString(); //name
            a1.textBox9.Text  = this.dataGridView1.CurrentRow.Cells[3].Value.ToString(); //obj type


            var client = SQLmanager.SearchCustomerFromID(this.dataGridView1.CurrentRow.Cells[2].Value.ToString()); //client id

            a1.textBox5.Text = client.First().id_client.ToString();                                                //client id
            a1.textBox1.Text = client.First().first_name;                                                          //fname
            a1.textBox2.Text = client.First().last_name;                                                           //lname
            a1.textBox3.Text = client.First().name;;                                                               //name
            a1.textBox4.Text = client.First().tel;;                                                                //tel

            var obj_type = SQLmanager.SearchObjType(this.dataGridView1.CurrentRow.Cells[3].Value.ToString());

            a1.textBox8.Text = obj_type.First().name; //obj_type name

            a1.ShowDialog();
        }
Пример #4
0
 public void initial()
 {
     market   = new RequestManager();
     rq       = new RequestAgent();
     userInfo = (MarketUserData)market.SendQueryUserRequest();
     sql      = new SQLmanager();
     ama      = new AutonomousMarketAgent();
 }
 public AutonomousMarketAgent()//This function responsible on the timer, to restart him and call the necessary function
 {
     aTimer           = new Timer();
     myManager        = new SQLmanager();
     aTimer.Interval  = 10000;
     aTimer.Elapsed  += new ElapsedEventHandler(OnTimedEvent);
     aTimer.AutoReset = true;
 }
Пример #6
0
        //private void button3_Click(object sender, EventArgs e)
        //{
        //    AddVehicle a1 = new AddVehicle();
        //    a1.ShowDialog();
        //}

        private void ShowCustomerDetails_Load(object sender, EventArgs e)
        {
            // TODO: Ten wiersz kodu wczytuje dane do tabeli 'rSSDataSet.OBJECT' . Możesz go przenieść lub usunąć.
            //this.oBJECTTableAdapter.Fill(this.rSSDataSet.OBJECT);
            var result = SQLmanager.SearchObjects2(this.textBox5.Text.ToString());

            dataGridView1.DataSource = result;
        }
        private void addButton1_Click(object sender, EventArgs e)
        {
            AddVehicle a1 = new AddVehicle(false, 0);

            a1.ShowDialog();
            var result = SQLmanager.SearchObjects("", "", "");

            dataGridView1.DataSource = result;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            var    act  = SQLmanager.SearchActivityDictionary(textBox2.Text);
            string act_ = act.First().ToString();

            Baza.SQLmanager.UpdateActivity(_id_act, _seqNumber, richTextBox1.Text, comboBox2.SelectedItem.ToString(), comboBox1.Text, dateTimePicker2.Value, dateTimePicker1.Value, act_);
            MessageBox.Show("The activity has been updated");

            this.Close();
        }
        private void addButton1_Click(object sender, EventArgs e)
        {
            AddCustomer a1 = new AddCustomer();

            a1.ShowDialog();
            UsersDataLoad();

            var result = SQLmanager.SearchCustomers("", "", "");

            dataGridView1.DataSource = result;
        }
        //public string _actDic;
        public Activity(int act_id, int req_id, int seqNumber, string actDic, string desc, string status, DateTime dreg, DateTime dfc)
        {
            InitializeComponent();
            _id_act    = act_id;
            _id_req    = req_id;
            _seqNumber = seqNumber;
            //_actDic = actDic;
            textBox3.Text    = _id_act.ToString();
            textBox3.Enabled = false;
            textBox1.Text    = _id_req.ToString();
            textBox1.Enabled = false;
            textBox5.Text    = _seqNumber.ToString();
            textBox5.Enabled = false;

            var act_type = SQLmanager.SearchActivityDictionaryType(actDic);

            textBox2.Text = act_type.First().ToString();
            //textBox4.Text = result;
            richTextBox1.Text     = desc;
            dateTimePicker1.Value = dfc;  //data fin/can
            dateTimePicker2.Value = dreg; //data rejestracji

            //comboBox1.DataSource = Baza.SQLmanager.GetAvailableActivity().ToList();
            comboBox2.DataSource = Baza.SQLmanager.GetAvailableWorkers().ToList();


            var dataSource = new List <string>();

            if (status == "ACT")
            {
                dataSource.Add("ACT");
                dataSource.Add("CAN");
                dataSource.Add("EXP");
            }
            else if (status == "CAN")
            {
                dataSource.Add("CAN");
                dataSource.Add("ACT");
                dataSource.Add("EXP");
            }
            else
            {
                dataSource.Add("EXP");
                dataSource.Add("ACT");
                dataSource.Add("CAN");
            }

            comboBox1.DataSource = dataSource;
        }
Пример #11
0
        private void button1_Click(object sender, EventArgs e)
        {
            //int.TryParse(comboBox2.SelectedValue.ToString(), out int id_client);
            //SQLmanager.AddVehicle(textBox1.Text,textBox2.Text, comboBox1.SelectedValue.ToString(), id_client);

            Int32  id    = Int32.Parse(this.dataGridView1.CurrentRow.Cells[0].Value.ToString());
            string reg   = this.textBox1.Text;
            string model = this.textBox2.Text;

            var    type  = SQLmanager.SearchObjectTypeFromName(this.comboBox1.Text);
            string type_ = type.First().ToString();

            SQLmanager.AddVehicle(reg, model, type_, id);
            //MessageBox.Show("The vehicle has been added to database");
            this.Close();
            MessageBox.Show("The vehicle has been added to database");
        }
        private void searchBox_Click(object sender, EventArgs e)
        {
            string d;

            if (dateTimePicker2.Checked == true)
            {
                d = dateTimePicker2.Text.ToString();
            }
            else
            {
                d = "";
            }

            var request = SQLmanager.SearchRequests(comboBox1.Text.ToString(), d, objectBox.Text.ToString());

            dataGridView1.DataSource = request;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (this.dataGridView1.CurrentRow == null)
            {
                MessageBox.Show("The chosen activity does not exist, please create new avtivity or choose another");

                var result1 = SQLmanager.SearchActivity(this.textBox1.Text.ToString());
                dataGridView1.DataSource = result1;
            }
            else if (this.dataGridView1.CurrentRow.Cells[4].Value.ToString() == null && this.dataGridView1.CurrentRow.Cells[5].Value.ToString() == null)
            {
                Activity a1 = new Activity(Int32.Parse(this.dataGridView1.CurrentRow.Cells[0].Value.ToString()), Int32.Parse(this.dataGridView1.CurrentRow.Cells[6].Value.ToString()),
                                           Int32.Parse(this.dataGridView1.CurrentRow.Cells[9].Value.ToString()), this.dataGridView1.CurrentRow.Cells[8].Value.ToString(), this.dataGridView1.CurrentRow.Cells[1].Value.ToString(), this.dataGridView1.CurrentRow.Cells[3].Value.ToString(),
                                           DateTime.Parse("10.10.1999 00:00:00"), DateTime.Parse("10.10.1999 00:00:00"));
                a1.ShowDialog();
            }
            else if (this.dataGridView1.CurrentRow.Cells[4].Value.ToString() == null && this.dataGridView1.CurrentRow.Cells[5].Value.ToString() != null)
            {
                Activity a1 = new Activity(Int32.Parse(this.dataGridView1.CurrentRow.Cells[0].Value.ToString()), Int32.Parse(this.dataGridView1.CurrentRow.Cells[6].Value.ToString()),
                                           Int32.Parse(this.dataGridView1.CurrentRow.Cells[9].Value.ToString()), this.dataGridView1.CurrentRow.Cells[8].Value.ToString(), this.dataGridView1.CurrentRow.Cells[1].Value.ToString(), this.dataGridView1.CurrentRow.Cells[3].Value.ToString(),
                                           DateTime.Parse("10.10.1999 00:00:00"), DateTime.Parse(this.dataGridView1.CurrentRow.Cells[5].Value.ToString()));
                a1.ShowDialog();
            }

            else if (this.dataGridView1.CurrentRow.Cells[4].Value != null && this.dataGridView1.CurrentRow.Cells[5].Value == null)
            {
                Activity a1 = new Activity(Int32.Parse(this.dataGridView1.CurrentRow.Cells[0].Value.ToString()), Int32.Parse(this.dataGridView1.CurrentRow.Cells[6].Value.ToString()),
                                           Int32.Parse(this.dataGridView1.CurrentRow.Cells[9].Value.ToString()), this.dataGridView1.CurrentRow.Cells[8].Value.ToString(), this.dataGridView1.CurrentRow.Cells[1].Value.ToString(), this.dataGridView1.CurrentRow.Cells[3].Value.ToString(),
                                           DateTime.Parse(this.dataGridView1.CurrentRow.Cells[4].Value.ToString()), DateTime.Parse("10.10.1999 00:00:00"));
                a1.ShowDialog();
            }

            else
            {
                Activity a1 = new Activity(Int32.Parse(this.dataGridView1.CurrentRow.Cells[0].Value.ToString()), Int32.Parse(this.dataGridView1.CurrentRow.Cells[6].Value.ToString()),
                                           Int32.Parse(this.dataGridView1.CurrentRow.Cells[9].Value.ToString()), this.dataGridView1.CurrentRow.Cells[8].Value.ToString(), this.dataGridView1.CurrentRow.Cells[1].Value.ToString(), this.dataGridView1.CurrentRow.Cells[3].Value.ToString(),
                                           DateTime.Parse(this.dataGridView1.CurrentRow.Cells[4].Value.ToString()), DateTime.Parse(this.dataGridView1.CurrentRow.Cells[5].Value.ToString()));
                a1.ShowDialog();
            }


            var result = SQLmanager.SearchActivity(this.textBox1.Text.ToString());

            dataGridView1.DataSource = result;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            EditCustomerDetails a1 = new EditCustomerDetails();

            a1.textBox5.Text    = this.dataGridView1.CurrentRow.Cells[0].Value.ToString(); //id
            a1.textBox5.Enabled = false;

            a1.textBox1.Text = this.dataGridView1.CurrentRow.Cells[2].Value.ToString(); //fname
            a1.textBox2.Text = this.dataGridView1.CurrentRow.Cells[3].Value.ToString(); //lname
            a1.textBox3.Text = this.dataGridView1.CurrentRow.Cells[1].Value.ToString(); //name
            a1.textBox4.Text = this.dataGridView1.CurrentRow.Cells[4].Value.ToString(); //tel

            a1.ShowDialog();

            var result = SQLmanager.SearchCustomers("", "", "");

            dataGridView1.DataSource = result;
        }
        private void button3_Click(object sender, EventArgs e)
        {
            AddActivity add = new AddActivity(Int32.Parse(textBox1.Text), dateTimePicker2.Value, dateTimePicker1.Value);

            add.Show();

            var result = SQLmanager.SearchActivity(this.textBox1.Text.ToString());

            dataGridView1.DataSource = result;

            var result1 = SQLmanager.SearchActivity(this.textBox1.Text.ToString());

            dataGridView1.DataSource = result1;

            /*dataGridView1.Update();
             * dataGridView1.Refresh();
             * var result = SQLmanager.SearchActivity(this.textBox1.Text.ToString());
             * dataGridView1.DataSource = result;*/
        }
        private void button2_Click(object sender, EventArgs e)
        {
            var            obj       = SQLmanager.SearchObjects3(this.dataGridView1.CurrentRow.Cells[7].Value.ToString());
            var            customer  = SQLmanager.SearchCustomerFromID(obj.First().id_client.ToString());
            string         customer2 = customer.First().first_name.ToString() + " " + customer.First().last_name.ToString() + " " + customer.First().name.ToString();
            RequestDetails a1        = new RequestDetails(this.dataGridView1.CurrentRow.Cells[2].Value.ToString());

            a1.textBox1.Text     = this.dataGridView1.CurrentRow.Cells[0].Value.ToString(); //id
            a1.richTextBox1.Text = this.dataGridView1.CurrentRow.Cells[1].Value.ToString(); //description

            if (this.dataGridView1.CurrentRow.Cells[3].Value == null)
            {
                a1.richTextBox2.Text = "";
            }
            else
            {
                a1.richTextBox2.Text = this.dataGridView1.CurrentRow.Cells[3].Value.ToString(); //result
            }
            //a1.comboBox1.Text = this.dataGridView1.CurrentRow.Cells[2].Value.ToString(); //status
            a1.textBox2.Text         = customer2;                                                                   //customer data
            a1.textBox3.Text         = this.dataGridView1.CurrentRow.Cells[7].Value.ToString();                     //vehicle data
            a1.dateTimePicker1.Value = Convert.ToDateTime(this.dataGridView1.CurrentRow.Cells[4].Value.ToString()); //start date

            if (this.dataGridView1.CurrentRow.Cells[5].Value == null)
            {
                a1.richTextBox2.Text = "";
            }
            else
            {
                a1.dateTimePicker2.Value = Convert.ToDateTime(this.dataGridView1.CurrentRow.Cells[5].Value.ToString()); //final date
            }
            a1.ShowDialog();
            var result = SQLmanager.SearchRequests();

            dataGridView1.DataSource = result;
        }
Пример #17
0
        private void searchBox_Click(object sender, EventArgs e)
        {
            var result = SQLmanager.SearchObjects(textBox4.Text.ToString(), textBox3.Text.ToString(), textBox2.Text.ToString());

            dataGridView1.DataSource = result;
        }
Пример #18
0
 private void button1_Click(object sender, EventArgs e)
 {
     SQLmanager.EditCustomer(textBox5.Text.ToString(), textBox3.Text.ToString(), textBox1.Text.ToString(), textBox2.Text.ToString(), textBox4.Text.ToString());
     this.Close();
     MessageBox.Show("User updated successfully");
 }
Пример #19
0
 public StatsManager()
 {
     RA = new RequestAgent();
     SM = new SQLmanager();
 }
        private void Requests_Load(object sender, EventArgs e)
        {
            var result = SQLmanager.SearchRequests();

            dataGridView1.DataSource = result;
        }
        private void searchBox_Click(object sender, EventArgs e)
        {
            var result = SQLmanager.SearchCustomers(nameBox.Text.ToString(), fnameBox.Text.ToString(), textBox1.Text.ToString());

            dataGridView1.DataSource = result;
        }
        private void button4_Click(object sender, EventArgs e)
        {
            var result = SQLmanager.SearchActivity(this.textBox1.Text.ToString());

            dataGridView1.DataSource = result;
        }
        private void UsersDataLoad(string name = "", string fname = "", string lname = "")
        {
            var result = SQLmanager.SearchCustomers(name, fname, lname);

            dataGridView1.DataSource = result;
        }
Пример #24
0
        private void Vehicle_Load(object sender, EventArgs e)
        {
            var result = SQLmanager.SearchObjects("", "", "");

            dataGridView1.DataSource = result;
        }