示例#1
0
 public MoveExceller(MoveStatement ms, ViewController vc, string worker, string sender, string receiver)
 {
     _ms       = ms;
     _vc       = vc;
     _worker   = worker;
     _sender   = sender;
     _receiver = receiver;
 }
示例#2
0
 public string sender(MoveStatement ms)
 {
     if (ms.SenderSubdivisionID == null)
     {
         return(null);
     }
     else
     {
         return(Model.Subdivision.First(x => x.IDSubdivision == ms.SenderSubdivisionID).Name);
     }
 }
示例#3
0
        public void moveItem(List <InventoryItem> il, int sender, int receiver)
        {
            MoveStatement        ms       = new MoveStatement();
            int                  workerid = model.Worker.FirstOrDefault(x => x.SubdivisionID == sender).TableNum;
            List <MoveStatement> msl      = model.MoveStatement.ToList();

            ms.IDStatement           = msl.Last().IDStatement + 1;
            ms.SenderSubdivisionID   = sender;
            ms.ReceiverSubdivisionID = receiver;
            ms.WorkerTableNum        = workerid;
            ms.StatementDate         = DateTime.Today;
            model.MoveStatement.Add(ms);
            model.SaveChanges();
            foreach (InventoryItem ii in il)
            {
                StatementContext sc = new StatementContext();
                sc.InventoryIDInventory     = ii.IDInventory;
                sc.MoveStatementIDStatement = ms.IDStatement;
                model.StatementContext.Add(sc);
                model.SaveChanges();
            }
        }
示例#4
0
        public void AddItem(Inventory ii, int id)
        {
            int workerid             = model.Worker.FirstOrDefault(x => x.SubdivisionID == id).TableNum;
            List <Inventory> invlist = model.Inventory.ToList();

            ii.IDInventory = invlist.Last().IDInventory + 1;
            model.Inventory.Add(ii);
            MoveStatement    ms = new MoveStatement();
            StatementContext sc = new StatementContext();

            sc.InventoryIDInventory = ii.IDInventory;
            List <MoveStatement> msl = model.MoveStatement.ToList();

            ms.IDStatement           = msl.Last().IDStatement + 1;
            ms.SenderSubdivisionID   = null;
            ms.ReceiverSubdivisionID = id;
            ms.WorkerTableNum        = workerid;
            ms.StatementDate         = DateTime.Today;
            model.MoveStatement.Add(ms);
            sc.MoveStatementIDStatement = ms.IDStatement;
            model.StatementContext.Add(sc);
            model.SaveChanges();
        }
示例#5
0
        public List <StatementContext> FullStatement(MoveStatement ms)
        {
            List <StatementContext> list = Model.StatementContext.Where(x => x.MoveStatementIDStatement == ms.IDStatement).ToList();

            return(list);
        }
示例#6
0
 public string receiver(MoveStatement ms)
 {
     return(Model.Subdivision.First(x => x.IDSubdivision == ms.ReceiverSubdivisionID).Name);
 }