private void SaveData()
        {
            object obj = Ezzat.ExecutedScalar("Analysis_Insert", new SqlParameter("@Analysis_Name", txt_Name.Text), new SqlParameter("@Analysis_Unit", txt_Unit.Text));

            Test_ID = int.Parse(obj + "");

            foreach (DataGridViewRow item in dataGridView2.Rows)
            {
                if (item.Cells[0].Value != null)
                {
                    Period_ID    = int.Parse(item.Cells[0].Value.ToString());
                    Male_Value   = float.Parse(item.Cells[2].Value.ToString());
                    Female_Value = float.Parse(item.Cells[3].Value.ToString());

                    Ezzat.ExecutedNoneQuery("Normal_Insert"
                                            , new SqlParameter("@Test_ID", Test_ID)
                                            , new SqlParameter("@Period_ID", Period_ID)
                                            , new SqlParameter("@Male_Value", Male_Value)
                                            , new SqlParameter("@Female_Value", Female_Value)
                                            );
                }
            }

            MessageBox.Show(SharedClass.Successful_Message);
        }
Exemple #2
0
        private void SumBand()
        {
            dataGridView2.Rows.Clear();
            SqlConnection con;

            SqlDataReader dataReader = Ezzat.GetDataReader("select_AllBand", out con);

            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    dataGridView2.Rows.Add();
                    dataGridView2[0, dataGridView2.Rows.Count - 1].Value = dataReader[1].ToString();
                    dataGridView2[1, dataGridView2.Rows.Count - 1].Value =
                        Ezzat.ExecutedScalar("_Outlay_During_Sum_Band",
                                             new SqlParameter("@Day", dateTimePicker1.Value),
                                             new SqlParameter("@Day2", dateTimePicker2.Value),
                                             new SqlParameter("@Band_iD", dataReader[0].ToString())
                                             );
                    if (dataGridView2[1, dataGridView2.Rows.Count - 1].Value.ToString().Length == 0)
                    {
                        dataGridView2[1, dataGridView2.Rows.Count - 1].Value = "0.0000";
                    }
                }
            }

            con.Close();
        }
Exemple #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (combo_Customer.SelectedIndex >= 0)
     {
         dataGridView1.Rows.Clear();
         All_Transaction();
         CalcolateTotal();
         object o = Ezzat.ExecutedScalar("selectTotalMoney_Customer", new SqlParameter("@Supplier_ID", (int)combo_Customer.SelectedValue));
         if ((o + "").Length == 0)
         {
             o = 0;
         }
         label11.Text = String.Format("{0:0.00}", o);
         o            = Ezzat.ExecutedScalar("customer_Start", new SqlParameter("@Customer_ID", (int)combo_Customer.SelectedValue), new SqlParameter("@Day", dateTimePicker1.Value));
         if ((o + "").Length == 0)
         {
             o = 0;
         }
         label5.Text = String.Format("{0:0.00}", o);
         o           = Ezzat.ExecutedScalar("customer_End", new SqlParameter("@Customer_ID", (int)combo_Customer.SelectedValue), new SqlParameter("@Day", dateTimePicker2.Value));
         if ((o + "").Length == 0)
         {
             o = 0;
         }
         label1.Text = String.Format("{0:0.00}", o);
     }
 }
        private void isValidData()
        {
            int o = (int)Ezzat.ExecutedScalar("select_CountUsers");

            if (o == 0)
            {
                Add_Users users = new Add_Users();
                users.Show();
            }
            else
            {
                object q = Ezzat.ExecutedScalar("select_isValid"
                                                , new SqlParameter("@Username", textBox1.Text)
                                                , new SqlParameter("@Password", textBox2.Text)
                                                , new SqlParameter("@isAdmin", radioButton1.Checked)
                                                );

                if (q != null)
                {
                    OpenHome();
                }
                else
                {
                    MessageBox.Show(Shared_Class.Check_Message);
                }
            }
        }
Exemple #5
0
 private void cb_kilo_Click(object sender, EventArgs e)
 {
     if (comboBox1.SelectedIndex == 0)
     {
         if (tb_name.Text != "" && tb_per.Text != "" && tb_price.Text != "" && tb_sell.Text != "")
         {
             Add();
             MessageBox.Show(Shared_Class.Add_Message);
             RefreshForm();
         }
         else
         {
             MessageBox.Show(Shared_Class.Check_Message);
         }
     }
     else if (comboBox1.SelectedIndex == 1)
     {
         if (tb_name.Text != "" && tb_per.Text != "" && tb_price.Text != "" && tb_sell.Text != "" && dataGridView1.Rows.Count > 0)
         {
             Add();
             Product_ID = int.Parse(Ezzat.ExecutedScalar("selectProduct_ID_BYNAME", new SqlParameter("@product_name", tb_name.Text)).ToString());
             AddComponents(Product_ID);
             MessageBox.Show(Shared_Class.Add_Message);
         }
         else
         {
             MessageBox.Show(Shared_Class.Check_Message);
         }
     }
     else
     {
         MessageBox.Show(Shared_Class.Check_Message);
     }
 }
Exemple #6
0
        private void RefreshForm()
        {
            label12.Text = String.Format("{0:HH:mm:ss  dd/MM/yyyy}", DateTime.Now);


            using (dataSet = Ezzat.GetDataSet("selectAllCustomer", "X"))
            {
                combo_Cus.DataSource    = dataSet.Tables["X"];
                combo_Cus.DisplayMember = "Customer_Name";
                combo_Cus.ValueMember   = "Customer_ID";
                combo_Cus.Text          = "";
                combo_Cus.SelectedText  = "اختار اسم العميل";
            }

            using (dataSet = Ezzat.GetDataSet("selectAllSupplier", "X"))
            {
                combo_Supliers.DataSource    = dataSet.Tables["X"];
                combo_Supliers.DisplayMember = "Supplier_Name";
                combo_Supliers.ValueMember   = "Supplier_ID";
                combo_Supliers.Text          = "";
                combo_Supliers.SelectedText  = "اختار اسم المورد";
            }

            object o = Ezzat.ExecutedScalar("selectBankTransaction_Bill_ID");

            label2.Text = o + "";
        }
        private void RefForm()
        {
            textBox2.Text = String.Format("{0:HH:mm:ss  dd/MM/yyyy}", DateTime.Now);

            using (ds = Ezzat.GetDataSet("Product_selectAll", "X"))
            {
                combo_Product.DataSource    = ds.Tables["X"];
                combo_Product.DisplayMember = "اسم المنتج";
                combo_Product.ValueMember   = "رقم المنتج";
                combo_Product.Text          = "";
                combo_Product.SelectedText  = "اختار اسم المنتج";
            }

            object o = Ezzat.ExecutedScalar("IMReturning_selectID");

            txt_BillNumber.Text = o + "";


            using (ds = Ezzat.GetDataSet("Supplier_selectAll", "X"))
            {
                combo_name.DataSource    = ds.Tables["X"];
                combo_name.DisplayMember = "اسم المورد";
                combo_name.ValueMember   = "رقم المورد";
                combo_name.Text          = "";
                combo_name.SelectedText  = "اختار اسم المورد";
            }

            dataGridView1.Rows.Clear();
            txt_Discount.Text = txt_MaterialTotal.Text = txt_OldMoney.Text = "0.00";
            txt_Prise.Text    = txt_Quantity.Text = txt_TotalMoney.Text = txt_AfterDiscount.Text = "0.00";
        }
Exemple #8
0
        private void FillGrid_During(DateTime StartDateTime, DateTime EndDateTime)
        {
            dataGridView2.Rows.Clear();
            SqlConnection con;

            SqlDataReader dataReader = Ezzat.GetDataReader("Product_selectAll", out con);


            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    dataGridView2.Rows.Add();
                    dataGridView2[0, dataGridView2.Rows.Count - 1].Value = dataReader[0].ToString();
                    dataGridView2[1, dataGridView2.Rows.Count - 1].Value = dataReader[1].ToString();
                    dataGridView2[2, dataGridView2.Rows.Count - 1].Value = Ezzat.ExecutedScalar("Material_IM"
                                                                                                , new SqlParameter("@Day", dateTimePicker1.Value)
                                                                                                , new SqlParameter("@Day2", dateTimePicker2.Value)
                                                                                                , new SqlParameter("@product_ID", dataReader[0])
                                                                                                );
                    dataGridView2[3, dataGridView2.Rows.Count - 1].Value = Ezzat.ExecutedScalar("Material_EX"
                                                                                                , new SqlParameter("@Day", dateTimePicker1.Value)
                                                                                                , new SqlParameter("@Day2", dateTimePicker2.Value)
                                                                                                , new SqlParameter("@product_ID", dataReader[0])
                                                                                                );
                }
            }
        }
        private void RefForm()
        {
            label12.Text = String.Format("{0:HH:mm:ss  dd/MM/yyyy}", DateTime.Now);


            object o = Ezzat.ExecutedScalar("select_OwnerReportId");

            label2.Text = o.ToString();

            tb_details.Text   = "اكتب بيان الصنف";
            richTextBox1.Text = "اكتب بيان الفاتورة ";


            dataGridView1.Rows.Clear();

            tb_quantity.Text = "0";

            tb_price.Text = "0.00";
            Bill_Total    = 0;
            Calcolate();


            label12.Text = String.Format("{0:HH:mm:ss  dd/MM/yyyy}", DateTime.Now);

            using (dataSet = Ezzat.GetDataSet("Select_All", "X"))
            {
                combo_Materials.DataSource    = dataSet.Tables["X"];
                combo_Materials.DisplayMember = "اسم الصنف";
                combo_Materials.ValueMember   = "رفم الصنف";
                combo_Materials.Text          = "";
                combo_Materials.SelectedText  = "اختار منتج";
            }
        }
        private string CalcolateEnd(string v, DateTime endDateTime)
        {
            object Day_Num = Ezzat.ExecutedScalar("select_EndQuantity_Day_Number",
                                                  new SqlParameter("@EndDate", endDateTime));

            if (Day_Num == null)
            {
                return("0");
            }
            else
            {
                int d = int.Parse(Day_Num.ToString());
                d++;
                Day_Num = d;

                object o = Ezzat.ExecutedScalar("select_EndQuantity",
                                                new SqlParameter("@Day_Number", Day_Num),
                                                new SqlParameter("@Product_ID", int.Parse(v))
                                                );

                if (o == null)
                {
                    object q = Ezzat.ExecutedScalar("select_EndQuantity_Today", new SqlParameter("@Product_ID", int.Parse(v)));
                    return(q + "");
                }
                else
                {
                    return(o + "");
                }
            }
        }
        private void FillGrid_During(DateTime StartDateTime, DateTime EndDateTime)
        {
            dataGridView2.Rows.Clear();
            SqlConnection con;

            SqlDataReader dataReader = Ezzat.GetDataReader("Select_All", out con);


            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    dataGridView2.Rows.Add();
                    dataGridView2[0, dataGridView2.Rows.Count - 1].Value = dataReader[0].ToString();
                    dataGridView2[1, dataGridView2.Rows.Count - 1].Value = dataReader[1].ToString();
                    dataGridView2[2, dataGridView2.Rows.Count - 1].Value = CalcolateEnd(dataReader[0].ToString(), EndDateTime);
                    dataGridView2[3, dataGridView2.Rows.Count - 1].Value = CalcolateStart(dataReader[0].ToString(), StartDateTime);
                    dataGridView2[4, dataGridView2.Rows.Count - 1].Value = double.Parse(dataGridView2[2, dataGridView2.Rows.Count - 1].Value + "")
                                                                           - double.Parse(dataGridView2[3, dataGridView2.Rows.Count - 1].Value + "");
                    dataGridView2[6, dataGridView2.Rows.Count - 1].Value = Ezzat.ExecutedScalar("select_SUMofProduct__IM"
                                                                                                , new SqlParameter("@Day", dateTimePicker1.Value)
                                                                                                , new SqlParameter("@Day2", dateTimePicker2.Value)
                                                                                                , new SqlParameter("@product_ID", dataReader[0])
                                                                                                );
                    dataGridView2[7, dataGridView2.Rows.Count - 1].Value = Ezzat.ExecutedScalar("select_SUMofProduct__EX"
                                                                                                , new SqlParameter("@Day", dateTimePicker1.Value)
                                                                                                , new SqlParameter("@Day2", dateTimePicker2.Value)
                                                                                                , new SqlParameter("@product_ID", dataReader[0])
                                                                                                );
                }
            }
        }
Exemple #12
0
        private void ReturnCriditLimit()
        {
            object o = Ezzat.ExecutedScalar("select_IfCreditLimit", new SqlParameter("@Day", DateTime.Now));

            if (o != null)
            {
                MessageBox.Show("يوجد فواتير للتحصيل");
            }
        }
        private void LoadPayback()
        {
            object o = Ezzat.ExecutedScalar("selectBayback_Bill_ID");


            label2.Text    = o + "";
            panel3.Visible = false;
            panel6.Visible = true;
        }
Exemple #14
0
        private void StartSafeMoney()
        {
            object o = Ezzat.ExecutedScalar("select_StartSafe_ID", new SqlParameter("@Day", DateTime.Parse(DateTime.Now.ToString())));

            if (o == null)
            {
                Ezzat.ExecutedNoneQuery("insert_StartSafe", new SqlParameter("@Day", DateTime.Parse(DateTime.Now.ToString())));
            }
        }
        private void LoadDiscount()
        {
            panel6.Visible = false;
            panel3.Visible = false;
            object o = Ezzat.ExecutedScalar("selectDiscount_Bill_ID");


            label2.Text = o + "";
        }
 private void combo_Supliers_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (combo_Supliers.Focused)
     {
         object o = Ezzat.ExecutedScalar("selectTotalMoney", new SqlParameter("@Supplier_ID", (int)combo_Supliers.SelectedValue));
         tb_OldMoney.Text = String.Format("{0:0.00}", o);
         Calcolate();
     }
 }
        private void LoadDiscount()
        {
            object o = Ezzat.ExecutedScalar("selectEXDiscount_Bill_ID");


            label2.Text = o + "";

            radioButton2.Checked = true;
            panel6.Visible       = false;
        }
        private void LoadPayback()
        {
            object o = Ezzat.ExecutedScalar("selectBayback_Bill_ID_Customer");

            label2.Text = o + "";

            panel3.Visible       = false;
            panel6.Visible       = true;
            radioButton2.Checked = true;
        }
Exemple #19
0
 private void Add()
 {
     Ezzat.ExecutedScalar("insertProduct",
                          new SqlParameter("@Product_Name", tb_name.Text),
                          new SqlParameter("@product_Unit", checkUnit()),
                          new SqlParameter("@Product_Price", float.Parse(tb_price.Text)),
                          new SqlParameter("@Product_Sell", float.Parse(tb_sell.Text)),
                          new SqlParameter("@Product_PerUnit", float.Parse(tb_per.Text)),
                          new SqlParameter("@Product_Type", comboBox1.SelectedIndex)
                          );
 }
Exemple #20
0
        private void RefForm()
        {
            textBox2.Text = String.Format("{0:HH:mm:ss  dd/MM/yyyy}", DateTime.Now);


            object o = Ezzat.ExecutedScalar("OwnerTransaction_selectID");

            textBox1.Text = o.ToString();

            tb_money.Text     = "0.00";
            richTextBox1.Text = "اكتب البيان";
        }
Exemple #21
0
        private void RefForm()
        {
            label12.Text = String.Format("{0:HH:mm:ss  dd/MM/yyyy}", DateTime.Now);


            object o = Ezzat.ExecutedScalar("select_OwnerReportId");

            label2.Text = o.ToString();

            tb_money.Text     = "0.00";
            richTextBox1.Text = "اكتب البيان";
        }
Exemple #22
0
 private bool ValidQuantity()
 {
     if ((double)Ezzat.ExecutedScalar("selectMaterialQuantity"
                                      , new SqlParameter("@Material_ID", combo_Materials.SelectedValue)) >= double.Parse(tb_quantity.Text))
     {
         return(true);
     }
     else
     {
         MessageBox.Show("الكمية الموجودة" + combo_Materials.Text + " فى المخازن لا تكفي");
         return(false);
     }
 }
Exemple #23
0
        private void RefreshForm()
        {
            pictureBox1.Enabled = true;

            tb_details.Text   = "اكتب بيان الصنف";
            richTextBox1.Text = "اكتب بيان الفاتورة ";
            richTextBox2.Text = "لا يوجد ملاحظات";

            dataGridView1.Rows.Clear();
            panel7.Visible   = false;
            tb_quantity.Text = tb_number.Text = "0";

            tb_price.Text = tb_Discount.Text = tb_payment.Text = "0.00";
            Bill_Total    = 0;
            Calcolate();


            label12.Text = String.Format("{0:HH:mm:ss  dd/MM/yyyy}", DateTime.Now);

            using (dataSet = Ezzat.GetDataSet("select_AllCustomer", "X"))
            {
                combo_Customer.DataSource    = dataSet.Tables["X"];
                combo_Customer.DisplayMember = "Customer_Name";
                combo_Customer.ValueMember   = "Customer_ID";
                combo_Customer.Text          = "";
                combo_Customer.SelectedText  = "اختار اسم المشترى";
            }

            using (dataSet = Ezzat.GetDataSet("Select_All", "X"))
            {
                combo_Materials.DataSource    = dataSet.Tables["X"];
                combo_Materials.DisplayMember = "اسم الصنف";
                combo_Materials.ValueMember   = "رفم الصنف";
                combo_Materials.Text          = "";
                combo_Materials.SelectedText  = "اختار منتج";
            }

            object o = Ezzat.ExecutedScalar("selectEXPurchasing_Bill_ID");


            label2.Text = o + "";

            using (dataSet = Ezzat.GetDataSet("select_Banks", "X"))
            {
                combo_Bank.DataSource    = dataSet.Tables["X"];
                combo_Bank.DisplayMember = "Bank_Name";
                combo_Bank.ValueMember   = "Bank_ID";
                combo_Bank.Text          = "";
                combo_Bank.SelectedText  = "اختار بنك للايداع";
            }
        }
Exemple #24
0
        private void button1_Click(object sender, EventArgs e)
        {
            using (dataSet = Ezzat.GetDataSet("Owner_selectTransaction", "X", new SqlParameter("Day", dateTimePicker1.Value), new SqlParameter("Day2", dateTimePicker2.Value)))
            {
                dataGridView1.DataSource = dataSet.Tables["X"];
                dataGridView1.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
                dataGridView1.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
                dataGridView1.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
                dataGridView1.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
            }

            label5.Text = Ezzat.ExecutedScalar("Select_TotalOwnerTransaction", new SqlParameter("Day", dateTimePicker1.Value), new SqlParameter("Day2", dateTimePicker2.Value), new SqlParameter("@f", true)).ToString();
            label6.Text = Ezzat.ExecutedScalar("Select_TotalOwnerTransaction", new SqlParameter("Day", dateTimePicker1.Value), new SqlParameter("Day2", dateTimePicker2.Value), new SqlParameter("@f", false)).ToString();
        }
        private void FillCustomerAccount()
        {
            dataGridView2.Rows.Clear();
            SqlConnection con;
            SqlDataReader dr, dr1;

            dr = Ezzat.GetDataReader("select_AllCustomer", out con);


            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    dr1 = Ezzat.GetDataReader("sum_CustomerDuring", out con
                                              , new SqlParameter("@Day", DateTime.Parse(dateTimePicker1.Value.ToString()))
                                              , new SqlParameter("@Day2", DateTime.Parse(dateTimePicker2.Value.ToString()))
                                              , new SqlParameter("@Customer_ID", dr[0].ToString())
                                              , new SqlParameter("@Customer_Name", dr[1].ToString())
                                              );

                    if (dr1.HasRows)
                    {
                        while (dr1.Read())
                        {
                            dataGridView2.Rows.Add();
                            dataGridView2[0, dataGridView2.Rows.Count - 1].Value = dr1[0].ToString();
                            dataGridView2[1, dataGridView2.Rows.Count - 1].Value = dr1[1].ToString();
                            dataGridView2[2, dataGridView2.Rows.Count - 1].Value = dr1[2].ToString();
                            dataGridView2[3, dataGridView2.Rows.Count - 1].Value = dr1[3].ToString();
                            dataGridView2[4, dataGridView2.Rows.Count - 1].Value = (double.Parse(dr1[3].ToString()) - double.Parse(dr1[2].ToString()));
                            o = Ezzat.ExecutedScalar("customer_Start", new SqlParameter("@Customer_ID", (int)dr1[0]), new SqlParameter("@Day", dateTimePicker1.Value));
                            if ((o + "").Length == 0)
                            {
                                o = 0;
                            }
                            dataGridView2[6, dataGridView2.Rows.Count - 1].Value = String.Format("{0:0.00}", o);
                            o = Ezzat.ExecutedScalar("customer_End", new SqlParameter("@Customer_ID", (int)dr1[0]), new SqlParameter("@Day", dateTimePicker2.Value));
                            if ((o + "").Length == 0)
                            {
                                o = 0;
                            }
                            dataGridView2[7, dataGridView2.Rows.Count - 1].Value = String.Format("{0:0.00}", o);
                        }
                    }
                }
            }

            con.Close();
        }
Exemple #26
0
 private void combo_name_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (combo_name.Focused)
     {
         object o = Ezzat.ExecutedScalar("select_Unit", new SqlParameter("@Product_Id", combo_name.SelectedValue));
         if (o.ToString().Contains("كجم"))
         {
             radioButton1.Checked = true;
         }
         else
         {
             radioButton4.Checked = true;
         }
     }
 }
        private string CalcolateStart(string v, DateTime startDateTime)
        {
            object o = Ezzat.ExecutedScalar("select_StartQuantity",
                                            new SqlParameter("@startDate", startDateTime),
                                            new SqlParameter("@Product_ID", int.Parse(v)));

            if (o == null)
            {
                return("0");
            }
            else
            {
                return(o + "");
            }
        }
        private bool IsExsisted()
        {
            object o = Ezzat.ExecutedScalar("select_ifExsistSolva",
                                            new SqlParameter("@ID", combo_Employee.SelectedValue)
                                            );

            if (int.Parse(o.ToString()) != 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Exemple #29
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (combo_Bank.SelectedIndex >= 0)
     {
         dataGridView1.Rows.Clear();
         All_Transaction();
         CalcolateTotal();
         object o = Ezzat.ExecutedScalar("selectTotalMoney_Bank", new SqlParameter("@Supplier_ID", (int)combo_Bank.SelectedValue));
         label11.Text = String.Format("{0:0.00}", o);
     }
     else
     {
         MessageBox.Show(Shared_Class.Check_Message);
     }
 }
        private bool IsExsisted()
        {
            object o = Ezzat.ExecutedScalar("select_EmployiesAndData",
                                            new SqlParameter("@Month", String.Format("{0:MM}", DateTime.Now)),
                                            new SqlParameter("@Year", String.Format("{0:yyyy}", DateTime.Now)),
                                            new SqlParameter("@Employee_ID", combo_Employee.SelectedValue)
                                            );

            if (o == null)
            {
                return(false);
            }
            else
            {
                return((bool)o);
            }
        }