private void butAddSupply_Click(object sender, EventArgs e)
        {
            if (gridOrders.GetSelectedIndex() == -1)
            {
                MsgBox.Show(this, "Please select a supply order to add items to first.");
                return;
            }
            FormSupplies FormSup = new FormSupplies();

            FormSup.IsSelectMode        = true;
            FormSup.SelectedSupplierNum = _listOrders[gridOrders.GetSelectedIndex()].SupplierNum;
            FormSup.ShowDialog();
            if (FormSup.DialogResult != DialogResult.OK)
            {
                return;
            }

            for (int i = 0; i < FormSup.ListSelectedSupplies.Count; i++)
            {
                //check for existing----
                if (_tableOrderItems.Rows.OfType <DataRow>().Any(x => PIn.Long(x["SupplyNum"].ToString()) == FormSup.ListSelectedSupplies[i].SupplyNum))
                {
                    //MsgBox.Show(this,"Selected item already exists in currently selected order. Please edit quantity instead.");
                    continue;
                }
                SupplyOrderItem orderitem = new SupplyOrderItem();
                orderitem.SupplyNum      = FormSup.ListSelectedSupplies[i].SupplyNum;
                orderitem.Qty            = 1;
                orderitem.Price          = FormSup.ListSelectedSupplies[i].Price;
                orderitem.SupplyOrderNum = _listOrders[gridOrders.GetSelectedIndex()].SupplyOrderNum;
                //soi.SupplyOrderItemNum
                SupplyOrderItems.Insert(orderitem);
            }
            UpdatePriceAndRefresh();
        }
		private void butAddSupply_Click(object sender,EventArgs e) {
			if(gridOrders.GetSelectedIndex()==-1) {
				MsgBox.Show(this,"Please select a supply order to add items to first.");
				return;
			}
			FormSupplies FormSup = new FormSupplies();
			FormSup.IsSelectMode = true;
			FormSup.SelectedSupplierNum = ListOrders[gridOrders.GetSelectedIndex()].SupplierNum;
			FormSup.ShowDialog();
			if(FormSup.DialogResult!=DialogResult.OK) {
				return;
			}
			
			for(int i=0;i<FormSup.ListSelectedSupplies.Count;i++) {
				//check for existing----			
				if(itemExistsHelper(FormSup.ListSelectedSupplies[i])) {
					//MsgBox.Show(this,"Selected item already exists in currently selected order. Please edit quantity instead.");
					continue;
				}
				SupplyOrderItem orderitem = new SupplyOrderItem();
				orderitem.SupplyNum = FormSup.ListSelectedSupplies[i].SupplyNum;
				orderitem.Qty=1;
				orderitem.Price = FormSup.ListSelectedSupplies[i].Price;
				orderitem.SupplyOrderNum = ListOrders[gridOrders.GetSelectedIndex()].SupplyOrderNum;
				//soi.SupplyOrderItemNum
				SupplyOrderItems.Insert(orderitem);
			}
			FillGridOrderItem();
		}
Exemple #3
0
        private void butAddSupply_Click(object sender, EventArgs e)
        {
            if (gridOrders.GetSelectedIndex() == -1)
            {
                MsgBox.Show(this, "Please select a supply order to add items to first.");
                return;
            }
            FormSupplies FormSup = new FormSupplies();

            FormSup.IsSelectMode        = true;
            FormSup.SelectedSupplierNum = ListOrders[gridOrders.GetSelectedIndex()].SupplierNum;
            FormSup.ShowDialog();
            if (FormSup.DialogResult != DialogResult.OK)
            {
                return;
            }

            for (int i = 0; i < FormSup.ListSelectedSupplies.Count; i++)
            {
                //check for existing----
                if (itemExistsHelper(FormSup.ListSelectedSupplies[i]))
                {
                    //MsgBox.Show(this,"Selected item already exists in currently selected order. Please edit quantity instead.");
                    continue;
                }
                SupplyOrderItem orderitem = new SupplyOrderItem();
                orderitem.SupplyNum      = FormSup.ListSelectedSupplies[i].SupplyNum;
                orderitem.Qty            = 1;
                orderitem.Price          = FormSup.ListSelectedSupplies[i].Price;
                orderitem.SupplyOrderNum = ListOrders[gridOrders.GetSelectedIndex()].SupplyOrderNum;
                //soi.SupplyOrderItemNum
                SupplyOrderItems.Insert(orderitem);
            }
            FillGridOrderItem();
        }
Exemple #4
0
        private void butSupplies_Click(object sender, EventArgs e)
        {
            FormSupplies FormSup = new FormSupplies();

            FormSup.ShowDialog();
        }
		private void butSupplies_Click(object sender,EventArgs e) {
			FormSupplies FormSup=new FormSupplies();
			FormSup.ShowDialog();
		}