/// <summary> /// 赋值库存信息 /// </summary> /// <param name="ctx">数据上下文</param> /// <param name="lnqOutPut">单据信息</param> /// <param name="detail1">明细信息</param> /// <returns>返回库存信息对象</returns> S_Stock AssignStockInfo(DepotManagementDataContext ctx, Business_WarehouseInPut_InPut lnqInPut, View_Business_WarehouseInPut_InPutDetail detail1) { S_Stock tempLnqStock = new S_Stock(); tempLnqStock.GoodsID = detail1.物品ID; tempLnqStock.BatchNo = detail1.批次号; tempLnqStock.Date = ServerTime.Time; tempLnqStock.Provider = detail1.供应商; tempLnqStock.StorageID = lnqInPut.StorageID; tempLnqStock.ExistCount = Convert.ToDecimal(detail1.数量); return(tempLnqStock); }
/// <summary> /// 赋值账务信息_出 /// </summary> /// <param name="ctx">数据上下文</param> /// <param name="lnqOutPut">单据信息</param> /// <param name="detail1">明细信息</param> /// <returns>返回账务信息对象</returns> S_FetchGoodsDetailBill AssignDetailInfo_Out(DepotManagementDataContext ctx, Business_WarehouseInPut_InPut lnqInPut, View_Business_WarehouseInPut_InPutDetail detail1) { ServerModule.IStoreServer storeService = ServerModule.ServerModuleFactory.GetServerModule <ServerModule.IStoreServer>(); IFlowServer serverFlow = FlowControlService.ServerModuleFactory.GetServerModule <IFlowServer>(); CommonProcessInfo processInfo = new CommonProcessInfo(); CE_InPutBusinessType inPutType = GlobalObject.GeneralFunction.StringConvertToEnum <CE_InPutBusinessType>(lnqInPut.BillType); S_FetchGoodsDetailBill fetchDetail = new S_FetchGoodsDetailBill(); fetchDetail.AssociatedBillNo = detail1.关联业务; fetchDetail.AssociatedBillType = CE_BillTypeEnum.入库申请单.ToString(); fetchDetail.BatchNo = detail1.批次号; fetchDetail.BillTime = ServerTime.Time; fetchDetail.DepartDirector = ""; fetchDetail.Department = lnqInPut.ApplyingDepartment; fetchDetail.Depot = UniversalFunction.GetGoodsInfo(detail1.物品ID).物品类别名称; fetchDetail.Price = Math.Round(detail1.单价 * detail1.数量, 2); fetchDetail.UnitPrice = detail1.单价; processInfo = serverFlow.GetFlowData(detail1.关联业务).First(); fetchDetail.FillInDate = Convert.ToDateTime(processInfo.时间); fetchDetail.FillInPersonnel = processInfo.人员; fetchDetail.FetchBIllID = lnqInPut.BillNo; fetchDetail.FetchCount = -detail1.数量; fetchDetail.GoodsID = detail1.物品ID; fetchDetail.OperationType = (int)GlobalObject.EnumOperation.InPutBusinessTypeConvertToSubsidiaryOperationType(inPutType); fetchDetail.Provider = detail1.供应商; fetchDetail.Remark = detail1.备注; fetchDetail.StorageID = lnqInPut.StorageID; DataTable stockTable = storeService.GetGoodsStockInfo(fetchDetail.GoodsID, fetchDetail.BatchNo, fetchDetail.Provider, fetchDetail.StorageID); if (stockTable != null && stockTable.Rows.Count > 0) { fetchDetail.ProviderBatchNo = stockTable.Rows[0]["ProviderBatchNo"].ToString(); } else { fetchDetail.ProviderBatchNo = ""; } fetchDetail.Using = lnqInPut.BillTypeDetail; return(fetchDetail); }
/// <summary> /// 赋值账务信息_入 /// </summary> /// <param name="ctx">数据上下文</param> /// <param name="lnqOutPut">单据信息</param> /// <param name="detail1">明细信息</param> /// <returns>返回账务信息对象</returns> S_InDepotDetailBill AssignDetailInfo_In(DepotManagementDataContext ctx, Business_WarehouseInPut_InPut lnqInPut, View_Business_WarehouseInPut_InPutDetail detail1) { IFlowServer serverFlow = FlowControlService.ServerModuleFactory.GetServerModule <IFlowServer>(); CommonProcessInfo processInfo = new CommonProcessInfo(); CE_InPutBusinessType inPutType = GlobalObject.GeneralFunction.StringConvertToEnum <CE_InPutBusinessType>(lnqInPut.BillType); S_InDepotDetailBill inDepotDetail = new S_InDepotDetailBill(); inDepotDetail.AffrimPersonnel = BasicInfo.LoginName; inDepotDetail.BatchNo = detail1.批次号; inDepotDetail.BillTime = ServerTime.Time; inDepotDetail.Department = UniversalFunction.GetDeptName(lnqInPut.ApplyingDepartment); inDepotDetail.Depot = UniversalFunction.GetGoodsInfo(detail1.物品ID).物品类别名称; inDepotDetail.FactPrice = Math.Round(detail1.单价 * detail1.数量, 2); inDepotDetail.FactUnitPrice = detail1.单价; inDepotDetail.Price = inDepotDetail.FactPrice; inDepotDetail.UnitPrice = inDepotDetail.FactUnitPrice; inDepotDetail.InvoicePrice = null; inDepotDetail.InvoiceUnitPrice = null; processInfo = serverFlow.GetFlowData(detail1.关联业务).First(); inDepotDetail.FillInDate = Convert.ToDateTime(processInfo.时间); inDepotDetail.FillInPersonnel = processInfo.人员; inDepotDetail.InDepotBillID = lnqInPut.BillNo; inDepotDetail.InDepotCount = detail1.数量; inDepotDetail.GoodsID = detail1.物品ID; inDepotDetail.OperationType = (int)GlobalObject.EnumOperation.InPutBusinessTypeConvertToSubsidiaryOperationType(inPutType); inDepotDetail.Provider = detail1.供应商; inDepotDetail.Remark = detail1.备注; inDepotDetail.StorageID = lnqInPut.StorageID; return(inDepotDetail); }
private bool customForm_PanelGetDateInfo(CE_FlowOperationType flowOperationType) { try { if (!CheckData()) { return(false); } m_lnqBillInfo = new Business_WarehouseInPut_InPut(); m_lnqBillInfo.BillNo = txtBillNo.Text; m_lnqBillInfo.BillType = cmbBillType.Text; m_lnqBillInfo.BillTypeDetail = cmbTypeDetail.Text; m_lnqBillInfo.ApplyingDepartment = txtApplyingDepartment.Tag.ToString(); m_lnqBillInfo.StorageID = cmbStorage.SelectedValue.ToString(); m_lnqBillInfo.Remark = txtRemark.Text; List <View_Business_WarehouseInPut_InPutDetail> listTemp = new List <View_Business_WarehouseInPut_InPutDetail>(); foreach (DataGridViewRow dgvr in customDataGridView1.Rows) { View_Business_WarehouseInPut_InPutDetail detailTemp = new View_Business_WarehouseInPut_InPutDetail(); detailTemp.备注 = dgvr.Cells["备注"].Value == null ? "" : dgvr.Cells["备注"].Value.ToString(); detailTemp.单据号 = txtBillNo.Text; detailTemp.单位 = dgvr.Cells["单位"].Value == null ? "" : dgvr.Cells["单位"].Value.ToString(); detailTemp.供应商 = dgvr.Cells["供应商"].Value == null ? "" : dgvr.Cells["供应商"].Value.ToString(); detailTemp.关联业务 = dgvr.Cells["关联业务"].Value == null ? "" : dgvr.Cells["关联业务"].Value.ToString(); 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.图号型号 = 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(); if (detailTemp.供应商 == "") { throw new Exception(UniversalFunction.GetGoodsMessage(detailTemp.物品ID) + "批次号:【" + detailTemp.批次号 + "】,供应商为空,请选择供应商"); } switch (GlobalObject.GeneralFunction.StringConvertToEnum <CE_InPutBusinessType>(m_lnqBillInfo.BillType)) { case CE_InPutBusinessType.生产采购: case CE_InPutBusinessType.普通采购: case CE_InPutBusinessType.委外采购: case CE_InPutBusinessType.样品采购: case CE_InPutBusinessType.自制件入库: break; case CE_InPutBusinessType.领料退库: case CE_InPutBusinessType.营销入库: case CE_InPutBusinessType.营销退库: if (!m_serverProductCode.IsFitCount(detailTemp.物品ID, Convert.ToInt32(detailTemp.数量), detailTemp.单据号)) { MessageBox.Show("请对产品设置流水号,并保证产品数量与流水号数一致", "提示"); return(false); } break; default: break; } listTemp.Add(detailTemp); } this.FlowInfo_BillNo = txtBillNo.Text; this.ResultInfo = listTemp; this.ResultList = new List <object>(); this.ResultList.Add(m_lnqBillInfo); this.ResultList.Add(flowOperationType); return(true); } catch (Exception ex) { MessageDialog.ShowPromptMessage(ex.Message); return(false); } }
public List <View_Business_WarehouseInPut_InPutDetail> GetReferenceListViewDetail(string billNo, List <string> listBillNo, bool isRepeat) { string error = ""; List <View_Business_WarehouseInPut_InPutDetail> listResult = new List <View_Business_WarehouseInPut_InPutDetail>(); if (listBillNo.Count == 0) { throw new Exception("选择记录为空"); } string orderFormNum = ""; foreach (string item in listBillNo) { orderFormNum += "'" + item + "',"; } orderFormNum = orderFormNum.Substring(0, orderFormNum.Length - 1); Hashtable hashTable = new Hashtable(); hashTable.Add("@ListBillNo", orderFormNum); hashTable.Add("@IsRepeat", isRepeat); DataTable tempTable = GlobalObject.DatabaseServer.QueryInfoPro("Business_WarehouseInPut_InPut_ReferenceDetail", hashTable, out error); if (error != null && error.Trim().Length > 0) { throw new Exception(error); } if (tempTable != null && tempTable.Rows.Count > 0) { foreach (DataRow dr in tempTable.Rows) { View_Business_WarehouseInPut_InPutDetail tempLnq = new View_Business_WarehouseInPut_InPutDetail(); View_F_GoodsPlanCost goodsInfo = UniversalFunction.GetGoodsInfo(Convert.ToInt32(dr["GoodsID"])); tempLnq.单据号 = billNo; tempLnq.单位 = goodsInfo.单位; tempLnq.供应商 = dr["Provider"].ToString(); tempLnq.关联业务 = dr["BillNo"].ToString(); tempLnq.物品ID = Convert.ToInt32(dr["GoodsID"]); tempLnq.图号型号 = goodsInfo.图号型号; tempLnq.物品名称 = goodsInfo.物品名称; tempLnq.规格 = goodsInfo.规格; tempLnq.数量 = Convert.ToDecimal(dr["GoodsCount"]); DepotManagementDataContext ctx = CommentParameter.DepotDataContext; var varData = from a in ctx.Business_WarehouseInPut_AOGDetail where a.BillRelate == tempLnq.关联业务 && a.GoodsID == tempLnq.物品ID && a.Provider == tempLnq.供应商 select a; if (varData.Count() == 1) { tempLnq.批次号 = varData.Single().BatchNo; } else { tempLnq.批次号 = dr["BatchNo"].ToString(); } listResult.Add(tempLnq); } } return(listResult); }