public void ADD_PROUDCT(int ID_CAT, string ID_PRODUCT, string LABEL_PRODUCT, int QTE_IN_STOCK, string PRICE, byte[] IMAGE_PRODUCT)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.Open();
            SqlParameter[] param = new SqlParameter[6];

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

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

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

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

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

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

            DAL.ExecuteCommand("ADD_PROUDCT", param);
            DAL.Close();
        }
 public DataTable GET_ALL_PRODUCTS()
 {
     DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
     DataTable Dt = new DataTable();
     Dt = DAL.SelectData("GET_ALL_PRODUCTS",null);
     DAL.Close();
     return Dt;
 }
        public void DELETE_PRODUCT(string ID)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.Open();
            SqlParameter[] param = new SqlParameter[1];
            param[0] = new SqlParameter("@ID", SqlDbType.NVarChar, 50);
            param[0].Value = ID;

            DAL.ExecuteCommand("DELETE_PRODUCT", param);
            DAL.Close();
        }
 public DataTable GET_IMAGE_PRODUCT(string ID)
 {
     DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
     DataTable Dt = new DataTable();
     SqlParameter[] param = new SqlParameter[1];
     param[0] = new SqlParameter("@ID", SqlDbType.NVarChar, 50);
     param[0].Value = ID;
     Dt = DAL.SelectData("GET_IMAGE_PRODUCT", param);
     DAL.Close();
     return Dt;
 }
Esempio n. 5
0
        public DataTable LOGIN(string ID, string PWD)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            SqlParameter[] param = new SqlParameter[2];

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

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

            DataTable Dt = new DataTable();
            Dt = DAL.SelectData("SP_LOGIN", param);
            DAL.Close();
            return Dt;
        }
Esempio n. 6
0
        public void InsertCus(string name, string phone, string note)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[3];


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

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

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



            DAL.Executecmd("insertCustomer", param);
            DAL.close();
        }
Esempio n. 7
0
        public DataTable final_status_of_debts()
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DataTable           Dt  = new DataTable();



            Dt = DAL.selectData("the_final_status_of_debts", null);
            DAL.close();
            foreach (DataRow row in Dt.Rows)
            {
                try
                {
                    row["monyOf"] = String.Format("{0:n0}", Convert.ToDouble(row["monyOf"]));
                }
                catch
                {
                }
            }
            return(Dt);
        }
Esempio n. 8
0
        public void ADD_FACTURE(int NO_FACTURE, DateTime DATE_FACTURE, decimal MONTANT_FACTURE, decimal MONTANT_RESTE, int CODE_CL)
        {
            DAL.DataAccessLayer dal = new DAL.DataAccessLayer();
            dal.open();

            SqlParameter[] param = new SqlParameter[5];

            param[0]       = new SqlParameter("@NO_FACTURE", SqlDbType.Int);
            param[0].Value = NO_FACTURE;
            param[1]       = new SqlParameter("@DATE_FACTURE", SqlDbType.Date);
            param[1].Value = DATE_FACTURE;
            param[2]       = new SqlParameter("@MONTANT_FACTURE", SqlDbType.Money);
            param[2].Value = MONTANT_FACTURE;
            param[3]       = new SqlParameter("@MONTANT_RESTE", SqlDbType.Money);
            param[3].Value = MONTANT_RESTE;
            param[4]       = new SqlParameter("@CODE_CL", SqlDbType.Int);
            param[4].Value = CODE_CL;

            dal.ExecutCommand("ADD_FACTURE", param);
            dal.close();
        }
Esempio n. 9
0
        // اجراء لاضافة البيانات لقاعدة البيانات
        public void ADD_SUPPLYE(string supplye_code, DateTime supplye_date, int supplyer_id, int invoice_number)

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

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

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

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

            DAL.ExcuteCommand("ADD_SUPPLYE", param);
            DAL.close();
        }
Esempio n. 10
0
        public void EDIT_USER(string @ID, string FullName, string PWD,
                              string UserType)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.Open();
            SqlParameter[] param = new SqlParameter[4];
            param[0]       = new SqlParameter("@ID", SqlDbType.VarChar, 50);
            param[0].Value = ID;

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

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

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

            DAL.ExecuteCommand("EDIT_USER", param);
            DAL.Close();
        }
Esempio n. 11
0
        public void add_unit(string cate_name, string unit_name, string unit_percentage, string sellprice)
        {
            DAL.DataAccessLayer dal = new DAL.DataAccessLayer();
            dal.Open();
            SqlParameter[] param = new SqlParameter[4];

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

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

            param[2]       = new SqlParameter("@unit_percentage", SqlDbType.NChar, 10);
            param[2].Value = unit_percentage;

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

            dal.ExecuteCommand("add_unit", param);
            dal.Close();
        }
Esempio n. 12
0
        public void UPDATE_PRODCUT(int ID_CAT, string BARCODE_PRODUCT, string LABEL, byte[] IMAGE, string ID_PRODCUT, DateTime EXPIRE_DATE)
        {
            DAL.DataAccessLayer dal = new DAL.DataAccessLayer();
            dal.ConOpen();
            SqlParameter[] PARAM = new SqlParameter[6];
            PARAM[0]       = new SqlParameter("@ID_CAT", SqlDbType.Int);
            PARAM[1]       = new SqlParameter("@BARCODE_PRODUCT", SqlDbType.NVarChar, 50);
            PARAM[2]       = new SqlParameter("@LABEL", SqlDbType.NVarChar, 50);
            PARAM[3]       = new SqlParameter("@IMAGE", SqlDbType.Image);
            PARAM[4]       = new SqlParameter("@ID_PRODUCT", SqlDbType.Int);
            PARAM[5]       = new SqlParameter("@EXPIRE_DATE", SqlDbType.Date);
            PARAM[0].Value = ID_CAT;
            PARAM[1].Value = BARCODE_PRODUCT;
            PARAM[2].Value = LABEL;
            PARAM[3].Value = IMAGE;
            PARAM[4].Value = ID_PRODCUT;
            PARAM[5].Value = EXPIRE_DATE;

            dal.ExecuteCommand("UPDATE_PRODUCTS", PARAM);
            dal.ConClose();
        }
 private void CommandExecuter(string sqlCommand, bool restore)
 {
     if (restore)
     {
         DAL.DataAccessLayer DAL = new DAL.DataAccessLayer(restore);
         SqlCommand          command;
         command = new SqlCommand(sqlCommand, DAL.sqlconnection);
         DAL.Open();
         command.ExecuteNonQuery();
         DAL.Close();
     }
     else
     {
         DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
         SqlCommand          command;
         command = new SqlCommand(sqlCommand, DAL.sqlconnection);
         DAL.Open();
         command.ExecuteNonQuery();
         DAL.Close();
     }
 }
Esempio n. 14
0
        public void updateCus(string name, string phone, int id)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[3];


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

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

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



            DAL.Executecmd("updateUserInfo", param);
            DAL.close();
        }
Esempio n. 15
0
        public void DeleteMedicines(string ID_medicine)
        {
            //Data access layer object
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();

            //Open the connection
            DAL.Open();

            //SQL-Parameters Array
            SqlParameter[] Param = new SqlParameter[1];

            //Value of SQL-Parameters
            Param[0]       = new SqlParameter("@ID", SqlDbType.VarChar, 50);
            Param[0].Value = ID_medicine;

            //Excute Command
            DAL.ExecuteCommand("DeleteMedicines", Param);

            //Close the connection
            DAL.Close();
        }
Esempio n. 16
0
        // اجراء التعديل البيانات لقاعدة البيانات
        public void UPDATE_USER_EX(int user_id, string full_name, string user_name)

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

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

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

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



            DAL.ExcuteCommand("UPDATE_USER_EX", param);
            DAL.close();
        }
Esempio n. 17
0
        public DataTable login(string username, string PWD)
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();
            SqlParameter[]      param        = new SqlParameter[2];

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

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

            accessobject.open();


            DataTable Dt = new DataTable();

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

            return(Dt);
        }
Esempio n. 18
0
        private void Frm_ADDNewProudct_Load(object sender, EventArgs e)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DataTable           dt  = new DataTable();

            dt = DAL.SelectData("load_categoires", null);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cmb_categories.Items.Add(dt.Rows[i].ItemArray[0]);
            }
            dt = DAL.SelectData("LOAD_STROEnAME", null);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cmb_storename.Items.Add(dt.Rows[i].ItemArray[0]);
            }
            dt = DAL.SelectData("load_type", null);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cmb_Ptype.Items.Add(dt.Rows[i].ItemArray[0]);
            }
        }
Esempio n. 19
0
        private void view_data()
        {
            dt  = new DataTable();
            dal = new DAL.DataAccessLayer();
            dt  = dal.FindDataSet("SELECT  [Type_ID] ,[A_N] ,[E_N] ,[Affected_by_operations],[edit_date] ,[edit_user]  ,[in_date],[by_user] FROM [trader_db].[dbo].[AC_Account_type] where Type_ID=" + txt_id.Text);

            if (dt.Rows.Count > 0)
            {
                txt_A_N.Text = dt.Rows[0]["A_N"].ToString();
                txt_E_N.Text = dt.Rows[0]["E_N"].ToString();

                txt_in_date.Text   = dt.Rows[0]["in_date"].ToString();
                txt_edit_date.Text = dt.Rows[0]["edit_date"].ToString();
                txt_edit_user.Text = dt.Rows[0]["edit_user"].ToString();
                txt_by_user.Text   = dt.Rows[0]["by_user"].ToString();
                if (dt.Rows[0]["Affected_by_operations"] != DBNull.Value)
                {
                    chbx_Affected_by_operations.Checked = Convert.ToBoolean(dt.Rows[0]["Affected_by_operations"]);
                }
            }
        }
Esempio n. 20
0
        public void updateSeasons(string SeasonName, DateTime Start_Date, DateTime Expiry_date, int id)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[4];

            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;

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

            DAL.Executecmd("updateSeasons", param);
            DAL.close();
        }
Esempio n. 21
0
        public void UPDATE_intake(string name, int num, string year, int Intake_code)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[4];
            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;


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

            DAL.ExectCommand("UPDATE_intake", param);
            DAL.close();
        }
Esempio n. 22
0
        public void InsertPatientAfter(string Name, int Patient_id, string Date, string Address, int No_File, string Phone, string Age, int User_id, int Clinic_id, string Sex, string Note1)
        {
            DAL.DataAccessLayer Dal   = new DAL.DataAccessLayer();
            SqlParameter[]      param = new SqlParameter[11];

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

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

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

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

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

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

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

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

            param[8]       = new SqlParameter("@Sex", SqlDbType.NChar, 10);
            param[8].Value = Sex;

            param[9]       = new SqlParameter("@Note1", SqlDbType.Text);
            param[9].Value = Note1;

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

            Dal.ExecuteCommand("InsertPatientAfter", param);
        }
Esempio n. 23
0
        public DataTable update_mark(int id, float m1, float m2, float m3, float total,
                                     int stu_id, int dept_id, int lev_id, int sem_id,
                                     int sub_id, string sub_deg, string year_std)
        {
            DAL.DataAccessLayer DAL   = new DAL.DataAccessLayer();
            SqlParameter[]      param = new SqlParameter[12];
            param[0]       = new SqlParameter("@mark_id", SqlDbType.Float);
            param[0].Value = id;
            param[1]       = new SqlParameter("@m1", SqlDbType.Float);
            param[1].Value = m1;
            param[2]       = new SqlParameter("@m2", SqlDbType.Float);
            param[2].Value = m2;
            param[3]       = new SqlParameter("@m3", SqlDbType.Float);
            param[3].Value = m3;
            param[4]       = new SqlParameter("@stu_id", SqlDbType.Int);
            param[4].Value = stu_id;
            param[5]       = new SqlParameter("@dept_id", SqlDbType.Int);
            param[5].Value = dept_id;
            param[6]       = new SqlParameter("@lev_id", SqlDbType.Int);
            param[6].Value = lev_id;
            param[7]       = new SqlParameter("@sem_id", SqlDbType.Int);
            param[7].Value = sem_id;
            param[8]       = new SqlParameter("@sub_id", SqlDbType.Int);
            param[8].Value = sub_id;

            param[9]        = new SqlParameter("@sub_total", SqlDbType.Float);
            param[9].Value  = total;
            param[10]       = new SqlParameter("@sub_deg", SqlDbType.NVarChar, 20);
            param[10].Value = sub_deg;
            param[11]       = new SqlParameter("@year_std", SqlDbType.NVarChar, 60);
            param[11].Value = year_std;


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

            dt = DAL.SelectData("update_mark", param);
            DAL.Close();
            return(dt);
        }
Esempio n. 24
0
        /// <summary>
        /// select some questions from the database depending on its level
        /// </summary>
        /// <param name="level"> paramter used to get data from the database </param>
        /// <param name="numberOfQuestions">number of questions with the used constraints(level,kind) in the database </param>
        /// <returns> list of the selected question in the database </returns>
        public List <Question> getSomeQuestionWithoutKind(int level, out int numberOfQuestions)
        {
            List <Question> QuestionList;

            DAL.DataAccessLayer data  = new DAL.DataAccessLayer();
            SqlParameter[]      param = new SqlParameter[1];

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

            DataTable dataTable = data.selectData("getQuestionsWithoutKinds", param);

            DataTableReader tableReader = new DataTableReader(dataTable);
            Question        Question_Data;

            if (tableReader.HasRows)
            {
                numberOfQuestions = 0;
                QuestionList      = new List <Question>();
                while (tableReader.Read())
                {
                    Question_Data = new Question
                                    (
                        (int)tableReader.GetValue(0)    // Question_Number
                        , tableReader.GetString(1)      // Question
                        , tableReader.GetString(2)      // Answer
                        , tableReader.GetString(3)      // Kind
                        , (int)tableReader.GetValue(4)  // Level
                                    );
                    QuestionList.Add(Question_Data);
                    numberOfQuestions++;
                }
                return(QuestionList);
            }
            else
            {
                numberOfQuestions = 0;
                return(null);
            }
        }
Esempio n. 25
0
        public void InsertUsers(string Name, int User_id, string NameSystem, string Shift, string Pass, string Number_Type_Of_Job, string Phone, string Email, string Sex, string Note1)
        {
            DAL.DataAccessLayer Dal   = new DAL.DataAccessLayer();
            SqlParameter[]      param = new SqlParameter[10];

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

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

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

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

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

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

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

            param[7]       = new SqlParameter("@Sex", SqlDbType.NVarChar, 10);
            param[7].Value = Sex;

            param[8]       = new SqlParameter("@Note1", SqlDbType.Text);
            param[8].Value = Note1;

            param[9]       = new SqlParameter("@NameSystem", SqlDbType.Text);
            param[9].Value = NameSystem;


            Dal.CheckIsOpen();
            Dal.ExecuteCommand("InsertUsers", param);
            Dal.CheckIsClosed();
        }
Esempio n. 26
0
        public void add_order(string inv_no, string date, string saleman, string customer_id, int total_ammount, int dept)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[7];

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

            param[1] = new SqlParameter("@isCashed", SqlDbType.NVarChar, 32);
            if (dept == 0)
            {
                param[1].Value = "YES";
            }
            else
            {
                param[1].Value = "NO";
            }


            param[2]       = new SqlParameter("@inv_date", SqlDbType.Date);
            param[2].Value = Convert.ToDateTime(date);

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

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

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

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



            DAL.Executecmd("add_order", param);
            DAL.close();
        }
        public void EDIT_CUSTOMERS(string Name, string Phone, string Email, string Address
                                   , DateTime date, byte[] Picture, string Useradd, string ImageState, int ID)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.Open();


            SqlParameter[] param = new SqlParameter[9];


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

            param[1]       = new SqlParameter("@CustPhone", SqlDbType.NChar, 11);
            param[1].Value = Phone;

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

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

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

            param[5]       = new SqlParameter("@CustImage", SqlDbType.Image);
            param[5].Value = Picture;

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

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

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

            DAL.ExecuteCommand("Update_Customers", param);
            DAL.Close();
        }
        public void Add_moneySaver_Customer_INFO(int payedMoney_customer, int savemoneytype_ID, int usertyep_ID, DateTime date, int order_ID, int ordersavemoney_ID, decimal amount)
        {
            DAL.DataAccessLayer DAL   = new DAL.DataAccessLayer();
            SqlParameter[]      param = new SqlParameter[7];
            param[0]       = new SqlParameter("@payedMoney_customer", SqlDbType.Int);
            param[0].Value = payedMoney_customer;
            param[1]       = new SqlParameter("@savemoneytype_ID", SqlDbType.Int);
            param[1].Value = savemoneytype_ID;
            param[2]       = new SqlParameter("@usertyep_ID", SqlDbType.Int);
            param[2].Value = usertyep_ID;
            param[3]       = new SqlParameter("@date", SqlDbType.DateTime);
            param[3].Value = date;
            param[4]       = new SqlParameter("@order_ID", SqlDbType.Int);
            param[4].Value = order_ID;
            param[5]       = new SqlParameter("@Ordersavemony_type_ID", SqlDbType.Int);
            param[5].Value = ordersavemoney_ID;
            param[6]       = new SqlParameter("@amount", SqlDbType.Decimal);
            param[6].Value = amount;

            DAL.Excutecommand("NInsertNewMoney_CUSTOMER_saver", param);
            DAL.close();
        }
Esempio n. 29
0
        public void ADD_table(string name, string nationality, string year)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.Open();
            SqlParameter[] param = new SqlParameter[3];



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

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

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



            DAL.ExecuteCommand("ADD_table", param);
            DAL.Close();
        }
Esempio n. 30
0
        public void UpdateBondBook(int BondNumber, int BondNumType, int Patient_id, int User_id, double BondAmount, double BondDiscount, string BondCash_or_After, string BondState, string col1, string col2)
        {
            DAL.DataAccessLayer Dal   = new DAL.DataAccessLayer();
            SqlParameter[]      param = new SqlParameter[10];

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

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

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

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

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

            param[5]       = new SqlParameter("@BondCash_or_After", SqlDbType.NVarChar, 10);
            param[5].Value = BondCash_or_After;

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

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

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

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

            //Dal.CheckIsOpen();
            Dal.ExecuteCommand("UpdateBondBook", param);
            //Dal.CheckIsClosed();
        }
Esempio n. 31
0
        public DataTable SearchExam(int dept, int lev, int sem)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.Open();

            SqlParameter[] parameters = new SqlParameter[3];

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

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

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

            DataTable dt = new DataTable();

            dt = DAL.SelectData("SearchExam", parameters);
            DAL.Close();
            return(dt);
        }
Esempio n. 32
0
 public void UPDATE_ORDER_MONEY(int ID_MONEY, int ID_ORDER, int ID_COUST, float TOTAL_AMOUNT, float PAID_AMOUNT, float DISCOUNT_AMOUNT, float REMINDER_AMOUNT)
 {
     DAL.DataAccessLayer dal = new DAL.DataAccessLayer();
     dal.ConOpen();
     SqlParameter[] PARAM = new SqlParameter[7];
     PARAM[0]       = new SqlParameter("@ID_ORDER", SqlDbType.Int);
     PARAM[1]       = new SqlParameter("@ID_COUST", SqlDbType.Int);
     PARAM[2]       = new SqlParameter("@TOTAL_AMOUNT", SqlDbType.Float);
     PARAM[3]       = new SqlParameter("@PAID_AMOUNT", SqlDbType.Float);
     PARAM[4]       = new SqlParameter("@DISCOUNT_AMOUNT", SqlDbType.Float);
     PARAM[5]       = new SqlParameter("@REMINDER_AMOUNT", SqlDbType.Float);
     PARAM[6]       = new SqlParameter("@ID_MONEYIES", SqlDbType.Int);
     PARAM[0].Value = ID_ORDER;
     PARAM[1].Value = ID_COUST;
     PARAM[2].Value = TOTAL_AMOUNT;
     PARAM[3].Value = PAID_AMOUNT;
     PARAM[4].Value = DISCOUNT_AMOUNT;
     PARAM[5].Value = REMINDER_AMOUNT;
     PARAM[6].Value = ID_MONEY;
     dal.ExecuteCommand("UPDATE_ORDER_MONEY", PARAM);
     dal.ConClose();
 }
Esempio n. 33
0
        public DataTable SearchInMat(string Value, string store, string cat)
        {
            DAL.DataAccessLayer accessobject = new DAL.DataAccessLayer();

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

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

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

            DataTable Dt = new DataTable();

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


            return(Dt);
        }
Esempio n. 34
0
 public void UPDATE_ORDER(int ID_ORDER, int ID_COUST, string ORDER_NOTES, int ORDER_TYPE, int PAID_OR_NOT, String SALES_MAN)
 {
     DAL.DataAccessLayer dal = new DAL.DataAccessLayer();
     dal.ConOpen();
     SqlParameter[] PARAM = new SqlParameter[7];
     PARAM[0]       = new SqlParameter("@ID_ORDER", SqlDbType.Int);
     PARAM[1]       = new SqlParameter("@ID_COUST", SqlDbType.Int);
     PARAM[2]       = new SqlParameter("@ORDER_NOTES", SqlDbType.NVarChar, 50);
     PARAM[3]       = new SqlParameter("@ORDER_TYPE", SqlDbType.Bit);
     PARAM[4]       = new SqlParameter("@PAID_OR_NOT", SqlDbType.Bit);
     PARAM[5]       = new SqlParameter("@SALES_MAN", SqlDbType.NVarChar, 50);
     PARAM[6]       = new SqlParameter("@ORDER_DATE", SqlDbType.Date);
     PARAM[0].Value = ID_ORDER;
     PARAM[1].Value = ID_COUST;
     PARAM[2].Value = ORDER_NOTES;
     PARAM[3].Value = ORDER_TYPE;
     PARAM[4].Value = PAID_OR_NOT;
     PARAM[5].Value = SALES_MAN;
     PARAM[6].Value = DateTime.Now.ToShortDateString();
     dal.ExecuteCommand("UPDATE_ORDER", PARAM);
     dal.ConClose();
 }
Esempio n. 35
0
        public DataTable getstudentFordept_lev_sem22(int dept, int lev, int sem)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.Open();

            SqlParameter[] parameters = new SqlParameter[3];

            parameters[0]       = new SqlParameter("@dept_id", SqlDbType.Int);
            parameters[0].Value = dept;

            parameters[1]       = new SqlParameter("@lev_id", SqlDbType.Int);
            parameters[1].Value = lev;

            parameters[2]       = new SqlParameter("@sem_id", SqlDbType.Int);
            parameters[2].Value = sem;

            DataTable dt = new DataTable();

            dt = DAL.SelectData("getstudentFordept_lev_sem22", parameters);
            DAL.Close();
            return(dt);
        }