private void customDataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == -1 && e.RowIndex >= 0 &&
                customDataGridView1.CurrentRow.Cells["物品ID"].Value != null &&
                customDataGridView1.CurrentRow.Cells["物品ID"].Value.ToString().Length > 0)
            {
                BarCodeInfo barCode = new BarCodeInfo();

                barCode.BatchNo = customDataGridView1.CurrentRow.Cells["批次号"].Value == null ? "" :
                                  customDataGridView1.CurrentRow.Cells["批次号"].Value.ToString();
                barCode.Count = customDataGridView1.CurrentRow.Cells["数量"].Value == null ? 0 :
                                Convert.ToDecimal(customDataGridView1.CurrentRow.Cells["数量"].Value);
                barCode.GoodsID = Convert.ToInt32(customDataGridView1.CurrentRow.Cells["物品ID"].Value);

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

                barCode.GoodsName = goodsInfo.物品名称;
                barCode.GoodsCode = goodsInfo.图号型号;
                barCode.Spec      = goodsInfo.规格;

                CE_BusinessType tempType = CE_BusinessType.库房业务;

                Service_Manufacture_WorkShop.IWorkShopBasic serverWSBasic =
                    Service_Manufacture_WorkShop.ServerModuleFactory.GetServerModule <Service_Manufacture_WorkShop.IWorkShopBasic>();

                WS_WorkShopCode tempWSCode = serverWSBasic.GetWorkShopCodeInfo(txtApplyingDepartment.Tag.ToString());

                Dictionary <string, string> tempDic = new Dictionary <string, string>();

                CE_InPutBusinessType inPutType =
                    GlobalObject.GeneralFunction.StringConvertToEnum <CE_InPutBusinessType>(cmbBillType.Text);
                CE_MarketingType marketType =
                    GlobalObject.EnumOperation.InPutBusinessTypeConvertToMarketingType(inPutType);
                CE_SubsidiaryOperationType subsdiaryType =
                    GlobalObject.EnumOperation.InPutBusinessTypeConvertToSubsidiaryOperationType(inPutType);

                tempDic.Add("", marketType.ToString());

                if (tempWSCode != null)
                {
                    tempType = CE_BusinessType.综合业务;
                    tempDic.Add(tempWSCode.WSCode, subsdiaryType.ToString());
                }

                产品编号 frm = new 产品编号(barCode, tempType, txtBillNo.Text, (lbBillStatus.Text != CE_CommonBillStatus.单据完成.ToString()), tempDic);

                if (frm.ShowDialog() == DialogResult.OK)
                {
                    customDataGridView1.Rows[e.RowIndex].Cells["数量"].Value = frm.IntCount;
                }
            }
        }
Example #2
0
        /// <summary>
        /// 操作账务信息与库存信息_出
        /// </summary>
        /// <param name="dataContext">数据上下文</param>
        /// <param name="lnqOutPut">单据信息</param>
        void OperationDetailAndStock_Out(DepotManagementDataContext dataContext, Business_WarehouseInPut_InPut lnqInPut)
        {
            string             error = "";
            IProductCodeServer productCodeService =
                ServerModule.ServerModuleFactory.GetServerModule <ServerModule.IProductCodeServer>();
            CE_MarketingType marketingType = GlobalObject.EnumOperation.OutPutBusinessTypeConvertToMarketingType(
                GlobalObject.GeneralFunction.StringConvertToEnum <CE_OutPutBusinessType>(lnqInPut.BillType));
            IFinancialDetailManagement serverDetail =
                ServerModule.ServerModuleFactory.GetServerModule <IFinancialDetailManagement>();

            List <View_Business_WarehouseInPut_InPutDetail> listDetail = GetListViewDetailInfo(lnqInPut.BillNo);

            foreach (View_Business_WarehouseInPut_InPutDetail detail1 in listDetail)
            {
                if (!productCodeService.UpdateProductStock(dataContext, lnqInPut.BillNo, marketingType.ToString(), lnqInPut.StorageID,
                                                           (lnqInPut.StorageID == "05" && marketingType == CE_MarketingType.入库) ? true : false, detail1.物品ID, out error))
                {
                    throw new Exception(error);
                }

                S_FetchGoodsDetailBill detailInfo = AssignDetailInfo_Out(dataContext, lnqInPut, detail1);
                S_Stock stockInfo = AssignStockInfo(dataContext, lnqInPut, detail1);

                if (detailInfo == null || stockInfo == null)
                {
                    throw new Exception("获取账务信息或者库存信息失败");
                }

                serverDetail.ProcessFetchGoodsDetail(dataContext, detailInfo, stockInfo);
            }
        }