Beispiel #1
0
        private void EmployeesBtn_Click(object sender, EventArgs e)
        {
            Key = 1;
            tableLayoutPanel3.Hide();
            tableLayoutPanel2.Hide();
            tableLayoutPanel1.Hide();
            SaveBtn.Hide();
            JobTitlesbtn.Enabled   = true;
            DepartmentsBtn.Enabled = true;
            OfficesBtn.Enabled     = true;
            SqldataGridView.Show();
            CreateBtn.Show();
            CreateBtn.Enabled = true;
            UpdateBtn.Show();
            UpdateBtn.Enabled = false;
            DeleteBtn.Show();
            DeleteBtn.Enabled = false;
            TurnOnEditBth.Show();
            MainPicture.Hide();
            string sql = "select p.id_pracownika as ID, p.imie as Imie, p.nazwisko as Nazwisko,  s.nazwa as Stanowisko, d.nazwa_dzialu as 'Nazwa działu', si.nazwa_siedziby as Siedziba, si.adres as Adres" +
                         " from PRACOWNICY p join DZIALY d on p.id_dzialu=d.id_dzialu join STANOWISKA s on p.id_stanowiska=s.id_stanowiska join SIEDZIBY si on d.id_siedziby=si.id_siedziby;";

            LoadDataToSqldataGridView("Pracownicy", sql);
            EmployeesBtn.Enabled = false;
        }
Beispiel #2
0
 private void rooms_Click(object sender, EventArgs e)
 {
     refresh_method();
     dataGridView1.Hide();
     dataGridView2.Show();
     AddBtn.Show();
     DeleteBtn.Show();
     ChangeBtn.Show();
     label1.Show();
     StatisticBox.Show();
     ShowBtn.Show();
 }
Beispiel #3
0
        //Fill Aauthors Method End
        #endregion


        #region Author Update Method for Row
        //Author Update Method
        private void DgvAuthors_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            int id = Convert.ToInt32(DgvAuthors.Rows[e.RowIndex].Cells[0].Value.ToString());

            _author = _db.Authors.Find(id);

            UpdateBtn.Show();
            DeleteBtn.Show();

            TxtName.Text    = _author.Name;
            TxtSurname.Text = _author.Surname;
            if (_author.Status == false)
            {
                RdBtnActive.Checked = true;
            }
            else
            {
                RdBtnDisabled.Checked = true;
            }
            BtnCreate.Enabled = false;
        }
        private void DgvCustomer_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            int id = Convert.ToInt32(DgvCustomer.Rows[e.RowIndex].Cells[0].Value.ToString());

            _customer = _db.Customers.Find(id);

            UpdateBtn.Show();
            DeleteBtn.Show();

            FullNameTxt.Text = _customer.FullName;
            EmailTxt.Text    = _customer.Email;
            PhoneTxt.Text    = _customer.Phone;
            if (_customer.Status == false)
            {
                ActiveRdBtn.Checked = true;
            }
            else
            {
                DisabledRdBtn.Checked = true;
            }
            BtnCreate.Enabled = false;
        }
Beispiel #5
0
        private void DepartmentsBtn_Click(object sender, EventArgs e)
        {
            Key = 4;
            tableLayoutPanel3.Hide();
            tableLayoutPanel2.Hide();
            tableLayoutPanel1.Hide();
            SaveBtn.Hide();
            EmployeesBtn.Enabled = true;
            JobTitlesbtn.Enabled = true;
            OfficesBtn.Enabled   = true;
            SqldataGridView.Show();
            CreateBtn.Show();
            UpdateBtn.Show();
            DeleteBtn.Show();
            CreateBtn.Enabled = true;
            UpdateBtn.Enabled = false;
            DeleteBtn.Enabled = false;
            TurnOnEditBth.Show();
            MainPicture.Hide();
            string sql = "select d.nazwa_dzialu, s.nazwa_siedziby, s.adres from DZIALY d join SIEDZIBY s on  d.id_siedziby=s.id_siedziby ";

            LoadDataToSqldataGridView("Dzialy", sql);
            DepartmentsBtn.Enabled = false;
        }
Beispiel #6
0
        private void OfficesBtn_Click(object sender, EventArgs e)
        {
            Key = 3;
            tableLayoutPanel3.Hide();
            tableLayoutPanel2.Hide();
            tableLayoutPanel1.Hide();
            SaveBtn.Hide();
            EmployeesBtn.Enabled   = true;
            JobTitlesbtn.Enabled   = true;
            DepartmentsBtn.Enabled = true;
            SqldataGridView.Show();
            CreateBtn.Show();
            UpdateBtn.Show();
            DeleteBtn.Show();
            CreateBtn.Enabled = true;
            UpdateBtn.Enabled = false;
            DeleteBtn.Enabled = false;
            TurnOnEditBth.Show();
            MainPicture.Hide();
            string sql = "select id_siedziby as ID ,nazwa_siedziby as Oddział, adres as Adres from SIEDZIBY ";

            LoadDataToSqldataGridView("Siedziby", sql);
            OfficesBtn.Enabled = false;
        }
Beispiel #7
0
        private void JobTitlesbtn_Click(object sender, EventArgs e)
        {
            Key = 2;
            tableLayoutPanel3.Hide();
            tableLayoutPanel2.Hide();
            tableLayoutPanel1.Hide();
            SaveBtn.Hide();
            EmployeesBtn.Enabled   = true;
            OfficesBtn.Enabled     = true;
            DepartmentsBtn.Enabled = true;
            SqldataGridView.Show();
            CreateBtn.Show();
            UpdateBtn.Show();
            DeleteBtn.Show();
            CreateBtn.Enabled = true;
            UpdateBtn.Enabled = false;
            DeleteBtn.Enabled = false;
            TurnOnEditBth.Show();
            MainPicture.Hide();
            string sql = "select id_stanowiska, nazwa as Stanowisko from STANOWISKA ";

            LoadDataToSqldataGridView("Stanowiska", sql);
            JobTitlesbtn.Enabled = false;
        }
Beispiel #8
0
        private void btnFound_Click(object sender, EventArgs e)
        {
            var billDate = dtp_BillDate.Value;
            var salesRep = store.employee.FirstOrDefault(m => m.EmployeeName == MandobtextBox.Text);

            var customer = store.customers.FirstOrDefault(c => c.Name == CustomerNametextBox.Text);

            SalesOrder = (
                from s in store.SalesOrder
                where (s.SalesRepresentative.Employee_Id == salesRep.ID /*&& s.SalesOrderDate == billDate*/ && s.customers_Id == customer.ID)
                select s
                ).FirstOrDefault();
            if (SalesOrder != null)
            {
                panel1.Show();
                panel2.Show();
                panel3.Show();
                btn_AddToBills.Show();
                btn_Cancel.Show();
                btn_Print.Show();
                btn_Save.Show();
                editBtn.Show();
                searchBtn.Show();
                SearchtextBox3.Show();
                DeleteBtn.Show();
                dgv_SalesBill.Show();
                details = store.SalesOrderDetails.Where(s => s.salesOrder_id == SalesOrder.ID).ToList();
                //dgv_SalesBill.Rows.Add();

                int row = 0;
                //row = dgv_SalesBill.Rows.Count - 2;
                SalesOredersPaymment   = store.SalesOredersPaymments.FirstOrDefault(s => s.SalesOrder_id == SalesOrder.ID);
                numericPaiedCost.Value = decimal.Parse(SalesOredersPaymment.Paied.ToString());
                numericResCost.Value   = decimal.Parse(SalesOredersPaymment.Rest.ToString());
                numericTotalCost.Value = decimal.Parse(SalesOrder.SalesOrederTotalPrice.ToString());

                foreach (var item in details)
                {
                    dgv_SalesBill.Rows.Add();

                    var product = new Products();
                    product = store.products.FirstOrDefault(p => p.ID == item.products_id);

                    //dgv_SalesBill["ProductID", row].Value = product.ID.ToString();
                    //dgv_SalesBill["productName", row].Value = product.ProductName.ToString();
                    //dgv_SalesBill["price", row].Value = product.Price_customer.ToString();
                    //dgv_SalesBill["discount", row].Value = product.Discount.ToString();
                    //dgv_SalesBill["productQuantity", row].Value = item.quantity.ToString();
                    dgv_SalesBill.Rows[row].Cells[4].Value = product.ID.ToString();
                    dgv_SalesBill.Rows[row].Cells[3].Value = product.ProductName.ToString();
                    dgv_SalesBill.Rows[row].Cells[1].Value = product.Price_customer.ToString();
                    dgv_SalesBill.Rows[row].Cells[0].Value = product.Discount.ToString();
                    dgv_SalesBill.Rows[row].Cells[2].Value = item.quantity.ToString();

                    row++;
                }
            }
            else
            {
                MessageBox.Show("هذه  الفاتوره ليست موجوده");
            }
        }
Beispiel #9
0
 void EditLabel(int check)
 {
     if (check == 0)
     {
         label1.Hide();
         label2.Hide();
         label3.Hide();
         label4.Hide();
         label5.Hide();
         textBox2.Hide();
         textBox3.Hide();
         textBox4.Hide();
         textBox5.Hide();
         textBox6.Hide();
         button6.Hide();
         DeleteBtn.Hide();
         SearchBtn.Hide();
         SortName.Hide();
         SortGroup.Hide();
         SortPoint.Hide();
     }
     if (check == 1)
     {
         label1.Show();
         label2.Show();
         label3.Show();
         label4.Show();
         label5.Show();
         textBox2.Show();
         textBox3.Show();
         textBox4.Show();
         textBox5.Show();
         textBox6.Show();
         button6.Show();
         DeleteBtn.Hide();
         SortName.Hide();
         SortGroup.Hide();
         SortPoint.Hide();
     }
     if (check == 2)
     {
         DeleteBtn.Show();
         label1.Show();
         label2.Hide();
         label3.Hide();
         label4.Hide();
         label5.Hide();
         textBox2.Show();
         textBox3.Hide();
         textBox4.Hide();
         textBox5.Hide();
         textBox6.Hide();
         button6.Hide();
         SearchBtn.Hide();
         SortName.Hide();
         SortGroup.Hide();
         SortPoint.Hide();
     }
     if (check == 3)
     {
         SearchBtn.Show();
         label1.Show();
         label2.Hide();
         label3.Hide();
         label4.Hide();
         label5.Hide();
         textBox2.Show();
         textBox3.Hide();
         textBox4.Hide();
         textBox5.Hide();
         textBox6.Hide();
         button6.Hide();
         DeleteBtn.Hide();
         SortName.Hide();
         SortGroup.Hide();
         SortPoint.Hide();
     }
     if (check == 4)
     {
         SearchBtn.Hide();
         label1.Hide();
         label2.Hide();
         label3.Hide();
         label4.Hide();
         label5.Hide();
         textBox2.Hide();
         textBox3.Hide();
         textBox4.Hide();
         textBox5.Hide();
         textBox6.Hide();
         button6.Hide();
         DeleteBtn.Hide();
         SortName.Show();
         SortGroup.Show();
         SortPoint.Show();
     }
 }