Ejemplo n.º 1
0
        /// <summary>
        /// 新增库存信息(虚拟库存)
        /// </summary>
        /// <param name="planProd">计划生产的零件</param>
        /// <returns></returns>
        public string AddInventoryInfor(Prod_PlanProd planProd, List<Road_Nodes> nodeslist)
        {
            Inv_Information inv = new Inv_Information();
            inv.IInfor_ProdCode = planProd.PlanProd_Code;
            inv.IInfor_PartNo = planProd.PlanProd_PartNo;
            inv.IInfor_PartName = planProd.PlanProd_PartName;
            inv.IInfor_PlanBegin = planProd.PlanProd_Begin;
            inv.IInfor_PlanEnd = planProd.PlanProd_End;
            //计划编码
            inv.IInfor_PlanCode = planProd.PlanProd_PlanCode;
            //指令编码
            inv.IInfor_CmdCode = planProd.PlanProd_CmdCode;
            inv.IInfor_ProdStat = OperationTypeEnum.ProdStatEnum.Normal.ToString();
            //任务编码
            inv.IInfor_TaskCode = planProd.PlanProd_TaskCode;

            inv.IInfor_Num = 1;
            inv.CreateTime = DateTime.Now;

            if (nodeslist != null && nodeslist.Count > 0)
            {
                //var temp = nodeslist.OrderBy(o => o.RNodes_Order);
                inv.IInfor_Stat = nodeslist[0].RNodes_Code;
            }
            //实际完成时间  库存状态  编制人等信息之后实时更新

            //仅添加一条虚拟库存记录,不做出入库操作
            Instance.Add(inv);

            return inv.IInfor_ProdCode;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 更新库存信息(更新库存信息表,添加库存移动信息表(出库)
        /// </summary>
        /// <param name="iInfo"></param>
        /// <returns></returns>
        public int UpdateInvInfo(Inv_Information iInfo)
        {
            iInfo.IInfor_Num = iInfo.IInfor_Num == 0 ? 0 : iInfo.IInfor_Num - 1;

            iInfo.IInfor_Stat = QX.Common.C_Class.OperationTypeEnum.InvStatEnum.Outing.ToString();

            //两个表(移动 和 信息表)信息的更新
            Inv_Movement mv = new Inv_Movement();

            mv.MV_Code = GenerateMovCode();
            mv.MV_PartNo = iInfo.IInfor_PartNo;
            mv.MV_PartName = iInfo.IInfor_PartName;
            mv.MV_ProdCode = iInfo.IInfor_ProdCode;
            mv.MV_Owner = iInfo.IInfor_OutPep;
            mv.MV_Date = iInfo.IInfor_OutDate;
            mv.MV_Type = OperationTypeEnum.InvStatEnum.Outing.ToString();
            //增加一条产品移动信息
            int re1 = mvInstance.Add(mv);
            //更新库存信息表记录
            int re2 = Instance.Update(iInfo);

            if (re1 > 0 && re2 > 0)
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 添加库存信息
 /// </summary>
 /// <param name="iInfo"></param>
 /// <returns></returns>
 public int AddInv(Inv_Information iInfo)
 {
     return Instance.Add(iInfo);
 }
Ejemplo n.º 4
0
        public bool Update(Inv_Information inv)
        {
            if (Instance.Update(inv) > 0)
            {
                return true;
            }
            else
            {
                return false;

            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 入库操作
        /// </summary>
        /// <param name="iInfo"></param>
        /// <returns></returns>
        public int InventoryInvInfo(Inv_Information iInfo)
        {
            iInfo.IInfor_Num = 1;
            iInfo.IInfor_Stat = QX.Common.C_Class.OperationTypeEnum.InvStatEnum.Prod.ToString();
            //入库时间--》编制时间
            iInfo.IInfor_InDate = DateTime.Now;
            //用户编码
            //iInfo.IInfor_InConfirm = SessionConfig.UserCode;
            //iInfo.IInfor_InDate = DateTime.Now;

            //两个表(移动 和 信息表)信息的更新
            Inv_Movement mv = new Inv_Movement();
            mv.MV_Code = GenerateMovCode();
            mv.MV_PartNo = iInfo.IInfor_PartNo;
            mv.MV_PartName = iInfo.IInfor_PartName;
            mv.MV_ProdCode = iInfo.IInfor_ProdCode;
            mv.MV_Owner = iInfo.IInfor_InPep;
            mv.MV_Date = iInfo.IInfor_InDate;

            mv.CreateTime = DateTime.Now;
            mv.UpdateTime = DateTime.Now;
            mv.MV_Type = OperationTypeEnum.InvStatEnum.Prod.ToString();
            //增加一条产品移动信息
            int re1 = mvInstance.Add(mv);
            //更新库存信息表记录
            int re2 = Instance.Update(iInfo);

            if (re1 > 0 && re2 > 0)
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }
Ejemplo n.º 6
0
 public Inv_Information GetInvByProdCode(string cmd,string pcode)
 {
     string strCondition = string.Format(" AND IInfor_ProdCode='{0}' AND IInfor_CmdCode='{1}'", pcode, cmd);
     List<Inv_Information> list = Instance.GetListByWhere(strCondition);
     Inv_Information model = new Inv_Information();
     if (list != null && list.Count > 0)
     {
         model = list[0];
     }
     else
     {
         model = null;
     }
     return model;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 根据零件编号获取对应库存信息(零件编号在库存表中唯一)
 /// </summary>
 /// <param name="prodCode"></param>
 /// <returns></returns>
 public Inv_Information GetInvByProdCode(Prod_Roads pr)
 {
     string strCondition = string.Format(" AND IInfor_PlanCode='{0}'", pr.PRoad_PlanCode);
     List<Inv_Information> list = Instance.GetListByWhere(strCondition);
     Inv_Information model = new Inv_Information();
     if (list != null && list.Count > 0)
     {
         model = list[0];
     }
     else
     {
         model = null;
     }
     return model;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 逻辑删除库存信息
 /// </summary>
 /// <param name="iInfo"></param>
 /// <returns></returns>
 public int DeleteInvInfo(Inv_Information iInfo)
 {
     iInfo.Stat = 1;
     return Instance.Update(iInfo);
 }