public void UPDATE_CUSTOMER(string fname, string lname,
                                    string tel, string email, int id)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] parm = new SqlParameter[5];

            parm[0]       = new SqlParameter("@F_NAME", SqlDbType.NVarChar, 50);
            parm[0].Value = fname;

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

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

            parm[3]       = new SqlParameter("@EMAIL", SqlDbType.NVarChar, 50);
            parm[3].Value = email;

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



            DAL.ExecuteCommand("UPDATE_CUSTOMER", parm);
            DAL.close();
        }
Пример #2
0
        public void ADD_ORDERS(int id_order, DateTime date_time,
                               int cust_id, string desc_ord, string sales_man)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] parm = new SqlParameter[5];

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

            parm[1]       = new SqlParameter("@DATE_ORD", SqlDbType.DateTime);
            parm[1].Value = date_time;

            parm[2]       = new SqlParameter("@CUST_ID", SqlDbType.Int);
            parm[2].Value = cust_id;

            parm[3]       = new SqlParameter("@DESC_ORD", SqlDbType.NVarChar, 75);
            parm[3].Value = desc_ord;

            parm[4]       = new SqlParameter("@SALES_MAN", SqlDbType.NVarChar, 50);
            parm[4].Value = sales_man;


            DAL.ExecuteCommand("ADD_ORDERS", parm);
            DAL.close();
        }
Пример #3
0
        public void UPDATE_Exam(int course_code, int doctor_code, int Intake_code, string date_Exam, string date_resetExam, string path, int id)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[7];
            param[0]       = new SqlParameter("@course_code", SqlDbType.Int);
            param[0].Value = course_code;

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

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

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

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

            param[5]       = new SqlParameter("@path", SqlDbType.VarChar);
            param[5].Value = path;



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

            DAL.ExectCommand("UPDATE_Exam", param);
            DAL.close();
        }
Пример #4
0
        public DataTable searchMat(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("searchMat", 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);
        }
Пример #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);
        }
        //public void UpdateDebts(string CustomerId, string NewTotal, string NewReceived , string OldTotal,string OldRec)
        //{
        //    DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();

        //    SqlParameter[] param = new SqlParameter[3];

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


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


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

        //    param[3] = new SqlParameter("@old_total", SqlDbType.NVarChar, 50);
        //    param[3].Value = OldTotal;


        //    param[4] = new SqlParameter("@old_received", SqlDbType.NVarChar, 50);
        //    param[4].Value =OldRec;


        //    accessobject.Executecmd("delete_debts_on_update_invoice", param);
        //    accessobject.close();



        //}

        public void UpdateDebts(string CustomerId, string OrderID, string debt_value, Double MoneyOf, DateTime Dt)
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();

            SqlParameter[] param = new SqlParameter[5];

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


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


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

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

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



            accessobject.open();
            accessobject.Executecmd("delete_debts_on_update_invoice", param);
            accessobject.close();
        }
Пример #7
0
        /*************************************** UPDATE **************************************************/

        // اجراء لاضافة البيانات لقاعدة البيانات
        public void UPDATE_CUSTOMER(string cust_code, string cust_name, int cust_phone,
                                    string cust_addrees /*, Boolean cust_status*/)

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

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

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

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

            //param[4] = new SqlParameter("@cust_status", SqlDbType.Bit);
            //param[4].Value = cust_status;


            DAL.ExcuteCommand("UPDATE_CUSTOMER", param);
            DAL.close();
        }
        public void UPDATE_Registered_Student(string TOEFL, string Specialization, string Worked_Fulltime, string document_path, int Intake_code, string accepted, string id)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[7];

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

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

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

            param[3]       = new SqlParameter("@document_path", SqlDbType.VarChar);
            param[3].Value = document_path;

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

            param[5]       = new SqlParameter("@accepted", SqlDbType.VarChar);
            param[5].Value = accepted;



            param[6]       = new SqlParameter("@Unique_num", SqlDbType.VarChar);
            param[6].Value = id;



            DAL.ExectCommand("UPDATE_Registered_Student", param);
            DAL.close();
        }
Пример #9
0
        /******************************** ADD ******************************************/

        // اجراء لاضافة البيانات لقاعدة البيانات
        public void ADD_BILLS_2(string bills_no, DateTime bills_date, Double bills_amount, string bills_amount_ar
                                , string bills_descrption, int cust_id, string cust_name)

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

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

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

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

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

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

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

            DAL.ExcuteCommand("ADD_BILLS_2", param);
            DAL.close();
        }
Пример #10
0
        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);
        }
Пример #11
0
        public void ADD_INOIES_DETEALS2(string sales_code, string pro_code, string pro_name, string pro_unit
                                        , Double pro_sale, int pro_quntity, Double inv_total)

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

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

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

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

            param[4]       = new SqlParameter("@pro_sale", SqlDbType.Float);
            param[4].Value = pro_sale;

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

            param[6]       = new SqlParameter("@inv_total", SqlDbType.Float);
            param[6].Value = inv_total;

            DAL.ExcuteCommand("ADD_INOIES_DETEALS2", param);
            DAL.close();
        }
Пример #12
0
        public void UPDATE_Research(string Unique_num, int doctor_code, string title_research, string type, string date, int id)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[6];
            param[0]       = new SqlParameter("@Unique_num", SqlDbType.VarChar);
            param[0].Value = Unique_num;

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

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

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

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

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

            DAL.ExectCommand("UPDATE_Research", param);
            DAL.close();
        }
Пример #13
0
        public void update_inv_tail(int mat_no, string matName, int order_no, int qte, double price, double amount)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[6];


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

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

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

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

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

            param[5]       = new SqlParameter("@mat_name", SqlDbType.NVarChar, 50);
            param[5].Value = matName;


            DAL.Executecmd("add_order_detail", param);
            DAL.close();
        }
Пример #14
0
        public void UPDATE_Book(string name, string publisher, string auther, string text_book, string id)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[5];


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

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


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

            param[3]       = new SqlParameter("@text_book", SqlDbType.VarChar);
            param[3].Value = text_book;

            param[4]       = new SqlParameter("@ISPN", SqlDbType.VarChar);
            param[4].Value = id;


            DAL.ExectCommand("UPDATE_Book", param);
            DAL.close();
        }
        public void ADD_PRODUCT(int id_cat, string label_product,
                                string id_product, int quantity, string price, byte[] image)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] parm = new SqlParameter[6];

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

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

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

            parm[3]       = new SqlParameter("@QUANTITY", SqlDbType.Int);
            parm[3].Value = quantity;

            parm[4]       = new SqlParameter("@PRICE", SqlDbType.NVarChar, 50);
            parm[4].Value = price;

            parm[5]       = new SqlParameter("@PRODUCT_IMAGE", SqlDbType.Image);
            parm[5].Value = image;

            DAL.ExecuteCommand("ADD_PRODUCT", parm);
            DAL.close();
        }
Пример #16
0
        public void add_serve_detail(string ServeName, int order_no, int qte, double price, double amount)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[5];


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

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

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

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

            param[4]       = new SqlParameter("@serve_name", SqlDbType.NVarChar, 50);
            param[4].Value = ServeName;


            DAL.Executecmd("add_serve_detail", param);
            DAL.close();
        }
Пример #17
0
        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);
        }
Пример #18
0
        public void Add_Grade(int course_code, int Intake_code, string Unique_num, decimal Assignment, decimal final_Exam, decimal Total_grade, string year)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[7];


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

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

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


            param[3]       = new SqlParameter("@Assignment", SqlDbType.Decimal);
            param[3].Value = Assignment;


            param[4]       = new SqlParameter("@final_Exam", SqlDbType.Decimal);
            param[4].Value = final_Exam;

            param[5]       = new SqlParameter("@Total_grade", SqlDbType.Decimal);
            param[5].Value = Total_grade;

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



            DAL.ExectCommand("Add_Grade", param);
            DAL.close();
        }
Пример #19
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);
        }
Пример #20
0
        public void ADD_Course_B_D(int id_course, int id_doctor, int id_intake, string id_book, int id_program, string from_date, string to_date, string plan)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[8];
            param[0]       = new SqlParameter("@course_code", SqlDbType.Int);
            param[0].Value = id_course;

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

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

            param[3]       = new SqlParameter("@ISPN", SqlDbType.VarChar);
            param[3].Value = id_book;

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

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

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

            param[7]       = new SqlParameter("@plan", SqlDbType.VarChar);
            param[7].Value = plan;



            DAL.ExectCommand("ADD_Course_B_D", param);
            DAL.close();
        }
Пример #21
0
        // اجراء لاضافة البيانات لقاعدة البيانات
        public void ADD_SPEND_DETALIS(string pro_code, string pro_name, string pro_unit, int pro_quantity, string spend_code)

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

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

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

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

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



            DAL.ExcuteCommand("ADD_SPEND_DETALIS", param);
            DAL.close();
        }
Пример #22
0
        /******************************** ADD ******************************************/

        // اجراء لاضافة البيانات لقاعدة البيانات
        public void ADD_PRODUCT(string pro_code, string pro_name, int pro_unit, int pro_category
                                , string pro_contry, string pro_company, Double pro_pay, Double pro_sale)

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

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

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

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

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

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

            param[6]       = new SqlParameter("@pro_pay", SqlDbType.Float);
            param[6].Value = pro_pay;

            param[7]       = new SqlParameter("@pro_sale", SqlDbType.Float);
            param[7].Value = pro_sale;

            DAL.ExcuteCommand("ADD_PRODUCT", param);
            DAL.close();
        }
Пример #23
0
        public void insertMtr(string nameMtr, Double buyPrice, Double salePrice, double quantity, string type, string storeid)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[7];

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

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

            param[2]       = new SqlParameter("@mat_sale_price", SqlDbType.Money);
            param[2].Value = salePrice;

            param[3]       = new SqlParameter("@Quantity", SqlDbType.Decimal);
            param[3].Value = quantity;

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

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

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

            DAL.Executecmd("insertMatirials", param);
            DAL.close();
        }
Пример #24
0
        // اجراء التعديل البيانات لقاعدة البيانات
        public void UPDATE_PRIV(int user_id, int screen_id, Boolean priv_display, Boolean priv_add, Boolean priv_edit, Boolean priv_delete)

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

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

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

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

            param[3]       = new SqlParameter("@priv_add", SqlDbType.Bit);
            param[3].Value = priv_add;

            param[4]       = new SqlParameter("@priv_edit", SqlDbType.Bit);
            param[4].Value = priv_edit;

            param[5]       = new SqlParameter("@priv_delete", SqlDbType.Bit);
            param[5].Value = priv_delete;

            DAL.ExcuteCommand("UPDATE_PRIV", param);
            DAL.close();
        }
Пример #25
0
        public void add_comp_order_detail(int order_no, string productName, double qte, double price, double amount)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[5];


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

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

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

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

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



            DAL.Executecmd("add_comp_order_detail", param);
            DAL.close();
        }
Пример #26
0
        /**********************************************************************/

        // اجراء لاضافة البيانات لقاعدة البيانات
        public void ADD_MONITER(int user_id, DateTime date, string time, string process, string screens)

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

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

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

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

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

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



            DAL.ExcuteCommand("ADD_MONITER", param);
            DAL.close();
        }
Пример #27
0
        public void add_order_details(string id_prod, int id_order,
                                      int qte, string price, float discount, string amount, string total_amount)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] parm = new SqlParameter[7];

            parm[0]       = new SqlParameter("@id_pro", SqlDbType.NVarChar, 50);
            parm[0].Value = id_prod;

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

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

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

            parm[4]       = new SqlParameter("@discount", SqlDbType.Float);
            parm[4].Value = discount;

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

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


            DAL.ExecuteCommand("add_order_details", parm);
            DAL.close();
        }
        public void add_doc(int customerID, string id, string note, double total_ammount, double recived, string isCashed, DateTime dateT)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[7];

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

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

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

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

            param[4]       = new SqlParameter("@total_amount", SqlDbType.Money);
            param[4].Value = total_ammount;

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

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



            DAL.Executecmd("add_doc", param);
            DAL.close();
        }
Пример #29
0
        /*************************************** ADD **************************************************/

        // اجراء لاضافة البيانات لقاعدة البيانات
        public void ADD_SUPPLAY(string supp_code, string supp_name, int supp_phone,
                                string aupp_addrees /*, Boolean supp_status*/)

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

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

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

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

            //param[4] = new SqlParameter("@supp_status", SqlDbType.Bit);
            //param[4].Value = supp_status;



            DAL.ExcuteCommand("ADD_SUPPLAY", param);
            DAL.close();
        }
        public void ADD_TAKSET(int id, string rece_price, string total_in_cash, string RABHH, string day, string monthly_price, string mo, string ye)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] parm = new SqlParameter[8];

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

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

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

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

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

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

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

            parm[7]       = new SqlParameter("@YEAR", SqlDbType.NVarChar, 50);
            parm[7].Value = ye;
            DAL.ExecuteCommand("ADD_TAKSET", parm);
            DAL.close();
        }