private void ShowDetails_Material(int ID)
        {
            SqlConnection con;
            SqlDataReader dr = Ezzat.GetDataReader("selectSpasificProduct2", out con, new SqlParameter("@Product_ID", ID));

            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    MaterialPrice   = double.Parse(dr[7].ToString());
                    Product_PerUnit = int.Parse(dr[5].ToString());
                    MaterialUnit    = dr[4].ToString();
                    tb_price.Text   = String.Format("{0:0.00}", MaterialPrice);
                    if (dr[4].ToString() == "كجم")
                    {
                        rb_Kilo.Checked = true;
                    }
                    else if (dr[4].ToString() == "جم")
                    {
                        rb_Gram.Checked = true;
                    }
                }
            }
            con.Close();
        }
Exemplo n.º 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();
        }
        private void combo_Employee_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (combo_Employee.Focused)
            {
                dataGridView1.DataSource = null;
                dataGridView1.Rows.Clear();
                SqlConnection con;

                SqlDataReader dataReader = Ezzat.GetDataReader("selectEmployee_Month_Salary", out con, new SqlParameter("@Employer_ID", combo_Employee.SelectedValue));

                if (dataReader.HasRows)
                {
                    while (dataReader.Read())
                    {
                        dataGridView1.Rows.Add();
                        dataGridView1[0, dataGridView1.Rows.Count - 1].Value = dataReader[1].ToString() + "-" + dataReader[2].ToString();
                        dataGridView1[1, dataGridView1.Rows.Count - 1].Value = dataReader[6].ToString();
                        dataGridView1[2, dataGridView1.Rows.Count - 1].Value = dataReader[8].ToString();
                        dataGridView1[3, dataGridView1.Rows.Count - 1].Value = dataReader[7].ToString();
                        dataGridView1[4, dataGridView1.Rows.Count - 1].Value = dataReader[9].ToString();
                        dataGridView1[5, dataGridView1.Rows.Count - 1].Value = dataReader[11].ToString();
                        dataGridView1[6, dataGridView1.Rows.Count - 1].Value =
                            ((double.Parse(dataReader[6].ToString()) + double.Parse(dataReader[8].ToString()))
                             - (double.Parse(dataReader[7].ToString()) + double.Parse(dataReader[9].ToString()) + double.Parse(dataReader[11].ToString())));
                        dataGridView1[7, dataGridView1.Rows.Count - 1].Value = dataReader[10].ToString();
                    }
                }
                con.Close();
            }
        }
        private void ShowDetails(int test_ID, string test_Name, string test_Unit)
        {
            bt_save.Enabled = false;
            bt_edit.Enabled = true;

            txt_Name.Text = test_Name;
            txt_Unit.Text = test_Unit;

            dataGridView2.Rows.Clear();


            SqlConnection con;
            SqlDataReader dataReader = Ezzat.GetDataReader("Normals_Select_All", out con, new SqlParameter("@Test_ID", test_ID));


            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    DataGridViewRow row = (DataGridViewRow)dataGridView2.Rows[0].Clone();
                    row.Cells[0].Value = dataReader["الرقم المسلسل"].ToString();
                    row.Cells[1].Value = dataReader["المرحلة العمرية"].ToString();
                    row.Cells[2].Value = dataReader["معدل عند الذكر"].ToString();
                    row.Cells[3].Value = dataReader["معدل عند الانثى"].ToString();
                    dataGridView2.Rows.Add(row);
                }
            }
            con.Close();
        }
Exemplo n.º 5
0
        private void ShowDetails(int company_ID)
        {
            bt_edit.Enabled = true;
            bt_save.Enabled = false;

            SqlConnection con;
            SqlDataReader dataReader = Ezzat.GetDataReader("Company_Select_All_BYID",
                                                           out con, new SqlParameter("@Company_ID", company_ID));


            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    txt_Name.Text     = dataReader["Company_Name"].ToString();
                    txt_Adress.Text   = dataReader["Company_Adress"].ToString();
                    txt_Discount.Text = dataReader["Company_Discount"].ToString();
                    txt_Money.Text    = dataReader["Company_Money"].ToString();
                    txt_Phone.Text    = dataReader["Company_Phone"].ToString();
                    int value = (int)dataReader["Group_ID"];
                    combo_Group.SelectedValue = value;
                }
            }
            con.Close();
        }
        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])
                                                                                                );
                }
            }
        }
        private void All_Transaction()
        {
            SqlConnection con;

            SqlDataReader dataReader = Ezzat.GetDataReader("_Supplier_SupplierTransaction_During", out con,
                                                           new SqlParameter("@Day", DateTime.Parse(dateTimePicker1.Value.ToString())),
                                                           new SqlParameter("@Day2", DateTime.Parse(dateTimePicker2.Value.ToString())),
                                                           new SqlParameter("@Supplier_ID", combo_Supliers.SelectedValue));

            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    gv.Rows.Add();
                    gv[0, gv.Rows.Count - 1].Value = dataReader[0].ToString();
                    gv[1, gv.Rows.Count - 1].Value = dataReader[2].ToString();
                    gv[2, gv.Rows.Count - 1].Value = dataReader[1].ToString();
                    gv[3, gv.Rows.Count - 1].Value = (double.Parse(dataReader[2].ToString()) - double.Parse(dataReader[1].ToString()));
                    gv[4, gv.Rows.Count - 1].Value = dataReader[3].ToString();
                    gv[5, gv.Rows.Count - 1].Value = dataReader[5].ToString();
                    gv[6, gv.Rows.Count - 1].Value = dataReader[4].ToString();
                }
            }

            con.Close();
        }
        private void ShowDetails_Bank_Customer_Load(object sender, EventArgs e)
        {
            SqlConnection con;

            SqlDataReader dataReader = Ezzat.GetDataReader("select_EXBillDeteils_Bank", out con,
                                                           new SqlParameter("@Bill_ID", id));

            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    l_id.Text            = dataReader[0].ToString();
                    l_date.Text          = dataReader[2].ToString();
                    tb_OldMoney.Text     = dataReader[4].ToString();
                    tb_payment.Text      = dataReader[5].ToString();
                    tb_AfterPayment.Text = dataReader[6].ToString();
                    richTextBox1.Text    = dataReader[7].ToString();
                    l_num.Text           = dataReader[8].ToString();
                    l_name.Text          = dataReader[10].ToString();
                    l_bank.Text          = dataReader[11].ToString();
                }
            }

            con.Close();
        }
Exemplo n.º 9
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])
                                                                                                );
                }
            }
        }
Exemplo n.º 10
0
        private void All_Transaction()
        {
            SqlConnection con;

            SqlDataReader dataReader = Ezzat.GetDataReader("_BankTransaction_During", out con,
                                                           new SqlParameter("@Day", DateTime.Parse(dateTimePicker1.Value.ToString())),
                                                           new SqlParameter("@Day2", DateTime.Parse(dateTimePicker2.Value.ToString())),
                                                           new SqlParameter("@BankID", combo_Bank.SelectedValue));


            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    dataGridView1.Rows.Add();
                    dataGridView1[0, dataGridView1.Rows.Count - 1].Value = dataReader[0].ToString();
                    dataGridView1[1, dataGridView1.Rows.Count - 1].Value = dataReader[1].ToString();
                    dataGridView1[2, dataGridView1.Rows.Count - 1].Value = dataReader[2].ToString();
                    dataGridView1[3, dataGridView1.Rows.Count - 1].Value = (double.Parse(dataReader[1].ToString()) - double.Parse(dataReader[2].ToString()));
                    dataGridView1[4, dataGridView1.Rows.Count - 1].Value = dataReader[3].ToString();
                    dataGridView1[5, dataGridView1.Rows.Count - 1].Value = dataReader[5].ToString();
                    dataGridView1[6, dataGridView1.Rows.Count - 1].Value = dataReader[4].ToString();
                }
            }

            con.Close();
        }
Exemplo n.º 11
0
        private void ShowDetails(int value)
        {
            bt_edit.Enabled = button1.Enabled = true;
            bt_Save.Enabled = false;

            SqlConnection con;
            SqlDataReader dataReader = Ezzat.GetDataReader("selectSpasific_Supplier", out con, new SqlParameter("@Supplier_ID", value));


            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    tb_name.Text    = dataReader["Supplier_Name"].ToString();
                    tb_address.Text = dataReader["Supplier_Address"].ToString();
                    tb_company.Text = dataReader["Supplier_Company"].ToString();
                    tb_phone.Text   = dataReader["Supplier_Phone"].ToString();
                    tb_phone2.Text  = dataReader["Supplier_Phone2"].ToString();
                    tb_day.Text     = dataReader["Number_Day"].ToString();
                    PaymentMethod(dataReader["Payment_Method"].ToString());
                }
            }
            con.Close();

            FillBankAccounts(value);
        }
Exemplo n.º 12
0
        private void SelectComponents(int Type)
        {
            dataGridView1.Rows.Clear();
            if (Type == 0)
            {
                panel6.Enabled = false;
            }
            else
            {
                getAllMaterial();
                SqlConnection con;
                panel6.Enabled = true;


                SqlDataReader dr = Ezzat.GetDataReader("selectComponent", out con, new SqlParameter("@Prpduct_ID", Product_ID));
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        dataGridView1.Rows.Add();
                        dataGridView1[0, dataGridView1.Rows.Count - 1].Value = dr[0].ToString();
                        dataGridView1[1, dataGridView1.Rows.Count - 1].Value = dr[1].ToString();
                        dataGridView1[2, dataGridView1.Rows.Count - 1].Value = dr[2].ToString();
                        dataGridView1[3, dataGridView1.Rows.Count - 1].Value = dr[3].ToString();
                    }
                }
                con.Close();
            }
        }
Exemplo n.º 13
0
        private void ReturnData()
        {
            SqlConnection con;

            dataReader = Ezzat.GetDataReader("Safe_selectSafeTransaction", out con,
                                             new SqlParameter("@Day", DateTime.Parse(dateTimePicker1.Value.ToString())),
                                             new SqlParameter("@Day2", DateTime.Parse(dateTimePicker2.Value.ToString())));


            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    dataGridView1.Rows.Add();
                    dataGridView1[0, dataGridView1.Rows.Count - 1].Value = dataReader[0].ToString();
                    dataGridView1[1, dataGridView1.Rows.Count - 1].Value = dataReader[1].ToString();
                    dataGridView1[2, dataGridView1.Rows.Count - 1].Value = dataReader[2].ToString();
                    dataGridView1[3, dataGridView1.Rows.Count - 1].Value = (double.Parse(dataReader[1].ToString()) - double.Parse(dataReader[2].ToString()));
                    dataGridView1[4, dataGridView1.Rows.Count - 1].Value = dataReader[3].ToString();
                    dataGridView1[5, dataGridView1.Rows.Count - 1].Value = dataReader[5].ToString();
                    dataGridView1[6, dataGridView1.Rows.Count - 1].Value = dataReader[4].ToString();
                }
            }

            con.Close();
        }
Exemplo n.º 14
0
        private void ShowDetails(int patient_ID)
        {
            bt_edit.Enabled = true;
            bt_save.Enabled = false;

            SqlConnection con;
            SqlDataReader dataReader = Ezzat.GetDataReader("PatientCompany_Select_All_BYID",
                                                           out con, new SqlParameter("@Patient_ID", patient_ID));


            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    txt_Name.Text   = dataReader["Patient_Name"].ToString();
                    txt_Phone.Text  = dataReader["Patient_Phone"].ToString();
                    txt_Age.Text    = dataReader["Patient_Age"].ToString();
                    txt_Number.Text = dataReader["Patient_Number"].ToString();
                    int value = (int)dataReader["Company_ID"];
                    combo_Company.SelectedValue = value;
                    bool bo = (bool)dataReader["Patient_Gender"];
                    radio_Male.Checked   = bo;
                    radio_Female.Checked = !bo;
                }
            }
            con.Close();
        }
        private void ShowDetails()
        {
            SqlConnection con;
            SqlDataReader dataReader = Ezzat.GetDataReader("customer_selectBillDetails2", out con, new SqlParameter("@bill_ID", bill_ID));


            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    //tb_name.Text = dataReader["Customer_Name"].ToString();
                    //tb_carNumber.Text = dataReader["Car_Number"].ToString();
                    //tb_carShaseh.Text = dataReader["Car_Chaseh"].ToString();
                    //comboBox1.Text = dataReader["Car_Type"].ToString();
                    //tb_phone.Text = dataReader["Customer_Phone"].ToString();
                    //tb_kilo.Text = dataReader["Kilomaters"].ToString();


                    txt_AfterDiscount.Text = dataReader["After_Discount"].ToString();
                    txt_Discount.Text      = dataReader["Discount_Money"].ToString();
                    txt_MaterialTotal.Text = dataReader["Material_Money"].ToString();
                    txt_OldMoney.Text      = dataReader["Total_oldMoney"].ToString();
                    txt_Payment.Text       = dataReader["Payment_Money"].ToString();
                    txt_Render.Text        = dataReader["After_Payment"].ToString();
                    txt_Total.Text         = dataReader["Total_Money"].ToString();
                }
            }
            con.Close();
        }
Exemplo n.º 16
0
        private void Employee_Salaries_Load(object sender, EventArgs e)
        {
            label12.Text = String.Format("{0:MM-yyyy}", DateTime.Now);


            SqlConnection con;
            //بيجيب كل الموطفين اللي لسه حساباتهم جارية
            SqlDataReader dataReader2 = Ezzat.GetDataReader("select_EmployiesAndData_FromEmployee", out con);

            if (dataReader2.HasRows)
            {
                while (dataReader2.Read())
                {
                    dataGridView1.Rows.Add();
                    dataGridView1[0, dataGridView1.Rows.Count - 1].Value = dataReader2[0].ToString();
                    dataGridView1[1, dataGridView1.Rows.Count - 1].Value = dataReader2[1].ToString();
                    dataGridView1[2, dataGridView1.Rows.Count - 1].Value = dataReader2[2].ToString();
                    dataGridView1[3, dataGridView1.Rows.Count - 1].Value = dataReader2[3].ToString();
                    dataGridView1[4, dataGridView1.Rows.Count - 1].Value = bool.Parse(dataReader2[4].ToString());
                }
            }
            con.Close();


            IsExsisted();
        }
Exemplo n.º 17
0
        private bool IsValid()
        {
            bool          Valid = true;
            SqlConnection con;

            //بيجيب لو فيه موطفين ف الشهر دا و يعدل عليهم
            SqlDataReader dr = Ezzat.GetDataReader("select_EmployiesAndDataAllData", out con,
                                                   new SqlParameter("@Month", String.Format("{0:MM}", DateTime.Now)),
                                                   new SqlParameter("@Year", String.Format("{0:yyyy}", DateTime.Now)),
                                                   new SqlParameter("@Employee_ID", dataGridView1.CurrentRow.Cells[0].Value)
                                                   );

            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    if (bool.Parse(dr[10].ToString()) || double.Parse(dr[9].ToString()) != 0 || double.Parse(dr[8].ToString()) != 0 || double.Parse(dr[7].ToString()) != 0)
                    {
                        Valid = false;
                    }
                }
            }
            con.Close();
            return(Valid);
        }
        private void ShowDetails_Payback_Supplier_Load(object sender, EventArgs e)
        {
            l_type.Text = type.ToString();
            if (type.ToString().Contains("تسديد"))
            {
                SqlConnection con;

                SqlDataReader dataReader = Ezzat.GetDataReader("select_IMBillDeteils_Payback", out con,
                                                               new SqlParameter("@Bill_ID", id));

                if (dataReader.HasRows)
                {
                    while (dataReader.Read())
                    {
                        l_id.Text            = dataReader[0].ToString();
                        l_date.Text          = dataReader[2].ToString();
                        tb_OldMoney.Text     = dataReader[4].ToString();
                        tb_payment.Text      = dataReader[5].ToString();
                        tb_AfterPayment.Text = dataReader[6].ToString();
                        richTextBox1.Text    = dataReader[7].ToString();
                        label2.Text          = dataReader[8].ToString();
                        l_name.Text          = dataReader[11].ToString();
                    }
                }

                con.Close();
            }
            else if (type.ToString().Contains("خصم"))
            {
                SqlConnection con;

                SqlDataReader dataReader = Ezzat.GetDataReader("select_IMBillDeteils_Discount", out con,
                                                               new SqlParameter("@Bill_ID", id));

                if (dataReader.HasRows)
                {
                    while (dataReader.Read())
                    {
                        l_id.Text            = dataReader[0].ToString();
                        l_date.Text          = dataReader[2].ToString();
                        tb_OldMoney.Text     = dataReader[3].ToString();
                        tb_payment.Text      = dataReader[4].ToString();
                        tb_AfterPayment.Text = dataReader[5].ToString();
                        richTextBox1.Text    = dataReader[6].ToString();
                        label2.Text          = dataReader[7].ToString();
                        l_name.Text          = dataReader[8].ToString();
                    }
                }

                con.Close();
            }
        }
Exemplo n.º 19
0
        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();
        }
Exemplo n.º 20
0
        private void ShowDetails_Customer(int ID)
        {
            SqlConnection con;
            SqlDataReader dr = Ezzat.GetDataReader("selectSpasific_Customer", out con, new SqlParameter("@Customer_Id", ID));

            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    tb_OldMoney.Text = dr["Total_Money"].ToString();
                    Calcolate();
                }
            }
            con.Close();
        }
Exemplo n.º 21
0
        private void ShowDetailsCustomer(int selectedValue)
        {
            SqlConnection con;
            SqlDataReader dataReader = Ezzat.GetDataReader("Customer_selectSearch_BYID", out con, new SqlParameter("@Customer_ID", selectedValue));


            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    txt_OldMoney.Text = dataReader["Customer_Money"].ToString();
                }
            }
            con.Close();
        }
        private void getPatientPeriod(int patientAge)
        {
            SqlConnection con;
            SqlDataReader dataReader = Ezzat.GetDataReader("Period_Select_ByAge",
                                                           out con, new SqlParameter("@Patient_Age", patientAge));

            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    patientClass.set_patientPeriod((int)dataReader[0]);
                }
            }
            con.Close();
        }
        private void ShowDetailsProduct(int customer_ID)
        {
            SqlConnection con;
            SqlDataReader dataReader = Ezzat.GetDataReader("Product_selectSearch_BYID", out con, new SqlParameter("@Product_ID", customer_ID));


            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    txt_Price.Text = dataReader["Product_Price"].ToString();
                }
            }
            con.Close();
        }
Exemplo n.º 24
0
        private void ShowDetails(int value)
        {
            SqlConnection con;
            SqlDataReader dataReader = Ezzat.GetDataReader("selectSpasific_Bank", out con, new SqlParameter("@Customer_Id", value));


            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    tb_account.Text = dataReader["Bank_Account"].ToString();
                }
            }
            con.Close();
        }
Exemplo n.º 25
0
        private void ShowDetails(int customer_ID)
        {
            SqlConnection con;
            SqlDataReader dataReader = Ezzat.GetDataReader("Employee_selectSearch_BYID", out con, new SqlParameter("@Customer_Id", customer_ID));


            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    tb_money.Text = dataReader["emp_money"].ToString();
                }
            }
            con.Close();
        }
        private void ShowDetails_Supplier(int ID)
        {
            SqlConnection con;
            SqlDataReader dr = Ezzat.GetDataReader("selectSpasific_Supplier", out con, new SqlParameter("@Supplier_ID", ID));

            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    //Days_Number = int.Parse(dr["Number_Day"].ToString());
                    //tb_PaymentMethod.Text = dr["Payment_Method"].ToString();
                    tb_OldMoney.Text = dr["Total_Money"].ToString();
                    Calcolate();
                }
            }
            con.Close();
        }
Exemplo n.º 27
0
        private void FillBankAccounts(int value)
        {
            dataGridView1.Rows.Clear();
            SqlConnection con;
            SqlDataReader dataReader = Ezzat.GetDataReader("select_SupplierBankAccounts", out con, new SqlParameter("@Supplier_ID", value));


            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    dataGridView1.Rows.Add();
                    dataGridView1[0, dataGridView1.Rows.Count - 1].Value = dataReader[2].ToString();
                    dataGridView1[1, dataGridView1.Rows.Count - 1].Value = dataReader[3].ToString();
                }
            }
            con.Close();
        }
Exemplo n.º 28
0
        private void StartQuantity()
        {
            object o = Ezzat.ExecutedScalar("select_DayNumber", new SqlParameter("@DayDate", DateTime.Parse(DateTime.Now.ToString())));

            if (o == null)
            {
                o = Ezzat.ExecutedScalar("select_DayNumber_ID");
                if (o == null)
                {
                    o = "1";
                }
                else
                {
                    int i = int.Parse(o.ToString());
                    i++;
                    o = i;
                }



                SqlConnection con;

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

                if (dataReader.HasRows)
                {
                    while (dataReader.Read())
                    {
                        Ezzat.ExecutedNoneQuery("insert_StartQuantity",
                                                new SqlParameter("@Day_Number", o),
                                                new SqlParameter("@Product_ID", dataReader[0].ToString()),
                                                new SqlParameter("@StartDate", DateTime.Parse(DateTime.Now.ToString())),
                                                new SqlParameter("@StartQuantity", dataReader[1].ToString()),
                                                new SqlParameter("@Product_Type", dataReader[2].ToString()),
                                                new SqlParameter("@Product_Name", dataReader[3].ToString()),
                                                new SqlParameter("@Product_Unit", dataReader[4].ToString())
                                                );
                    }
                }

                con.Close();
            }
        }
        private void ShowDetailsPatient(int selectedValue)
        {
            SqlConnection con;
            SqlDataReader dataReader = Ezzat.GetDataReader("Patient_Select_All_BYID",
                                                           out con, new SqlParameter("@Patient_ID", selectedValue));


            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    string patient_Age    = dataReader["Patient_Age"].ToString();
                    string patient_Gender = dataReader["Patient_Gender"].ToString();
                    patientClass.set_patientAge(int.Parse(patient_Age));
                    patientClass.set_patientGender(bool.Parse(patient_Gender));
                }
            }
            con.Close();
        }
Exemplo n.º 30
0
        private void ShowDetails(int group_ID)
        {
            bt_edit.Enabled = true;
            bt_save.Enabled = false;

            SqlConnection con;
            SqlDataReader dataReader = Ezzat.GetDataReader("Group_Select_All_BYID",
                                                           out con, new SqlParameter("@Group_ID", group_ID));


            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    txt_Name.Text = dataReader["Group_Name"].ToString();
                }
            }
            con.Close();
        }