Exemple #1
0
        /// <summary>
        /// This method will return a list of objects representing the specified number of entries from the specified record number in the table.
        /// </summary>
        ///
        /// <param name="pageSize" type="int">Number of records returned.</param>
        /// <param name="skipPages" type="int">The number of missing pages.</param>
        /// <param name="orderByStatement" type="string">The field value to number.</param>
        ///
        /// <returns>list of objects of class BDSupplier in the form of an object of class BDSupplierCollection </returns>
        public BDSupplierCollection SelectAllPaged(int?pageSize, int?skipPages, string orderByStatement)
        {
            BDSupplierCollection bDSupplierCollection = new BDSupplierCollection();

            foreach (POS.DataLayer.BDSupplier _bDSupplier in POS.DataLayer.BDSupplierBase.SelectAllPaged(pageSize, skipPages, orderByStatement))
            {
                _bDSupplierWCF = new BDSupplier();

                _bDSupplierWCF.SupplierID   = _bDSupplier.SupplierID;
                _bDSupplierWCF.SupplierCode = _bDSupplier.SupplierCode;
                _bDSupplierWCF.SupplierName = _bDSupplier.SupplierName;
                _bDSupplierWCF.Address      = _bDSupplier.Address;
                _bDSupplierWCF.Phone1       = _bDSupplier.Phone1;
                _bDSupplierWCF.phone2       = _bDSupplier.Phone2;
                _bDSupplierWCF.Mobile1      = _bDSupplier.Mobile1;
                _bDSupplierWCF.Mobile2      = _bDSupplier.Mobile2;
                _bDSupplierWCF.Email        = _bDSupplier.Email;
                _bDSupplierWCF.IsActive     = _bDSupplier.IsActive;
                _bDSupplierWCF.Debit        = _bDSupplier.Debit;
                _bDSupplierWCF.Credit       = _bDSupplier.Credit;

                bDSupplierCollection.Add(_bDSupplierWCF);
            }
            return(bDSupplierCollection);
        }
Exemple #2
0
        /// <summary>
        /// This method will return a list of objects representing the specified number of entries from the specified record number in the table
        /// using the value of the field specified
        /// </summary>
        ///
        /// <param name="field" type="string">Field of the class BDSupplier</param>
        /// <param name="fieldValue" type="object">Value for the field specified.</param>
        /// <param name="fieldValue2" type="object">Value for the field specified.</param>
        /// <param name="typeOperation" type="TypeOperation">Operator that is used if fieldValue2=null or fieldValue2="".</param>
        /// <param name="orderByStatement" type="string">The field value to number.</param>
        /// <param name="pageSize" type="int">Number of records returned.</param>
        /// <param name="skipPages" type="int">The number of missing pages.</param>
        ///
        /// <returns>List of object of class BDSupplier in the form of an object of class BDSupplierCollection</returns>
        public BDSupplierCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement)
        {
            BDSupplierCollection bDSupplierCollection = new BDSupplierCollection();

            foreach (POS.DataLayer.BDSupplier _bDSupplier in POS.DataLayer.BDSupplierBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement))
            {
                _bDSupplierWCF = new BDSupplier();

                _bDSupplierWCF.SupplierID   = _bDSupplier.SupplierID;
                _bDSupplierWCF.SupplierCode = _bDSupplier.SupplierCode;
                _bDSupplierWCF.SupplierName = _bDSupplier.SupplierName;
                _bDSupplierWCF.Address      = _bDSupplier.Address;
                _bDSupplierWCF.Phone1       = _bDSupplier.Phone1;
                _bDSupplierWCF.phone2       = _bDSupplier.Phone2;
                _bDSupplierWCF.Mobile1      = _bDSupplier.Mobile1;
                _bDSupplierWCF.Mobile2      = _bDSupplier.Mobile2;
                _bDSupplierWCF.Email        = _bDSupplier.Email;
                _bDSupplierWCF.IsActive     = _bDSupplier.IsActive;
                _bDSupplierWCF.Debit        = _bDSupplier.Debit;
                _bDSupplierWCF.Credit       = _bDSupplier.Credit;

                bDSupplierCollection.Add(_bDSupplierWCF);
            }
            return(bDSupplierCollection);
        }
Exemple #3
0
        /// <summary>
        /// This method will return a list of objects representing all records in the table.
        /// </summary>
        ///
        /// <returns>list of objects of class BDSupplier in the form of object of BDSupplierCollection </returns>
        public BDSupplierCollection SelectAll()
        {
            BDSupplierCollection bDSupplierCollection = new BDSupplierCollection();

            foreach (POS.DataLayer.BDSupplier _bDSupplier in POS.DataLayer.BDSupplierBase.SelectAll())
            {
                _bDSupplierWCF = new BDSupplier();

                _bDSupplierWCF.SupplierID   = _bDSupplier.SupplierID;
                _bDSupplierWCF.SupplierCode = _bDSupplier.SupplierCode;
                _bDSupplierWCF.SupplierName = _bDSupplier.SupplierName;
                _bDSupplierWCF.Address      = _bDSupplier.Address;
                _bDSupplierWCF.Phone1       = _bDSupplier.Phone1;
                _bDSupplierWCF.phone2       = _bDSupplier.Phone2;
                _bDSupplierWCF.Mobile1      = _bDSupplier.Mobile1;
                _bDSupplierWCF.Mobile2      = _bDSupplier.Mobile2;
                _bDSupplierWCF.Email        = _bDSupplier.Email;
                _bDSupplierWCF.IsActive     = _bDSupplier.IsActive;
                _bDSupplierWCF.Debit        = _bDSupplier.Debit;
                _bDSupplierWCF.Credit       = _bDSupplier.Credit;

                bDSupplierCollection.Add(_bDSupplierWCF);
            }
            return(bDSupplierCollection);
        }
Exemple #4
0
 public frmSupplierAccountEdit(int supplierID, FrmSupplierSearch _frmSupplierSearch)
 {
     InitializeComponent();
     this._supplierID          = supplierID;
     this._bDSupplierWrapper   = new BDSupplierWrapper();
     this._supplier            = new BDSupplier();
     this.frmSupplierSearchObj = _frmSupplierSearch;
     FillSupplierData();
 }
 public frmSupplierAccountEdit(int supplierID, FrmSupplierSearch _frmSupplierSearch)
 {
     InitializeComponent();
     this._supplierID = supplierID;
     this._bDSupplierWrapper = new BDSupplierWrapper();
     this._supplier = new BDSupplier();
     this.frmSupplierSearchObj = _frmSupplierSearch;
     FillSupplierData();
 }
Exemple #6
0
 public override void btn_Save_Click(object sender, EventArgs e)
 {
     if (tbx_Name.Text != "")
     {
         supplier = new BDSupplier();
         BDSupplierService supplierService = new BDSupplierService();
         if (SupplierID == null)//new supplier
         {
             supplier.SupplierCode = tbx_Code.Text;
             supplier.SupplierName = tbx_Name.Text;
             supplier.Address = tbx_Address.Text;
             supplier.Phone1 = tbx_Pone1.Text;
             supplier.phone2 = tbx_phone2.Text;
             supplier.Mobile1 = tbx_Mobile1.Text;
             supplier.Mobile2 = tbx_Mobile2.Text;
             supplier.Email = tbx_Email.Text;
             supplier.IsActive = chk_IsActive.Checked;
             supplier.Debit = 0;
             supplier.Credit = 0;
             supplierService.Insert(supplier);
            // ClearControls(); 
             MessageBox.Show("تم الحفظ بنجاح");
         }
         else
         {
             BDSupplierPrimaryKey pk = new BDSupplierPrimaryKey();
             pk.SupplierID = SupplierID;
             supplier = supplierService.SelectOne(pk);
             supplier.SupplierCode = tbx_Code.Text;
             supplier.SupplierName = tbx_Name.Text;
             supplier.Address = tbx_Address.Text;
             supplier.Phone1 = tbx_Pone1.Text;
             supplier.phone2 = tbx_phone2.Text;
             supplier.Mobile1 = tbx_Mobile1.Text;
             supplier.Mobile2 = tbx_Mobile2.Text;
             supplier.Email = tbx_Email.Text;
             supplier.IsActive = chk_IsActive.Checked;
            supplierService.Update(supplier);
            MessageBox.Show("تم التعديل بنجاح");
         }
         this.Close();
        
     
     }
     else
     {
         MessageBox.Show("لابد من ادخال إسم المورد");
     }
 }
Exemple #7
0
 private void FillSupplierData()
 {
     try
     {
         BDSupplierPrimaryKey _supplierPrimaryKey = new BDSupplierPrimaryKey();
         _supplierPrimaryKey.SupplierID = _supplierID;
         _supplier        = _bDSupplierWrapper.SelectOne(_supplierPrimaryKey);
         num_Credit.Value = _supplier.Credit.Value;
         num_Debit.Value  = _supplier.Debit.Value;
     }
     catch (Exception)
     {
         throw;
     }
 }
        private void LoadControls()
        {
            BDSupplierPrimaryKey pk = new BDSupplierPrimaryKey();

            pk.SupplierID        = SupplierID;
            supplier             = supplierWrapper.SelectOne(pk);
            tbx_Code.Text        = supplier.SupplierCode != null ? supplier.SupplierCode : "";
            tbx_Name.Text        = supplier.SupplierName;
            tbx_Address.Text     = supplier.Address != null ? supplier.Address : "";
            tbx_Pone1.Text       = supplier.Phone1 != null ? supplier.Phone1 : "";
            tbx_phone2.Text      = supplier.phone2 != null ? supplier.phone2 : "";
            tbx_Mobile1.Text     = supplier.Mobile1 != null ? supplier.Mobile1 : "";
            tbx_Mobile2.Text     = supplier.Mobile2 != null ? supplier.Mobile2 : "";
            tbx_Email.Text       = supplier.Email != null ? supplier.Email : "";
            chk_IsActive.Checked = supplier.IsActive != null ? (bool)supplier.IsActive : true;
        }
        ///<summary>
        /// This method will update one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="bDSupplier" type="BDSupplier">This BDSupplier  will be updated in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Update(BDSupplier bDSupplier)
        {
            _bDSupplier = POS.DataLayer.BDSupplier.SelectOne(new POS.DataLayer.BDSupplierPrimaryKey(bDSupplier.SupplierID));

            _bDSupplier.SupplierCode = bDSupplier.SupplierCode;
            _bDSupplier.SupplierName = bDSupplier.SupplierName;
            _bDSupplier.Address      = bDSupplier.Address;
            _bDSupplier.Phone1       = bDSupplier.Phone1;
            _bDSupplier.Phone2       = bDSupplier.phone2;
            _bDSupplier.Mobile1      = bDSupplier.Mobile1;
            _bDSupplier.Mobile2      = bDSupplier.Mobile2;
            _bDSupplier.Email        = bDSupplier.Email;
            _bDSupplier.IsActive     = bDSupplier.IsActive;

            return(_bDSupplier.Update());
        }
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="bDSupplier" type="BDSupplier">This BDSupplier  will be inserted in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Insert(BDSupplier bDSupplier)
        {
            _bDSupplier              = new POS.DataLayer.BDSupplier();
            _bDSupplier.SupplierID   = bDSupplier.SupplierID;
            _bDSupplier.SupplierCode = bDSupplier.SupplierCode;
            _bDSupplier.SupplierName = bDSupplier.SupplierName;
            _bDSupplier.Address      = bDSupplier.Address;
            _bDSupplier.Phone1       = bDSupplier.Phone1;
            _bDSupplier.Phone2       = bDSupplier.phone2;
            _bDSupplier.Mobile1      = bDSupplier.Mobile1;
            _bDSupplier.Mobile2      = bDSupplier.Mobile2;
            _bDSupplier.Email        = bDSupplier.Email;
            _bDSupplier.IsActive     = bDSupplier.IsActive;

            return(_bDSupplier.Insert());
        }
Exemple #11
0
 private void FillSupplierData()
 {
     try
     {
         BDSupplierPrimaryKey _supplierPrimaryKey = new BDSupplierPrimaryKey();
         _supplierPrimaryKey.SupplierID = _supplierID;
         _supplier        = _bDSupplierWrapper.SelectOne(_supplierPrimaryKey);
         num_Credit.Value = _supplier.Credit.Value;
         num_Debit.Value  = _supplier.Debit.Value;
     }
     catch (Exception ex)
     {
         MessageBox.Show("حدث خطأ برجاء تكرار العمليه مره اخرى واذا تكرر الخطا برجاءالاتصال بالشخص المصمم للبرنامج وارسال رسالة الخطا التى ستظهر بعد قليل له");
         MessageBox.Show(ex.Message);
     }
 }
Exemple #12
0
 public override void btn_Save_Click(object sender, EventArgs e)
 {
     if (tbx_Name.Text != "")
     {
         supplier = new BDSupplier();
         BDSupplierService supplierService = new BDSupplierService();
         if (SupplierID == null)//new supplier
         {
             supplier.SupplierCode = tbx_Code.Text;
             supplier.SupplierName = tbx_Name.Text;
             supplier.Address      = tbx_Address.Text;
             supplier.Phone1       = tbx_Pone1.Text;
             supplier.phone2       = tbx_phone2.Text;
             supplier.Mobile1      = tbx_Mobile1.Text;
             supplier.Mobile2      = tbx_Mobile2.Text;
             supplier.Email        = tbx_Email.Text;
             supplier.IsActive     = chk_IsActive.Checked;
             supplier.Debit        = 0;
             supplier.Credit       = 0;
             supplierService.Insert(supplier);
             // ClearControls();
             MessageBox.Show("تم الحفظ بنجاح");
         }
         else
         {
             BDSupplierPrimaryKey pk = new BDSupplierPrimaryKey();
             pk.SupplierID         = SupplierID;
             supplier              = supplierService.SelectOne(pk);
             supplier.SupplierCode = tbx_Code.Text;
             supplier.SupplierName = tbx_Name.Text;
             supplier.Address      = tbx_Address.Text;
             supplier.Phone1       = tbx_Pone1.Text;
             supplier.phone2       = tbx_phone2.Text;
             supplier.Mobile1      = tbx_Mobile1.Text;
             supplier.Mobile2      = tbx_Mobile2.Text;
             supplier.Email        = tbx_Email.Text;
             supplier.IsActive     = chk_IsActive.Checked;
             supplierService.Update(supplier);
             MessageBox.Show("تم التعديل بنجاح");
         }
         this.Close();
     }
     else
     {
         MessageBox.Show("لابد من ادخال إسم المورد");
     }
 }
        private void FillSupplierData()
        {
            try
            {
                BDSupplierPrimaryKey _supplierPrimaryKey = new BDSupplierPrimaryKey();
                _supplierPrimaryKey.SupplierID = _supplierID;
                _supplier = _bDSupplierWrapper.SelectOne(_supplierPrimaryKey);
                num_Credit.Value = _supplier.Credit.Value;
                num_Debit.Value = _supplier.Debit.Value;
            }
            catch (Exception ex)
            {

                MessageBox.Show("حدث خطأ برجاء تكرار العمليه مره اخرى واذا تكرر الخطا برجاءالاتصال بالشخص المصمم للبرنامج وارسال رسالة الخطا التى ستظهر بعد قليل له");
                MessageBox.Show(ex.Message);
            }
        }
        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="BDSupplierPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class BDSupplier</returns>
        public BDSupplier SelectOne(BDSupplierPrimaryKey pk)
        {
            _bDSupplierWCF = new BDSupplier();
            _bDSupplier    = POS.DataLayer.BDSupplierBase.SelectOne(new POS.DataLayer.BDSupplierPrimaryKey(pk.SupplierID));

            _bDSupplierWCF.SupplierID   = _bDSupplier.SupplierID;
            _bDSupplierWCF.SupplierCode = _bDSupplier.SupplierCode;
            _bDSupplierWCF.SupplierName = _bDSupplier.SupplierName;
            _bDSupplierWCF.Address      = _bDSupplier.Address;
            _bDSupplierWCF.Phone1       = _bDSupplier.Phone1;
            _bDSupplierWCF.phone2       = _bDSupplier.Phone2;
            _bDSupplierWCF.Mobile1      = _bDSupplier.Mobile1;
            _bDSupplierWCF.Mobile2      = _bDSupplier.Mobile2;
            _bDSupplierWCF.Email        = _bDSupplier.Email;
            _bDSupplierWCF.IsActive     = _bDSupplier.IsActive;

            return(_bDSupplierWCF);
        }
Exemple #15
0
        public BDSupplierCollection SearchByCriteria(string SupplierName, string SupplierCode)
        {
            BDSupplierCollection bDSupplierCollection = new BDSupplierCollection();

            foreach (POS.DataLayer.BDSupplier _bDSupplier in POS.DataLayer.BDSupplier.SearcByCriteria(SupplierName, SupplierCode))
            {
                _bDSupplierWCF = new BDSupplier();

                _bDSupplierWCF.SupplierID   = _bDSupplier.SupplierID;
                _bDSupplierWCF.SupplierName = _bDSupplier.SupplierName;
                _bDSupplierWCF.SupplierCode = _bDSupplier.SupplierCode;
                _bDSupplierWCF.Address      = _bDSupplier.Address;
                _bDSupplierWCF.Phone1       = _bDSupplier.Phone1;
                _bDSupplierWCF.phone2       = _bDSupplier.Phone2;
                _bDSupplierWCF.Mobile1      = _bDSupplier.Mobile1;
                _bDSupplierWCF.Mobile2      = _bDSupplier.Mobile2;
                _bDSupplierWCF.Email        = _bDSupplier.Email;
                _bDSupplierWCF.IsActive     = _bDSupplier.IsActive;

                bDSupplierCollection.Add(_bDSupplierWCF);
            }
            return(bDSupplierCollection);
        }
        /// <summary>
        /// This method will get row(s) from the database using the value of the field specified
        /// </summary>
        ///
        /// <param name="field" type="string">Field of the class BDSupplier</param>
        /// <param name="fieldValue" type="object">Value for the field specified.</param>
        /// <param name="fieldValue2" type="object">Value for the field specified.</param>
        /// <param name="typeOperation" type="TypeOperation">Operator that is used if fieldValue2=null or fieldValue2="".</param>
        ///
        /// <returns>List of object of class BDSupplier in the form of an object of class BDSupplierCollection</returns>
        public BDSupplierCollection SelectByField(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation)
        {
            BDSupplierCollection bDSupplierCollection = new BDSupplierCollection();

            foreach (POS.DataLayer.BDSupplier _bDSupplier in POS.DataLayer.BDSupplierBase.SelectByField(field, fieldValue, fieldValue2, typeOperation))
            {
                _bDSupplierWCF = new BDSupplier();

                _bDSupplierWCF.SupplierID   = _bDSupplier.SupplierID;
                _bDSupplierWCF.SupplierCode = _bDSupplier.SupplierCode;
                _bDSupplierWCF.SupplierName = _bDSupplier.SupplierName;
                _bDSupplierWCF.Address      = _bDSupplier.Address;
                _bDSupplierWCF.Phone1       = _bDSupplier.Phone1;
                _bDSupplierWCF.phone2       = _bDSupplier.Phone2;
                _bDSupplierWCF.Mobile1      = _bDSupplier.Mobile1;
                _bDSupplierWCF.Mobile2      = _bDSupplier.Mobile2;
                _bDSupplierWCF.Email        = _bDSupplier.Email;
                _bDSupplierWCF.IsActive     = _bDSupplier.IsActive;

                bDSupplierCollection.Add(_bDSupplierWCF);
            }
            return(bDSupplierCollection);
        }
Exemple #17
0
        public BDSupplierCollection SearchByCriteria(string SupplierName, string SupplierCode)
        {
            BDSupplierCollection bDSupplierCollection = new BDSupplierCollection();
            foreach (POS.DataLayer.BDSupplier _bDSupplier in POS.DataLayer.BDSupplier.SearcByCriteria(SupplierName, SupplierCode))
            {
                _bDSupplierWCF = new BDSupplier();

                _bDSupplierWCF.SupplierID = _bDSupplier.SupplierID;
                _bDSupplierWCF.SupplierName = _bDSupplier.SupplierName;
                _bDSupplierWCF.SupplierCode = _bDSupplier.SupplierCode;
                _bDSupplierWCF.Address = _bDSupplier.Address;
                _bDSupplierWCF.Phone1 = _bDSupplier.Phone1;
                _bDSupplierWCF.phone2 = _bDSupplier.Phone2;
                _bDSupplierWCF.Mobile1 = _bDSupplier.Mobile1;
                _bDSupplierWCF.Mobile2 = _bDSupplier.Mobile2;
                _bDSupplierWCF.Email = _bDSupplier.Email;
                _bDSupplierWCF.IsActive = _bDSupplier.IsActive;
                _bDSupplierWCF.Credit = _bDSupplier.Credit;
                _bDSupplierWCF.Debit = _bDSupplier.Debit;

                bDSupplierCollection.Add(_bDSupplierWCF);
            }
            return bDSupplierCollection;
        }
Exemple #18
0
 private void LoadControls()
 {
     BDSupplierPrimaryKey pk = new BDSupplierPrimaryKey();
     pk.SupplierID = SupplierID;
     supplier = supplierWrapper.SelectOne(pk);
     tbx_Code.Text = supplier.SupplierCode != null ? supplier.SupplierCode : "";
     tbx_Name.Text = supplier.SupplierName;
     tbx_Address.Text = supplier.Address != null ? supplier.Address : "";
     tbx_Pone1.Text = supplier.Phone1 != null ? supplier.Phone1 : "";
     tbx_phone2.Text = supplier.phone2 != null ? supplier.phone2 : "";
     tbx_Mobile1.Text = supplier.Mobile1 != null ? supplier.Mobile1 : "";
     tbx_Mobile2.Text = supplier.Mobile2 != null ? supplier.Mobile2 : "";
     tbx_Email.Text = supplier.Email != null ? supplier.Email : "";
     chk_IsActive.Checked = supplier.IsActive != null ? (bool)supplier.IsActive : true;
 }