public static CE_MarketingType InPutBusinessTypeConvertToMarketingType(CE_InPutBusinessType inPutType)
        {
            CE_MarketingType result = CE_MarketingType.未知;

            switch (inPutType)
            {
            case CE_InPutBusinessType.生产采购:
            case CE_InPutBusinessType.普通采购:
            case CE_InPutBusinessType.委外采购:
            case CE_InPutBusinessType.样品采购:
            case CE_InPutBusinessType.自制件入库:
            case CE_InPutBusinessType.营销入库:
                result = CE_MarketingType.入库;
                break;

            case CE_InPutBusinessType.领料退库:
                result = CE_MarketingType.领料退库;
                break;

            case CE_InPutBusinessType.营销退库:
                result = CE_MarketingType.退库;
                break;

            default:
                break;
            }

            return(result);
        }
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);
            }
        }
        public static CE_MarketingType OutPutBusinessTypeConvertToMarketingType(CE_OutPutBusinessType outPutType)
        {
            CE_MarketingType result = CE_MarketingType.未知;

            switch (outPutType)
            {
            case CE_OutPutBusinessType.领料:
                result = CE_MarketingType.领料;
                break;

            case CE_OutPutBusinessType.营销出库:
                result = CE_MarketingType.出库;
                break;

            case CE_OutPutBusinessType.营销退货:
            case CE_OutPutBusinessType.采购退货:
            case CE_OutPutBusinessType.自制件退货:
                result = CE_MarketingType.退货;
                break;

            default:
                break;
            }

            return(result);
        }
        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 #5
0
        public void OperationGaugeStandingBook(DepotManagementDataContext ctx, string billNo, CE_MarketingType type, int operationType)
        {
            try
            {
                CE_SubsidiaryOperationType subType =
                    (CE_SubsidiaryOperationType)Enum.ToObject(typeof(CE_SubsidiaryOperationType), operationType);

                var varData = from a in ctx.S_GaugeOperation
                              where a.BillID == billNo
                              select a;

                foreach (S_GaugeOperation operationInfo in varData)
                {
                    S_GaugeStandingBook lnqBook = new S_GaugeStandingBook();

                    var varbook = from a in ctx.S_GaugeStandingBook
                                  where a.GaugeCoding == operationInfo.GaugeCoding
                                  select a;

                    if (varbook.Count() > 1)
                    {
                        throw new Exception("【物品ID】:" + operationInfo.GoodsID.ToString() + " 【量检具编号】:" + operationInfo.GaugeCoding
                                            + ",在【量检具台账】中存在多个,无法进行业务操作");
                    }

                    if (type == CE_MarketingType.入库)
                    {
                        if (varbook.Count() == 0)
                        {
                            lnqBook             = new S_GaugeStandingBook();
                            lnqBook.GaugeCoding = operationInfo.GaugeCoding;
                            lnqBook.GoodsID     = operationInfo.GoodsID;
                            lnqBook.InputDate   = ServerTime.Time;
                            lnqBook.ScrapFlag   = false;
                            lnqBook.Validity    = 0;
                        }
                        else
                        {
                            lnqBook = varbook.Single();
                            lnqBook.MaterialDate = null;
                            lnqBook.DutyUser     = null;
                            lnqBook.ScrapFlag    = false;
                        }
                    }
                    else if (type == CE_MarketingType.出库)
                    {
                        if (varbook.Count() == 0)
                        {
                            throw new Exception("【物品ID】:" + operationInfo.GoodsID.ToString() + " 【量检具编号】:" + operationInfo.GaugeCoding
                                                + ",不存在【量检具台账】中,无法进行【出库】业务操作");
                        }

                        lnqBook              = varbook.Single();
                        lnqBook.DutyUser     = null;
                        lnqBook.ScrapFlag    = false;
                        lnqBook.MaterialDate = ServerTime.Time;

                        if (subType == CE_SubsidiaryOperationType.领料)
                        {
                            lnqBook.MaterialDate = ServerTime.Time;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }