protected override TViewDetailViewModel InitViewModelByDefault(TViewDetailViewModel simpleViewModel) { simpleViewModel = base.InitViewModelByDefault(simpleViewModel); if (((IWarehouseTransferPrimitiveDTO)simpleViewModel).ShiftID == 0) { string shiftSession = ShiftSession.GetShift(this.HttpContext); if (HomeSession.TryParseID(shiftSession) > 0) { ((IWarehouseTransferPrimitiveDTO)simpleViewModel).ShiftID = (int)HomeSession.TryParseID(shiftSession); } } if (simpleViewModel.Storekeeper == null) { string storekeeperSession = WarehouseTransferSession.GetStorekeeper(this.HttpContext); if (HomeSession.TryParseID(storekeeperSession) > 0) { simpleViewModel.Storekeeper = new TotalDTO.Commons.EmployeeBaseDTO(); simpleViewModel.Storekeeper.EmployeeID = (int)HomeSession.TryParseID(storekeeperSession); simpleViewModel.Storekeeper.Name = HomeSession.TryParseName(storekeeperSession); } } return(simpleViewModel); }
protected override FinishedProductViewModel InitViewModelByDefault(FinishedProductViewModel simpleViewModel) { simpleViewModel = base.InitViewModelByDefault(simpleViewModel); if (simpleViewModel.ShiftID == 0) { string shiftSession = ShiftSession.GetShift(this.HttpContext); if (HomeSession.TryParseID(shiftSession) > 0) { simpleViewModel.ShiftID = (int)HomeSession.TryParseID(shiftSession); } } if (simpleViewModel.CrucialWorker == null) { string storekeeperSession = FinishedProductSession.GetCrucialWorker(this.HttpContext); if (HomeSession.TryParseID(storekeeperSession) > 0) { simpleViewModel.CrucialWorker = new TotalDTO.Commons.EmployeeBaseDTO(); simpleViewModel.CrucialWorker.EmployeeID = (int)HomeSession.TryParseID(storekeeperSession); simpleViewModel.CrucialWorker.Name = HomeSession.TryParseName(storekeeperSession); } } return(simpleViewModel); }
protected override SemifinishedProductViewModel InitViewModelByDefault(SemifinishedProductViewModel simpleViewModel) { simpleViewModel = base.InitViewModelByDefault(simpleViewModel); if (simpleViewModel.ShiftID == 0) { string shiftSession = ShiftSession.GetShift(this.HttpContext); if (HomeSession.TryParseID(shiftSession) > 0) { simpleViewModel.ShiftID = (int)HomeSession.TryParseID(shiftSession); } } return(simpleViewModel); }