Esempio n. 1
0
        private bool customForm_PanelGetDateInfo(CE_FlowOperationType flowOperationType)
        {
            try
            {
                if (!CheckData())
                {
                    return(false);
                }

                m_lnqBillInfo = new Business_WarehouseOutPut_WholeMachineRequisition();

                m_lnqBillInfo.BillNo                 = txtBillNo.Text;
                m_lnqBillInfo.BillTypeDetail         = txtPurpose.Text;
                m_lnqBillInfo.ProductType            = txtProductType.Text.ToString();
                m_lnqBillInfo.MachineCount           = numRequestCount.Value;
                m_lnqBillInfo.Remark                 = txtRemark.Text;
                m_lnqBillInfo.IncludeAfterSupplement = chbIncludeAfterSupplement.Checked;

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

                foreach (DataGridViewRow dgvr in customDataGridView1.Rows)
                {
                    View_Business_WarehouseOutPut_WholeMachineRequisitionDetail detailTemp =
                        new View_Business_WarehouseOutPut_WholeMachineRequisitionDetail();

                    detailTemp.单据号  = txtBillNo.Text;
                    detailTemp.单位   = dgvr.Cells["单位"].Value == null ? "" : dgvr.Cells["单位"].Value.ToString();
                    detailTemp.规格   = dgvr.Cells["规格"].Value == null ? "" : dgvr.Cells["规格"].Value.ToString();
                    detailTemp.数量   = Convert.ToDecimal(dgvr.Cells["数量"].Value);
                    detailTemp.基数   = Convert.ToDecimal(dgvr.Cells["基数"].Value);
                    detailTemp.图号型号 = dgvr.Cells["图号型号"].Value == null ? "" : dgvr.Cells["图号型号"].Value.ToString();
                    detailTemp.物品ID = Convert.ToInt32(dgvr.Cells["物品ID"].Value);
                    detailTemp.物品名称 = dgvr.Cells["物品名称"].Value == null ? "" : dgvr.Cells["物品名称"].Value.ToString();

                    listDetail.Add(detailTemp);
                }

                List <View_Business_WarehouseOutPut_WholeMachineRequisition_StorageID> listStorage =
                    new List <View_Business_WarehouseOutPut_WholeMachineRequisition_StorageID>();

                foreach (DataGridViewRow dgvr in customDataGridView2.Rows)
                {
                    View_Business_WarehouseOutPut_WholeMachineRequisition_StorageID storageTemp =
                        new View_Business_WarehouseOutPut_WholeMachineRequisition_StorageID();

                    storageTemp.单据号  = txtBillNo.Text;
                    storageTemp.库房名称 = dgvr.Cells["库房名称"].Value == null ? "" : dgvr.Cells["库房名称"].Value.ToString();
                    storageTemp.库房代码 = dgvr.Cells["库房代码"].Value == null ? "" : dgvr.Cells["库房代码"].Value.ToString();
                    storageTemp.库房顺序 = dgvr.Cells["库房顺序"].Value == null ? 0 : Convert.ToInt32(dgvr.Cells["库房顺序"].Value.ToString());

                    listStorage.Add(storageTemp);
                }

                this.FlowInfo_BillNo = txtBillNo.Text;

                this.ResultList = new List <object>();

                this.ResultList.Add(m_lnqBillInfo);
                this.ResultList.Add(listDetail);
                this.ResultList.Add(listStorage);
                this.ResultList.Add(flowOperationType);

                return(true);
            }
            catch (Exception ex)
            {
                MessageDialog.ShowPromptMessage(ex.Message);
                return(false);
            }
        }
Esempio n. 2
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;
        }
        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;
            }

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

            Service_Project_Design.IBOMInfoService service =
                Service_Project_Design.ServerModuleFactory.GetServerModule <Service_Project_Design.IBOMInfoService>();

            bool isCVT = Convert.ToBoolean(UniversalFunction.GetGoodsAttributeInfo(Convert.ToInt32(txtProductType.Tag), CE_GoodsAttributeName.CVT));
            bool isTCU = Convert.ToBoolean(UniversalFunction.GetGoodsAttributeInfo(Convert.ToInt32(txtProductType.Tag), CE_GoodsAttributeName.TCU));

            DataTable tablePBOM = service.GetPBOMItems(isCVT || isTCU ? txtProductType.Text : txtProductType.Tag.ToString());

            if (tablePBOM.Rows.Count == 0)
            {
                MessageDialog.ShowPromptMessage(string.Format("没有找到{0}型号的生产BOM,无法进行此操作!", txtProductType.Text));
                return;
            }

            foreach (DataRow dr in tablePBOM.Rows)
            {
                View_Business_WarehouseOutPut_WholeMachineRequisitionDetail tempView =
                    new View_Business_WarehouseOutPut_WholeMachineRequisitionDetail();

                View_F_GoodsPlanCost goodsInfo = UniversalFunction.GetGoodsInfo(Convert.ToInt32(dr["GoodsID"]));

                tempView.单据号  = txtBillNo.Text;
                tempView.单位   = goodsInfo.单位;
                tempView.规格   = goodsInfo.规格;
                tempView.基数   = Convert.ToDecimal(dr["Usage"]);
                tempView.数量   = Convert.ToDecimal(dr["Usage"]) * numRequestCount.Value;
                tempView.图号型号 = goodsInfo.图号型号;
                tempView.物品ID = Convert.ToInt32(dr["GoodsID"]);
                tempView.物品名称 = goodsInfo.物品名称;

                source.Add(tempView);
            }

            //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;
            //}

            //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;
        }