public BDProductCollection SelectAllProductsByGroupID(int InventoryID, BDProductGroupPrimaryKey pk) { BDProductCollection bDProductCollection = new BDProductCollection(); var result = POS.DataLayer.BDProduct.SelectAllProductsByGroupID(InventoryID, new POS.DataLayer.BDProductGroupPrimaryKey(pk.ProductGroupID)); if (result != null) { foreach (POS.DataLayer.BDProduct _bDProduct in result) { _bDProductWCF = new BDProduct(); _bDProductWCF.ProductID = _bDProduct.ProductID; _bDProductWCF.ProductName = _bDProduct.ProductName; _bDProductWCF.ProductGroupID = _bDProduct.ProductGroupID; _bDProductWCF.ProductCode = _bDProduct.ProductCode; _bDProductWCF.IsAcceptBatch = _bDProduct.IsAcceptBatch; _bDProductWCF.ProductPrice = _bDProduct.ProductPrice; _bDProductWCF.IsFixedPrice = _bDProduct.IsFixedPrice; _bDProductWCF.HasDiscount = _bDProduct.HasDiscount; _bDProductWCF.DiscountAmount = _bDProduct.DiscountAmount; _bDProductWCF.DescountRatio = _bDProduct.DescountRatio; _bDProductWCF.IsActive = _bDProduct.IsActive; _bDProductWCF.Notes = _bDProduct.Notes; _bDProductWCF.MinPrice = _bDProduct.MinPrice; _bDProductWCF.MaxPrice = _bDProduct.MaxPrice; _bDProductWCF.TotalQty = _bDProduct.TotalQty; bDProductCollection.Add(_bDProductWCF); } } return bDProductCollection; }
public BDProductCollection SelectAllProductsByGroupID(int InventoryID, BDProductGroupPrimaryKey pk) { BDProductCollection bDProductCollection = new BDProductCollection(); var result = POS.DataLayer.BDProduct.SelectAllProductsByGroupID(InventoryID, new POS.DataLayer.BDProductGroupPrimaryKey(pk.ProductGroupID)); if (result != null) { foreach (POS.DataLayer.BDProduct _bDProduct in result) { _bDProductWCF = new BDProduct(); _bDProductWCF.ProductID = _bDProduct.ProductID; _bDProductWCF.ProductName = _bDProduct.ProductName; _bDProductWCF.ProductGroupID = _bDProduct.ProductGroupID; _bDProductWCF.ProductCode = _bDProduct.ProductCode; _bDProductWCF.IsAcceptBatch = _bDProduct.IsAcceptBatch; _bDProductWCF.ProductPrice = _bDProduct.ProductPrice; _bDProductWCF.IsFixedPrice = _bDProduct.IsFixedPrice; _bDProductWCF.HasDiscount = _bDProduct.HasDiscount; _bDProductWCF.DiscountAmount = _bDProduct.DiscountAmount; _bDProductWCF.DescountRatio = _bDProduct.DescountRatio; _bDProductWCF.IsActive = _bDProduct.IsActive; _bDProductWCF.Notes = _bDProduct.Notes; _bDProductWCF.MinPrice = _bDProduct.MinPrice; _bDProductWCF.MaxPrice = _bDProduct.MaxPrice; _bDProductWCF.TotalQty = _bDProduct.TotalQty; bDProductCollection.Add(_bDProductWCF); } } return(bDProductCollection); }
private void initEntity(int groupId) { BDProductGroupPrimaryKey pk = new BDProductGroupPrimaryKey(); pk.ProductGroupID = groupId; _bdProductGroup = _bdProductGroupWrapper.SelectOne(pk); txt_GroupName.Text = _bdProductGroup.ProductGroupName; txt_Notes.Text = _bdProductGroup.Notes; }
/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="BDProductGroupPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class BDProductGroup</returns> public BDProductGroup SelectOne(BDProductGroupPrimaryKey pk) { _bDProductGroupWCF = new BDProductGroup(); _bDProductGroup = POS.DataLayer.BDProductGroupBase.SelectOne(new POS.DataLayer.BDProductGroupPrimaryKey(pk.ProductGroupID)); _bDProductGroupWCF.ProductGroupID = _bDProductGroup.ProductGroupID; _bDProductGroupWCF.ProductGroupName = _bDProductGroup.ProductGroupName; _bDProductGroupWCF.Notes = _bDProductGroup.Notes; return _bDProductGroupWCF; }
private void FillProductCBX(int groupID) { try { BDProductGroupPrimaryKey pk = new BDProductGroupPrimaryKey(); pk.ProductGroupID = groupID; this.cbx_Product.SelectedIndexChanged -= new System.EventHandler(this.cbx_Product_SelectedIndexChanged); cbx_Product.DataSource = null; cbx_Product.DataSource = null;//_bDProductWrapper.SelectAllByForeignKeyProductGroupID(pk); cbx_Product.DisplayMember = "ProductName"; cbx_Product.ValueMember = "ProductID"; this.cbx_Product.SelectedIndexChanged += new System.EventHandler(this.cbx_Product_SelectedIndexChanged); cbx_Product.SelectedIndex = -1; } catch (Exception) { throw; } }
private void FillProductCBX(int groupID) { try { BDProductGroupPrimaryKey pk = new BDProductGroupPrimaryKey(); pk.ProductGroupID = groupID; this.cbx_Product.SelectedIndexChanged -= new System.EventHandler(this.cbx_Product_SelectedIndexChanged); cbx_Product.DataSource = null; cbx_Product.DataSource = null;//_bDProductWrapper.SelectAllByForeignKeyProductGroupID(pk); cbx_Product.DisplayMember = "ProductName"; cbx_Product.ValueMember = "ProductID"; this.cbx_Product.SelectedIndexChanged += new System.EventHandler(this.cbx_Product_SelectedIndexChanged); cbx_Product.SelectedIndex = -1; } catch (Exception ex) { MessageBox.Show("حدث خطأ برجاء تكرار العمليه مره اخرى واذا تكرر الخطا برجاءالاتصال بالشخص المصمم للبرنامج وارسال رسالة الخطا التى ستظهر بعد قليل له"); MessageBox.Show(ex.Message); } }
private void FillProductCBX(int groupID) { try { BDProductGroupPrimaryKey pk = new BDProductGroupPrimaryKey(); pk.ProductGroupID = groupID; this.cbx_Product.SelectedIndexChanged -= new System.EventHandler(this.cbx_Product_SelectedIndexChanged); cbx_Product.DataSource = null; var result = _bDProductWrapper.SelectAllProductsByGroupID(_inventoryID, pk); if (result != null) { cbx_Product.DataSource = result; cbx_Product.DisplayMember = "ProductName"; cbx_Product.ValueMember = "ProductID"; this.cbx_Product.SelectedIndexChanged += new System.EventHandler(this.cbx_Product_SelectedIndexChanged); cbx_Product.SelectedIndex = -1; } } catch (Exception) { throw; } }
public override void btn_Delete_Click(object sender, EventArgs e) { int?productGroupID = 0; if (dgrid_Result.Rows[dgrid_Result.SelectedCells[0].RowIndex].Cells["ProductGroupID"].Value != null) { if (MessageBox.Show("هل نت متأكد من حذف المجموعة؟", "تحذير", MessageBoxButtons.YesNo) == DialogResult.Yes) { productGroupID = Convert.ToInt32(dgrid_Result.Rows[dgrid_Result.SelectedCells[0].RowIndex].Cells["ProductGroupID"].Value); BDProductGroupPrimaryKey productGroupPK = new BDProductGroupPrimaryKey(); productGroupPK.ProductGroupID = productGroupID; _bdProductGroupWrapper.Delete(productGroupPK); } else { return; } } else { MessageBox.Show("لابد من اختيار مجموعة"); } InitiateGrid(); }
///<summary> ///This method will Delete the object from the database ///</summary> ///<param name="pk" type="BDProductGroupPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// <returns>True if succeeded</returns> public bool Delete(BDProductGroupPrimaryKey pk) { return POS.DataLayer.BDProductGroupBase.Delete(new POS.DataLayer.BDProductGroupPrimaryKey(pk.ProductGroupID)); }