Ejemplo n.º 1
0
        /*
         * public DataTable debtRepayment(int customerID)
         * {
         *  DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();
         *  SqlParameter[] param = new SqlParameter[1];
         *
         *  param[0] = new SqlParameter("@customerID", SqlDbType.Int);
         *  param[0].Value = customerID;
         *
         *  accessobject.open();
         *
         *
         *  DataTable Dt = new DataTable();
         *  Dt = accessobject.selectData("debtRepayment", param);
         *  accessobject.close();
         *
         *  return Dt;
         *
         * }
         *
         * public void updateDeptInOrderTable(int invID, int dept,string isCashed)
         * {
         *  DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
         *  DAL.open();
         *  SqlParameter[] param = new SqlParameter[3];
         *
         *  param[0] = new SqlParameter("@invID", SqlDbType.Int);
         *  param[0].Value = invID;
         *
         *  param[1] = new SqlParameter("@orderDept", SqlDbType.Int);
         *  param[1].Value = dept;
         *
         *  param[2] = new SqlParameter("@isCashed", SqlDbType.NVarChar,32);
         *  param[2].Value = isCashed;
         *
         *
         *
         *  DAL.Executecmd("REP", param);
         *  DAL.close();
         * }
         */

        public void updateDeptInDeptTable(int invID, int dept)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[2];

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

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



            DAL.Executecmd("updateDeptInDeptTable", param);
            DAL.close();
        }
Ejemplo n.º 2
0
        public void insertNewDept(int customerID, int dept)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[2];

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

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



            DAL.Executecmd("insertNewDept", param);
            DAL.close();
        }
Ejemplo n.º 3
0
        public void UPDATE_Program(string name, string type, int program_code)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[3];
            param[0]       = new SqlParameter("@name", SqlDbType.VarChar, 50);
            param[0].Value = name;

            param[1]       = new SqlParameter("@type", SqlDbType.VarChar, 50);
            param[1].Value = type;

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

            DAL.ExectCommand("UPDATE_Program", param);
            DAL.close();
        }
Ejemplo n.º 4
0
        public DataTable GET_USER_ID(string user_name)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();

            SqlParameter[] param = new SqlParameter[1];

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


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

            Dt = DAL.SelectData("GET_USER_ID", param);
            DAL.close();
            return(Dt);
        }
Ejemplo n.º 5
0
        public void ADD_CONTIENT(string REF, int NO_FACTURE, int QUT_CD)
        {
            DAL.DataAccessLayer dal = new DAL.DataAccessLayer();
            dal.open();

            SqlParameter[] param = new SqlParameter[3];

            param[0]       = new SqlParameter("@REF", SqlDbType.VarChar, 50);
            param[0].Value = REF;
            param[1]       = new SqlParameter("@NO_FACTURE", SqlDbType.Int);
            param[1].Value = NO_FACTURE;
            param[2]       = new SqlParameter("@QUT_CD", SqlDbType.Int);
            param[2].Value = QUT_CD;

            dal.ExecutCommand("ADD_CONTIENT", param);
            dal.close();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// not uses right now
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public DataTable selectID(DataTable name)
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();
            accessobject.open();
            SqlParameter[] param = new SqlParameter[1];

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


            DataTable Dt = new DataTable();

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

            return(Dt);
        }
Ejemplo n.º 7
0
        public void add_comp_order(string compName, double amount)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[2];


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

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


            DAL.Executecmd("add_comp_order", param);
            DAL.close();
        }
Ejemplo n.º 8
0
        public DataTable GET_ALL_DIS(int user_id)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();

            SqlParameter[] param = new SqlParameter[1];

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


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

            Dt = DAL.SelectData("GET_ALL_DIS", param);
            DAL.close();
            return(Dt);
        }
Ejemplo n.º 9
0
        public void set_Seasonal_disbursements(int season_id, double moneyOf)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[2];

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

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



            DAL.Executecmd("set_Seasonal_disbursements", param);
            DAL.close();
        }
Ejemplo n.º 10
0
        public void ADD_ARTICLE(string REF, string DESIGNATION, decimal PU, int QS)
        {
            DAL.DataAccessLayer dal   = new DAL.DataAccessLayer();
            SqlParameter[]      param = new SqlParameter[4];
            dal.open();

            param[0]       = new SqlParameter("@REF", SqlDbType.VarChar, 50);
            param[0].Value = REF;
            param[1]       = new SqlParameter("@DESIGNATION", SqlDbType.VarChar, 50);
            param[1].Value = DESIGNATION;
            param[2]       = new SqlParameter("@PU", SqlDbType.Float);
            param[2].Value = PU;
            param[3]       = new SqlParameter("@QUT_ST", SqlDbType.Int);
            param[3].Value = QS;

            dal.ExecutCommand("ADD_ARTICLE", param);
            dal.close();
        }
Ejemplo n.º 11
0
        public void insExpenses(string name, double salary, DateTime dateT)
        {
            DAL.DataAccessLayer DAL   = new DAL.DataAccessLayer();
            SqlParameter[]      param = new SqlParameter[3];

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

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

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

            DAL.open();
            DAL.Executecmd("insExpenses", param);
            DAL.close();
        }
Ejemplo n.º 12
0
        public void UpdateCatName(string catName, int id, string OldName)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[3];

            param[0]       = new SqlParameter("@new_name", SqlDbType.VarChar, 50);
            param[0].Value = catName;

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

            param[2]       = new SqlParameter("@old_name", SqlDbType.NVarChar, 50);
            param[2].Value = OldName;

            DAL.Executecmd("update_cat_name", param);
            DAL.close();
        }
Ejemplo n.º 13
0
        public DataTable cheackDept(int customerID)
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();
            SqlParameter[]      param        = new SqlParameter[1];

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

            accessobject.open();


            DataTable Dt = new DataTable();

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

            return(Dt);
        }
Ejemplo n.º 14
0
        public string get_priv(string name, string pass)
        {
            SqlParameter[] para = new SqlParameter[2];
            para[0]       = new SqlParameter("@name", SqlDbType.VarChar, 50);
            para[0].Value = name;

            para[1]       = new SqlParameter("@pass", SqlDbType.VarChar, 50);
            para[1].Value = pass;

            DAL.open();
            string re = DAL.SelectData_value("get_priv_login", para);



            return(re);

            DataTable DT = new DataTable();
        }
Ejemplo n.º 15
0
        public DataTable fetchCurrentSeasons()
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();
            accessobject.open();
            SqlParameter[] param = new SqlParameter[1];

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


            DataTable Dt = new DataTable();

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


            return(Dt);
        }
        public DataTable LOGIN(string ID, string PWD)
        {
            DAL.DataAccessLayer DAL  = new DAL.DataAccessLayer();
            SqlParameter []     parm = new SqlParameter[2];
            parm[0]       = new SqlParameter("@ID", SqlDbType.NVarChar, 50);
            parm[0].Value = ID;

            parm[1]       = new SqlParameter("@PWD", SqlDbType.NVarChar, 50);
            parm[1].Value = PWD;

            DAL.open();

            DataTable dt = new DataTable();

            dt = DAL.SelectData("SP_LOGIN1", parm);
            DAL.close();
            return(dt);
        }
Ejemplo n.º 17
0
        // اجراء لاضافة البيانات لقاعدة البيانات
        public void ADD_SPEND(string cat_code, DateTime spend_date, int dep_id)

        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[3];
            param[0]       = new SqlParameter("@spend_code", SqlDbType.NVarChar, 50);
            param[0].Value = cat_code;

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

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

            DAL.ExcuteCommand("ADD_SPEND", param);
            DAL.close();
        }
Ejemplo n.º 18
0
        public void insSeasons(string SeasonName, DateTime Start_Date, DateTime Expiry_date)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[3];

            param[0]       = new SqlParameter("@season_name", SqlDbType.VarChar, 50);
            param[0].Value = SeasonName;

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

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

            DAL.Executecmd("insSeasons", param);
            DAL.close();
        }
Ejemplo n.º 19
0
        public DataTable sel_chas(int id)
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();

            SqlParameter[] param = new SqlParameter[1];

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


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

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

            return(Dt);
        }
Ejemplo n.º 20
0
        public void setDirCompaniesRep(string comp_name, double moneyOf)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[3];

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

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

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


            DAL.Executecmd("setDirCompaniesRep", param);
            DAL.close();
        }
Ejemplo n.º 21
0
        public DataTable Update_users(int userID, string userName, string PSW, string user_type)
        {
            DAL.DataAccessLayer DAL   = new DAL.DataAccessLayer();
            SqlParameter[]      param = new SqlParameter[4];
            param[0]       = new SqlParameter("@userName", SqlDbType.VarChar, 50);
            param[0].Value = userName;
            param[1]       = new SqlParameter("@password", SqlDbType.VarChar, 50);
            param[1].Value = PSW;
            param[2]       = new SqlParameter("@type", SqlDbType.VarChar, 50);
            param[2].Value = user_type;
            param[3]       = new SqlParameter("@userID", SqlDbType.Int);
            param[3].Value = userID;

            DAL.open();
            DataTable dt = new DataTable();

            dt = DAL.SelectData("Update_Existusers", param);
            return(dt);
        }
Ejemplo n.º 22
0
        public void ADD_intake(string name, int num, string year)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[3];
            param[0]       = new SqlParameter("@name", SqlDbType.VarChar);
            param[0].Value = name;

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

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



            DAL.ExectCommand("Add_intake", param);
            DAL.close();
        }
Ejemplo n.º 23
0
        // اجراء اضافة

        public void ADD_UNITS(string unit_name, string code_ar = null, string code_en = null)

        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[3];

            param[0]       = new SqlParameter("@unit_name", SqlDbType.VarChar, 50);
            param[0].Value = unit_name;

            param[1]       = new SqlParameter("@unit_code_ar", SqlDbType.VarChar, 50);
            param[1].Value = code_ar;

            param[2]       = new SqlParameter("@unit_code_en", SqlDbType.VarChar, 50);
            param[2].Value = code_en;

            DAL.ExcuteCommand("ADD_UNITS", param);
            DAL.close();
        }
Ejemplo n.º 24
0
        public void ADD_USERS(string user_name, string password, int priv_code)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[3];
            param[0]       = new SqlParameter("@user_name", SqlDbType.NVarChar);
            param[0].Value = user_name;



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

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

            DAL.ExectCommand("Add_USER", param);
            DAL.close();
        }
Ejemplo n.º 25
0
        public DataTable SP_LOGIN(string user_name, string password)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();

            SqlParameter[] param = new SqlParameter[2];

            param[0]       = new SqlParameter("@username", SqlDbType.VarChar, 50);
            param[0].Value = user_name;

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

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

            Dt = DAL.SelectData("SP_LOGIN", param);
            DAL.close();
            return(Dt);
        }
Ejemplo n.º 26
0
        public DataTable search_priv(int user_id, int list_id)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();

            SqlParameter[] param = new SqlParameter[2];

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

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

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

            Dt = DAL.SelectData("search_priv", param);
            DAL.close();
            return(Dt);
        }
        public void ADD_MONTH_YEAR_CUSTOMER(int ID, string MONTH, string YEAR)

        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] parm = new SqlParameter[3];

            parm[0]       = new SqlParameter("@ID_CUSTOMER", SqlDbType.Int);
            parm[0].Value = ID;

            parm[1]       = new SqlParameter("@MONTH", SqlDbType.NVarChar, 50);
            parm[1].Value = MONTH;

            parm[2]       = new SqlParameter("@YEAR", SqlDbType.NVarChar, 50);
            parm[2].Value = YEAR;

            DAL.ExecuteCommand("ADD_MONTH_YEAR_CUSTOMER", parm);
            DAL.close();
        }
Ejemplo n.º 28
0
        public void insertCus(int CustomerNo, string name, string phone)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[3];

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

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

            param[2]       = new SqlParameter("@phone", SqlDbType.NVarChar, 50);
            param[2].Value = phone;



            DAL.Executecmd("insertCustomer", param);
            DAL.close();
        }
Ejemplo n.º 29
0
        public void set_new_month()
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();
            SqlParameter[]      param        = new SqlParameter[3];

            param[0]       = new SqlParameter("@year", SqlDbType.Int);
            param[0].Value = DateTime.Now.Year;

            param[1]       = new SqlParameter("@month", SqlDbType.Int);
            param[1].Value = DateTime.Now.Month;

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

            accessobject.open();


            accessobject.Executecmd("set_new_month", param);
            accessobject.close();
        }
Ejemplo n.º 30
0
        public void updateCustomerInfo(int CustomerNo, string name, string phone)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[3];

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

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

            param[2]       = new SqlParameter("@PHONE", SqlDbType.NVarChar, 50);
            param[2].Value = phone;



            DAL.Executecmd("updateCustomerInfo", param);
            DAL.close();
        }