Esempio n. 1
0
        public DataTable GetID()
        {
            DataTable Dt = new DataTable();

            Dt = dal.selectData("get_id_for_service", null);
            dal.close();

            return(Dt);
        }
Esempio n. 2
0
        public DataTable searchINcostumer(string name)
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();
            SqlParameter[]      param        = new SqlParameter[1];

            param[0]       = new SqlParameter("@ref", SqlDbType.NVarChar, 50);
            param[0].Value = name;

            DataTable Dt = new DataTable();

            Dt = accessobject.selectData("search_in_customer", param);
            accessobject.close();

            //foreach (DataRow row in Dt.Rows)
            //{
            //    //  try
            //    //  {
            //    //    row["سعر الشراء"] = String.Format("{0:n0}", Convert.ToDouble(row["سعر الشراء"]));
            //    //
            //    //       row["سعر البيع"] = String.Format("{0:n0}", Convert.ToDouble(row["سعر البيع"]));
            //    //  }
            //    //   catch (Exception ex)
            //    //  {

            //    //  }
            //}


            return(Dt);
        }
Esempio n. 3
0
        /// <summary>
        /// intializing combo boxes data
        /// </summary>
        public void InitializeComBoxes()
        {
            // filling the LevelComboBox
            levels = new string[5] {
                "Level 1", "Level 2", "Level 3", "Level 4", "Level 5"
            };
            LevelComboBox.ItemsSource  = levels;
            LevelComboBox.SelectedItem = levels[0];

            // filling the KindComboBox
            DAL.DataAccessLayer data      = new DAL.DataAccessLayer();
            DataTable           dataTable = new DataTable();

            dataTable = data.selectData("getKinds", null);
            DataTableReader tableReader = new DataTableReader(dataTable);

            if (tableReader.HasRows)
            {
                HashSet <string> kinds = new HashSet <string>();
                while (tableReader.Read())
                {
                    kinds.Add(tableReader.GetString(0));
                }
                KindComboBox.ItemsSource = kinds;
            }
        }
        public DataTable sel_sumation(int id)
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();

            SqlParameter[] param = new SqlParameter[1];

            param[0]       = new SqlParameter("@mnth", SqlDbType.Int);
            param[0].Value = id;


            accessobject.open();
            DataTable Dt = new DataTable();

            Dt = accessobject.selectData("sel_sumation", param);
            accessobject.close();

            foreach (DataRow row in Dt.Rows)
            {
                try
                {
                    row["amount"] = String.Format("{0:n0}", Convert.ToDouble(row["amount"]));
                }
                catch
                {
                }
            }

            return(Dt);
        }
Esempio n. 5
0
        public DataTable BringSeedsByType(string type_name, string storid)
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();
            SqlParameter[]      param        = new SqlParameter[2];

            param[0]       = new SqlParameter("@type", SqlDbType.NVarChar, 50);
            param[0].Value = type_name;

            param[1]       = new SqlParameter("@store_id", SqlDbType.NVarChar, 50);
            param[1].Value = storid;

            DataTable Dt = new DataTable();

            Dt = accessobject.selectData("BringSeedsByType", param);
            accessobject.close();

            foreach (DataRow row in Dt.Rows)
            {
                row["purchasing_price"] = String.Format("{0:n0}", Convert.ToDouble(row["purchasing_price"]));
                row["selling_price"]    = String.Format("{0:n0}", Convert.ToDouble(row["selling_price"]));
            }


            return(Dt);
        }
Esempio n. 6
0
        public string auth(string UserName, string passcode)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[2];

            param[0]       = new SqlParameter("user_name", SqlDbType.NVarChar, 50);
            param[0].Value = UserName;

            param[1]       = new SqlParameter("pass_code", SqlDbType.NVarChar, 50);
            param[1].Value = passcode;
            DataTable Dt = new DataTable();

            Dt = DAL.selectData("auth_user", param);

            try
            {
                if (Dt.Rows[0][0].ToString() == UserName && Dt.Rows[0][1].ToString() == passcode)
                {
                    return(Dt.Rows[0][2].ToString());
                }
                else
                {
                    return("woring information");
                }
            }
            catch
            {
                return("woring information");
            }
        }
Esempio n. 7
0
        public DataTable GetStatementPeriod(string id, DateTime start, DateTime end)
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();
            DataTable           IdOfOoder    = new DataTable();

            IdOfOoder = getOrderOfCustomerP(id, start, end);
            DataTable result = new DataTable();

            if (IdOfOoder.Rows.Count > 0)
            {
                for (int i = 0; i <= IdOfOoder.Rows.Count - 1; i++)
                {
                    SqlParameter[] param = new SqlParameter[1];
                    String         invid = IdOfOoder.Rows[i][0].ToString();
                    param[0]       = new SqlParameter("@id", SqlDbType.NVarChar, 50);
                    param[0].Value = invid;



                    DataTable Dt = new DataTable();
                    Dt = accessobject.selectData("get_statement", param);
                    accessobject.close();

                    result.Merge(Dt);
                }
            }
            return(result);
        }
Esempio n. 8
0
        public DataTable GetDebtInfoforPrint(int id)
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();

            SqlParameter[] param = new SqlParameter[1];

            param[0]       = new SqlParameter("@id", SqlDbType.Int);
            param[0].Value = id;


            DataTable Dt = new DataTable();

            Dt = accessobject.selectData("getDebtInfo_for_print", param);
            accessobject.close();


            foreach (DataRow row in Dt.Rows)
            {
                try
                {
                    row["المبلغ"]      = String.Format("{0:n0}", Convert.ToDouble(row["المبلغ"]));
                    row["الدين الكلي"] = String.Format("{0:n0}", Convert.ToDouble(row["الدين الكلي"]));
                }
                catch
                {
                }
            }


            return(Dt);
        }
        public DataTable set_RepaymentForInvoice_in_the_tables(int inv_id, double recived, string Note)
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();

            SqlParameter[] param = new SqlParameter[4];

            param[0]       = new SqlParameter("@id", SqlDbType.Int);
            param[0].Value = inv_id;

            param[1]       = new SqlParameter("@mny", SqlDbType.Money);
            param[1].Value = recived;

            param[2]       = new SqlParameter("@dateT", SqlDbType.DateTime);
            param[2].Value = DateTime.Now;

            param[3]       = new SqlParameter("@debt_note", SqlDbType.NVarChar, 50);
            param[3].Value = Note;



            DataTable Dt = new DataTable();

            Dt = accessobject.selectData("set_RepaymentForInvoice_in_the_tables", param);
            accessobject.close();

            return(Dt);
        }
Esempio n. 10
0
        public DataTable serachOrders()
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();

            DataTable Dt = new DataTable();

            Dt = accessobject.selectData("serachOrders", null);
            accessobject.close();
            return(Dt);
        }
Esempio n. 11
0
        public DataTable getNotCashedOrder()
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();

            DataTable Dt = new DataTable();

            Dt = accessobject.selectData("getNotCashedOrder", null);
            accessobject.close();
            return(Dt);
        }
        public DataTable SelUsers()
        {
            DAL.open();
            DataTable Dt = new DataTable();

            Dt = DAL.selectData("select_users", null);
            DAL.close();

            return(Dt);
        }
Esempio n. 13
0
        public DataTable getIDforInvoice()
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();

            DataTable Dt = new DataTable();

            Dt = accessobject.selectData("getIDforInvoice", null);
            accessobject.close();

            return(Dt);
        }
Esempio n. 14
0
        public DataTable getLastInvoiceForPrint()
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();

            DataTable Dt = new DataTable();

            Dt = accessobject.selectData("getLastInvoiceForPrint", null);
            accessobject.close();

            return(Dt);
        }
        public DataTable getIDforDoc()
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();

            DataTable Dt = new DataTable();

            Dt = accessobject.selectData("get_id_for_doc", null);
            accessobject.close();

            return(Dt);
        }
        public DataTable fetchDocInfo()
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();

            DataTable Dt = new DataTable();

            Dt = accessobject.selectData("fetchDocInfo", null);
            accessobject.close();

            return(Dt);
        }
Esempio n. 17
0
        public DataTable getCustomerInfo()
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();

            DataTable Dt = new DataTable();

            Dt = accessobject.selectData("getCustomerInfo", null);
            accessobject.close();

            return(Dt);
        }
Esempio n. 18
0
        public DataTable getOrdrrDetails(int order_id)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DataTable           dt  = new DataTable();

            SqlParameter[] param = new SqlParameter[1];
            param[0]       = new SqlParameter("@order_id", SqlDbType.Int);
            param[0].Value = @order_id;
            dt             = DAL.selectData("getOrdrrDetails", param);
            DAL.close();
            return(dt);
        }
Esempio n. 19
0
        public DataTable listinvo()
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();

            DataTable Dt = new DataTable();

            Dt = accessobject.selectData("listinvo", null);
            accessobject.close();


            return(Dt);
        }
Esempio n. 20
0
        public DataTable selExpenses() // selection Expenses
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();

            DataTable Dt = new DataTable();

            Dt = accessobject.selectData("selExpenses", null);
            accessobject.close();


            return(Dt);
        }
Esempio n. 21
0
        public DataTable sel_last_month()
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();

            accessobject.open();
            DataTable Dt = new DataTable();

            Dt = accessobject.selectData("sel_last_month", null);
            accessobject.close();

            return(Dt);
        }
Esempio n. 22
0
        public DataTable fetchSeasonsNames()
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();

            DataTable Dt = new DataTable();

            Dt = accessobject.selectData("fetchSeasonsNames", null);
            accessobject.close();


            return(Dt);
        }
Esempio n. 23
0
        public DataTable selSalary() // selection Salary
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();

            DataTable Dt = new DataTable();

            Dt = accessobject.selectData("selSalary", null);
            accessobject.close();


            return(Dt);
        }
Esempio n. 24
0
        public DataTable verifyProduct(int mat_no)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DataTable           dt  = new DataTable();

            SqlParameter[] param = new SqlParameter[1];
            param[0]       = new SqlParameter("@mat_no", SqlDbType.NVarChar, 50);
            param[0].Value = mat_no;
            dt             = DAL.selectData("virifyProduct", param);
            DAL.close();
            return(dt);
        }
Esempio n. 25
0
        public DataTable searchProduct(string mat_name)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DataTable           dt  = new DataTable();

            SqlParameter[] param = new SqlParameter[1];
            param[0]       = new SqlParameter("mat_name", SqlDbType.NVarChar, 50);
            param[0].Value = mat_name;
            dt             = DAL.selectData("searchProduct", param);
            DAL.close();
            return(dt);
        }
        public DataTable GetStatementPeriod(string customerIdentity, DateTime start, DateTime end)
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();
            DataTable           IdsOfOrder   = new DataTable();

            IdsOfOrder = getOrderOfCustomerP(customerIdentity, start, end);
            DataTable result = new DataTable();

            if (IdsOfOrder.Rows.Count > 0)
            {
                for (int i = 0; i <= IdsOfOrder.Rows.Count - 1; i++)
                {
                    SqlParameter[] param = new SqlParameter[4];
                    String         invid = IdsOfOrder.Rows[i][0].ToString();
                    param[0]       = new SqlParameter("@id", SqlDbType.NVarChar, 50);
                    param[0].Value = invid;

                    param[1]       = new SqlParameter("@start", SqlDbType.DateTime);
                    param[1].Value = start;

                    param[2]       = new SqlParameter("@end", SqlDbType.DateTime);
                    param[2].Value = end;

                    param[3]       = new SqlParameter("@customer_id", SqlDbType.NVarChar, 50);
                    param[3].Value = customerIdentity;



                    DataTable Dt = new DataTable();
                    Dt = accessobject.selectData("get_statement_with_date", param);
                    accessobject.close();

                    result.Merge(Dt);
                }
            }

            foreach (DataRow row in result.Rows)
            {
                try
                {
                    row["العسر الاساسي"] = String.Format("{0:n0}", Convert.ToDouble(row["العسر الاساسي"]));
                    row["المبلغ"]        = String.Format("{0:n0}", Convert.ToDouble(row["المبلغ"]));
                    //row["من"] = start;
                    //row["الى"] = end;
                    row["الدين الكلي"] = String.Format("{0:n0}", Convert.ToDouble(row["الدين الكلي"]));
                }
                catch
                {
                }
            }
            return(result);
        }
Esempio n. 27
0
        public DataTable ReturnAllDebt()
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();



            DataTable Dt = new DataTable();

            Dt = accessobject.selectData("return_all_debt", null);
            accessobject.close();

            return(Dt);
        }
        public DataTable SelectRole()
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();



            DataTable Dt = new DataTable();

            Dt = accessobject.selectData("select_role", null);
            accessobject.close();

            return(Dt);
        }
Esempio n. 29
0
        /// <summary>
        /// filling the Grid View
        /// </summary>
        public void FillDataGrid()
        {
            DAL.DataAccessLayer data = new DAL.DataAccessLayer();

            DataTable dataTable = new DataTable();

            dataTable = data.selectData("getAllQuestions", null);

            DataTableReader tableReader = new DataTableReader(dataTable);

            tableReader.Read();

            QuestionDataGridView.ItemsSource = tableReader;
        }
Esempio n. 30
0
        public DataTable showOrderDit(int invID)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DataTable           dt  = new DataTable();

            SqlParameter[] param = new SqlParameter[1];

            param[0]       = new SqlParameter("@invID", SqlDbType.Int);
            param[0].Value = invID;

            dt = DAL.selectData("showOrderDit", param);
            DAL.close();
            return(dt);
        }