/// <summary> /// 采购员提交单据 /// </summary> /// <param name="billNo">单据号</param> /// <param name="status">提交后的单据状态</param> /// <param name="returnInfo">返回更新后重新查询的领料单数据集</param> /// <param name="error">出错时返回错误信息,无错时返回null</param> /// <returns>返回是否成功添加领料单</returns> public bool SubmitNewBill(string billNo, OrdinaryInDepotBillStatus status, out IQueryResult returnInfo, out string error) { returnInfo = null; error = null; try { DepotManagementDataContext dataContxt = CommentParameter.DepotDataContext; var result = from r in dataContxt.S_OrdinaryInDepotBill where r.Bill_ID == billNo select r; if (result.Count() == 0) { error = string.Format("没有找到单据号为 {0} 的普通入库单信息,无法进行此操作", billNo); return(false); } result.Single().BillStatus = status.ToString(); result.Single().Bill_Time = ServerModule.ServerTime.Time; if (!m_serverFrockStandingBook.DeleteFrockOrdinaryInDepotBill(dataContxt, billNo, out error)) { return(false); } //插入工装信息 IDepotTypeForPersonnel serverDepot = ServerModuleFactory.GetServerModule <IDepotTypeForPersonnel>(); if (serverDepot.GetDepotInfo(result.Single().Depot).DepotName == GlobalObject.CE_GoodsType.工装.ToString() && !CreateNewFrockMessage(result.Single(), out error)) { return(false); } dataContxt.SubmitChanges(); return(GetAllBill(out returnInfo, out error)); } catch (Exception exce) { error = exce.Message; return(false); } }
/// <summary> /// 机加人员提交单据 /// </summary> /// <param name="billNo">单据号</param> /// <param name="flag">操作标志</param> /// <param name="returnInfo">返回更新后重新查询的数据集</param> /// <param name="error">出错时返回错误信息,无错时返回null</param> /// <returns>返回是否成功</returns> public bool SubmitNewBill(string billNo, bool flag, out IQueryResult returnInfo, out string error) { returnInfo = null; error = null; try { DepotManagementDataContext dataContxt = CommentParameter.DepotDataContext; var result = from r in dataContxt.S_FrockInDepotBill where r.Bill_ID == billNo select r; if (result.Count() == 0) { error = string.Format("没有找到单据号为 {0} 的自制件工装报检信息,无法进行此操作", billNo); return(false); } result.Single().Bill_Status = "等待工装验证"; result.Single().Bill_Time = ServerModule.ServerTime.Time; if (!m_serverFrockStandingBook.DeleteFrockOrdinaryInDepotBill(dataContxt, billNo, out error)) { return(false); } //插入工装信息 if (!CreateNewFrockMessage(result.Single(), flag, out error)) { return(false); } dataContxt.SubmitChanges(); return(GetAllBill(out returnInfo, out error)); } catch (Exception exce) { error = exce.Message; return(false); } }