Esempio n. 1
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            if (txtProductType.Text.Trim().Length == 0)
            {
                MessageDialog.ShowPromptMessage(string.Format("请选择产品类型"));
                return;
            }

            //if (!txtPurpose.Text.Contains(txtProductType.Text))
            //{
            //    txtProductType.Focus();
            //    MessageDialog.ShowPromptMessage("请选择与用途匹配的产品类型");
            //    return;
            //}

            if (numRequestCount.Value == 0)
            {
                MessageDialog.ShowPromptMessage(string.Format("整台份数量不能等于0"));
                return;
            }

            Service_Manufacture_Storage.IProductOrder server = Service_Manufacture_Storage.ServerModuleFactory.GetServerModule <Service_Manufacture_Storage.IProductOrder>();
            List <BASE_ProductOrder> mrGoodsOrder            =
                server.GetAllDataList(chbIncludeAfterSupplement.Checked ? FetchGoodsType.整台领料 : FetchGoodsType.整台领料不含后补充,
                                      txtProductType.Text, CE_DebitScheduleApplicable.正常装配, true);

            if (mrGoodsOrder.Count == 0)
            {
                MessageDialog.ShowPromptMessage(string.Format("没有找到{0}整台份的领料排序规则,无法进行此操作!", txtProductType.Text));
                return;
            }

            List <View_Business_WarehouseOutPut_WholeMachineRequisitionDetail> source =
                new List <View_Business_WarehouseOutPut_WholeMachineRequisitionDetail>();

            foreach (BASE_ProductOrder item1 in mrGoodsOrder)
            {
                View_Business_WarehouseOutPut_WholeMachineRequisitionDetail tempView =
                    new View_Business_WarehouseOutPut_WholeMachineRequisitionDetail();

                View_F_GoodsPlanCost goodsInfo = UniversalFunction.GetGoodsInfo(item1.GoodsID);

                tempView.单据号  = txtBillNo.Text;
                tempView.单位   = goodsInfo.单位;
                tempView.规格   = goodsInfo.规格;
                tempView.基数   = item1.Redices;
                tempView.数量   = item1.Redices * numRequestCount.Value;
                tempView.图号型号 = goodsInfo.图号型号;
                tempView.物品ID = item1.GoodsID;
                tempView.物品名称 = goodsInfo.物品名称;


                source.Add(tempView);
            }

            RefreshDataGridView(source, null);

            txtProductType.Enabled            = false;
            numRequestCount.Enabled           = false;
            txtPurpose.Enabled                = false;
            btnCreate.Enabled                 = false;
            chbIncludeAfterSupplement.Enabled = false;
        }