Beispiel #1
0
        /// <summary>
        /// 订单中新增产品
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            //已出库就不能新增产品了吧
            if (selectOrder == null)
            {
                MessageBox.Show("请选择一个订单!");
                return;
            }
            AddSalesCommodities salesCommodity = new AddSalesCommodities();

            salesCommodity.SalesOrderID = selectOrder.ID;
            if (salesCommodity.ShowDialog() == DialogResult.OK)
            {
                BLLSalesOrders.SalesManagerServiceClient client = WCFServiceBLL.GetSalesService();
                List <Model.SalesCommodityModel>         salesCommoditiesList = client.GetSalesCommoditiesByID(selectOrder.ID).ToList();
                dataGridViewCommoditiesList.DataSource = salesCommoditiesList;
            }
        }
Beispiel #2
0
 /// <summary>
 /// 修改订单中产品
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void toolStripButton5_Click(object sender, EventArgs e)
 {
     //订单已经提交的情况下,不能修改产品
     if (dataGridViewCommoditiesList.SelectedRows.Count > 0)
     {
         int cID = int.Parse(dataGridViewCommoditiesList.SelectedRows[0].Cells["ColumnID"].Value.ToString());
         AddSalesCommodities updateSalesCommodityForm = new AddSalesCommodities(cID);
         updateSalesCommodityForm.SalesOrderID = selectOrder.ID;
         if (updateSalesCommodityForm.ShowDialog() == DialogResult.OK)
         {
             BLLSalesOrders.SalesManagerServiceClient client = WCFServiceBLL.GetSalesService();
             dataGridViewCommoditiesList.DataSource = client.GetSalesCommoditiesByID(selectOrder.ID);
         }
     }
     else
     {
         MessageBox.Show("请选择要修改的商品");
         return;
     }
 }