public void ADD_RECEIPT_ITEM(
            string pname,
            int pid,
            double pprice,
            int pcount,
            double pdiscount,
            double ptotal,
            double finall_total,
            string receipt_no)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();
            //
            MySqlParameter[] param = new MySqlParameter[9];
            param[0] = new MySqlParameter("_R_ITEM_NAME", pname);
            param[1] = new MySqlParameter("_R_ITEM_PRODUCT_ID", pid);
            param[2] = new MySqlParameter("_R_ITEM_PRICE", pprice);
            param[3] = new MySqlParameter("_R_ITEM_COUNT", pcount);
            param[4] = new MySqlParameter("_R_ITEM_DISCOUNT", pdiscount);
            param[5] = new MySqlParameter("_R_ITEM_TOTAL", ptotal);
            param[6] = new MySqlParameter("_R_ITEM_FINAL_TOTAL", finall_total);
            param[7] = new MySqlParameter("_R_INFO_NO", receipt_no);
            param[8] = new MySqlParameter("_R_ITEM_CRETED_AT", DateTime.Now);

            DAL.ExecuteCommand("ADD_RECEIPT_ITEMS", param);
            DAL.CloseConnection();
        }
 public void DELETE_DEVICE(int r_id)
 {
     DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
     DAL.OpenConnection();
     MySqlParameter[] param = new MySqlParameter[1];
     param[0] = new MySqlParameter("_R_ID", r_id);
     DAL.ExecuteCommand("DELETE_DEVICE", param);
     DAL.CloseConnection();
 }
Ejemplo n.º 3
0
        public void DELETE_PRODUCT(int p_id)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();

            MySqlParameter[] param = new MySqlParameter[1];
            param[0] = new MySqlParameter("_P_ID", p_id);
            DAL.ExecuteCommand("DELETE_PRODUCT", param);
            DAL.CloseConnection();
        }
        public DataTable GET_ALL_CATEGORIES()
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();
            DataTable dt = new DataTable();

            dt = DAL.SelectData("GET_ALL_CATEGORIES", null);
            DAL.CloseConnection();
            return(dt);
        }
        public DataTable GET_ALL_RECEIPT_ITEMS()
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();
            DataTable dt = new DataTable();

            dt = DAL.SelectData("ADD_RECEIPT_ITEMS", null);
            DAL.CloseConnection();
            return(dt);
        }
        public DataTable GET_ALL_REPAIRING()
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();
            DataTable dt = new DataTable();

            dt = DAL.SelectData("GET_ALL_DEVICE_REPAIRING", null);
            DAL.CloseConnection();
            return(dt);
        }
        public DataTable GET_CLIENTS_ACC_DEBIT_STATISTICS()
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();
            DataTable dt = new DataTable();

            dt = DAL.SelectData("GET_CLIENTS_ACC_DEBIT_STATISTICS", null);
            DAL.CloseConnection();
            return(dt);
        }
        public DataTable GET_ACOUNT_RECEIPT_ITEMS(string code)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();
            MySqlParameter[] param = new MySqlParameter[1];
            param[0] = new MySqlParameter("_A_R_INFO_CODE", code);
            DataTable dt = new DataTable();

            dt = DAL.SelectData("GET_ACOUNT_RECEIPT_ITEMS", param);
            DAL.CloseConnection();
            return(dt);
        }
Ejemplo n.º 9
0
        public DataTable GET_PRODUCT_IMAGE(int p_id)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();
            MySqlParameter[] param = new MySqlParameter[1];
            param[0] = new MySqlParameter("_P_ID", p_id);
            DataTable dt = new DataTable();

            dt = DAL.SelectData("GET_PRODUCT_IMAGE", param);
            DAL.CloseConnection();
            return(dt);
        }
Ejemplo n.º 10
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //

        public DataTable CHECk_IS_BARCODE_EXISTS(string barcode)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();
            MySqlParameter[] param = new MySqlParameter[1];
            param[0] = new MySqlParameter("_P_BARCODE", barcode);
            DataTable dt = new DataTable();

            dt = DAL.SelectData("CHECk_IS_BARCODE_EXISTS", param);
            DAL.CloseConnection();
            return(dt);
        }
Ejemplo n.º 11
0
        public DataTable GET_ALL_PRODUCTS(bool is_item_inner)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();
            MySqlParameter[] param = new MySqlParameter[1];
            param[0] = new MySqlParameter("_P_IS_ITEM_INNER", is_item_inner);
            DataTable dt = new DataTable();

            dt = DAL.SelectData("GET_ALL_PRODUCTS", param);
            DAL.CloseConnection();
            return(dt);
        }
        public DataTable SEARCH_REPAIRING(string r_o_phone)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();
            MySqlParameter[] param = new MySqlParameter[1];
            param[0] = new MySqlParameter("_R_OWNER_PHONE", r_o_phone);
            DataTable dt = new DataTable();

            dt = DAL.SelectData("SEARCH_REPAIRING", param);
            DAL.CloseConnection();
            return(dt);
        }
        public void UPDATE_PASSWORD(int id, string newPass)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();

            MySqlParameter[] param = new MySqlParameter[2];

            param[0] = new MySqlParameter("_ID", id);
            param[1] = new MySqlParameter("_NEW_PASS", newPass);
            DAL.ExecuteCommand("UPDATE_PASSWORD", param);
            DAL.CloseConnection();
        }
        public DataTable CHECK_PASSWORD(string old_pass)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();
            MySqlParameter[] param = new MySqlParameter[1];
            param[0] = new MySqlParameter("_OLD_PASS", old_pass);
            DataTable dt = new DataTable();

            dt = DAL.SelectData("CHECK_PASSWORD", param);
            DAL.CloseConnection();
            return(dt);
        }
        public DataTable SEARCH_RECEIPT_ITEMS(string r_no)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();
            MySqlParameter[] param = new MySqlParameter[1];
            param[0] = new MySqlParameter("_R_I_NO", r_no);
            DataTable dt = new DataTable();

            dt = DAL.SelectData("SEARCH_RECEIPT_ITEMS", param);
            DAL.CloseConnection();
            return(dt);
        }
        public DataTable CHECk_IS_CATEGORY_EXISTS(string c_name)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();
            MySqlParameter[] param = new MySqlParameter[1];
            param[0] = new MySqlParameter("_C_NAME", c_name);
            DataTable dt = new DataTable();

            dt = DAL.SelectData("CHECk_IS_CATEGORY_EXISTS", param);
            DAL.CloseConnection();
            return(dt);
        }
        //public DataTable GET_ALL_ACCOUNTS_CASH()
        //{
        //    DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
        //    DAL.OpenConnection();
        //    DataTable dt = new DataTable();
        //    dt = DAL.SelectData("GET_ALL_ACOUNT_RECEIPT_INFO", null);
        //    DAL.CloseConnection();
        //    return dt;
        //}

        public DataTable GET_ALL_ACCOUNT_CASH(int a_id)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();
            MySqlParameter[] param = new MySqlParameter[1];
            param[0] = new MySqlParameter("_C_ID", a_id);
            DataTable dt = new DataTable();

            dt = DAL.SelectData("GET_ALL_ACCOUNT_CASH", param);
            DAL.CloseConnection();
            return(dt);
        }
Ejemplo n.º 18
0
        public DataTable SEARCH_PRODUCT(string p_name)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();
            MySqlParameter[] param = new MySqlParameter[1];
            param[0] = new MySqlParameter("_P_NAME", p_name);
            DataTable dt = new DataTable();

            dt = DAL.SelectData("SEARCH_PRODUCT", param);
            DAL.CloseConnection();
            return(dt);
        }
Ejemplo n.º 19
0
        public DataTable CHECK_IS_PRODUCT_TYPE_AND_NAME(string p_name, bool is_inner)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();
            MySqlParameter[] param = new MySqlParameter[2];
            param[0] = new MySqlParameter("_P_NAME", p_name);
            param[1] = new MySqlParameter("_P_IS_ITEM_INNER", is_inner);
            DataTable dt = new DataTable();

            dt = DAL.SelectData("CHECK_IS_PRODUCT_TYPE_AND_NAME", param);
            DAL.CloseConnection();
            return(dt);
        }
        public void ADD_CATEGORY(string name, string deskripition)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();

            MySqlParameter[] param = new MySqlParameter[2];

            param[0] = new MySqlParameter("_C_NAME", name);
            param[1] = new MySqlParameter("_C_DESKRIPTION", deskripition);

            DAL.ExecuteCommand("ADD_CATEGORY", param);
            DAL.CloseConnection();
        }
Ejemplo n.º 21
0
        public DataTable CHECK_IS_PRODUCT_EXISTS(string p_name, bool i_code)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();
            MySqlParameter[] param = new MySqlParameter[2];
            param[0] = new MySqlParameter("_P_NAME", p_name);
            param[1] = new MySqlParameter("_P_BARCODE", i_code);
            DataTable dt = new DataTable();

            dt = DAL.SelectData("CHECK_IS_PRODUCT_EXISTS", param);
            DAL.CloseConnection();
            return(dt);
        }
Ejemplo n.º 22
0
        public DataTable SEARCH_PRODUCT_BARCODE(bool is_inner, string p_barcode)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();
            MySqlParameter[] param = new MySqlParameter[2];
            param[0] = new MySqlParameter("_P_BARCODE", p_barcode);
            param[1] = new MySqlParameter("_P_IS_ITEM_INNER", is_inner);
            DataTable dt = new DataTable();

            dt = DAL.SelectData("SEARCH_PRODUCT_BARCODE", param);
            DAL.CloseConnection();
            return(dt);
        }
        public DataTable GET_ALL_CLIENTS_ACCOUNT(string acc_type)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();

            MySqlParameter[] param = new MySqlParameter[1];
            param[0] = new MySqlParameter("_A_TYPE", acc_type);

            DataTable dt = new DataTable();

            dt = DAL.SelectData("GET_ALL_CLIENTS_ACCOUNT", param);
            DAL.CloseConnection();
            return(dt);
        }
        public void ADD_ACOUNT_RECEIPT_INFO(int c_a_id, string c_name, double total, string code)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();

            MySqlParameter[] param = new MySqlParameter[5];

            param[0] = new MySqlParameter("_C_ACOUNT_ID", c_a_id);
            param[1] = new MySqlParameter("_C_ANAME", c_name);
            param[2] = new MySqlParameter("_R_TOTAL", total);
            param[3] = new MySqlParameter("_R_CODE", code);
            param[4] = new MySqlParameter("_R_CREATED_AT", DateTime.Now);

            DAL.ExecuteCommand("ADD_ACOUNT_RECEIPT_INFO", param);
            DAL.CloseConnection();
        }
        public void ADD_RECEIPT_INFO(string name, string phone, double total, double dis_total, string receipt_no)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();

            MySqlParameter[] param = new MySqlParameter[7];

            param[0] = new MySqlParameter("_R_I_NAME", name);
            param[1] = new MySqlParameter("_R_I_PHONE", phone);
            param[2] = new MySqlParameter("_R_I_TOTAL", total);
            param[3] = new MySqlParameter("_R_I_DISCOUNT", dis_total);
            param[4] = new MySqlParameter("_R_I_NO", receipt_no);
            param[5] = new MySqlParameter("_R_I_TYPE", "مبيعات");
            param[6] = new MySqlParameter("_R_I_CREATED_AT", DateTime.Now);
            DAL.ExecuteCommand("ADD_RECEIPT_INFO", param);
            DAL.CloseConnection();
        }
        public void UPDATE_CLIENT_ACCOUNT(int id, string store_name, string c_name, int c_phone, string a_type, string desk)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();

            MySqlParameter[] param = new MySqlParameter[6];

            param[0] = new MySqlParameter("_A_ID", id);
            param[1] = new MySqlParameter("_A_STORE_NAME", store_name);
            param[2] = new MySqlParameter("_A_C_NAME", c_name);
            param[3] = new MySqlParameter("_A_C_PHONE", c_phone);
            param[4] = new MySqlParameter("_A_TYPE", a_type);
            param[5] = new MySqlParameter("_A_DESKRIPTION", desk);

            DAL.ExecuteCommand("UPDATE_CLIENT_ACCOUNT", param);
            DAL.CloseConnection();
        }
        public void ADD_CASH_TO_ACC(int c_a_id, string c_type, string c_name, double total, string note)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();

            MySqlParameter[] param = new MySqlParameter[6];

            param[0] = new MySqlParameter("_C_ACOUNT_ID", c_a_id);
            param[1] = new MySqlParameter("_C_ACC_TYPE", c_type);
            param[2] = new MySqlParameter("_C_ANAME", c_name);
            param[3] = new MySqlParameter("_C_CASH_TOTAL", total);
            param[4] = new MySqlParameter("_C_NOTE", note);
            param[5] = new MySqlParameter("_C_CREATED_AT", DateTime.Now);

            DAL.ExecuteCommand("ADD_CASH_TO_ACC", param);
            DAL.CloseConnection();
        }
        public DataTable LOGIN(string U_NAME, string PWD)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();

            MySqlParameter[] param = new MySqlParameter[2];

            param[0] = new MySqlParameter("_U_NAME", U_NAME);

            param[1] = new MySqlParameter("_PWD", PWD);

            DAL.OpenConnection();

            DataTable dt = new DataTable();

            dt = DAL.SelectData("SP_LOGIN", param);
            DAL.CloseConnection();
            return(dt);
        }
Ejemplo n.º 29
0
        public void UPDATE_PRODUCT(int id, string name, string deskripition, int quantatiy, double price, double buy_price, string barcode, int cate_id)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();

            MySqlParameter[] param = new MySqlParameter[8];

            param[0] = new MySqlParameter("_P_ID", id);
            param[1] = new MySqlParameter("_P_NAME", name);
            param[2] = new MySqlParameter("_P_DESKRIPTION", deskripition);
            param[3] = new MySqlParameter("_P_QUAANITY", quantatiy);
            param[4] = new MySqlParameter("_P_PRICE", price);
            param[5] = new MySqlParameter("_P_BUY_PRICE", buy_price);
            param[6] = new MySqlParameter("_P_BARCODE", barcode);
            param[7] = new MySqlParameter("_P_CATE_ID", cate_id);
            DAL.ExecuteCommand("UPDATE_PRODUCT", param);
            DAL.CloseConnection();
        }
Ejemplo n.º 30
0
        public void UPDATE_PRODUCT(int id, string name, double price, double s_price, int quantatiy, string deskripition, string barcode, int cat_id, bool is_item_inner)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.OpenConnection();

            MySqlParameter[] param = new MySqlParameter[9];

            param[0] = new MySqlParameter("_P_ID", id);
            param[1] = new MySqlParameter("_P_NAME", name);
            param[2] = new MySqlParameter("_P_PRICE", price);
            param[3] = new MySqlParameter("_P_PRICE_SELL", s_price);
            param[4] = new MySqlParameter("_P_QUANTITY", quantatiy);
            param[5] = new MySqlParameter("_P_DESKRIPTION", deskripition);
            param[6] = new MySqlParameter("_P_BARCODE", barcode);
            param[7] = new MySqlParameter("_P_CATE_ID", cat_id);
            param[8] = new MySqlParameter("_P_IS_ITEM_INNER", is_item_inner);

            DAL.ExecuteCommand("UPDATE_PRODUCT", param);
            DAL.CloseConnection();
        }