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 void BackupViewModelToSession(MaterialIssueViewModel simpleViewModel)
 {
     base.BackupViewModelToSession(simpleViewModel);
     ShiftSession.SetShift(this.HttpContext, simpleViewModel.ShiftID);
     MaterialIssueSession.SetStorekeeper(this.HttpContext, simpleViewModel.Storekeeper.EmployeeID, simpleViewModel.Storekeeper.Name);
     MaterialIssueSession.SetCrucialWorker(this.HttpContext, simpleViewModel.CrucialWorker.EmployeeID, simpleViewModel.CrucialWorker.Name);
 }
        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 void BackupViewModelToSession(TViewDetailViewModel simpleViewModel)
 {
     base.BackupViewModelToSession(simpleViewModel);
     ShiftSession.SetShift(this.HttpContext, ((IGoodsReceiptPrimitiveDTO)simpleViewModel).ShiftID);
     if (simpleViewModel.Storekeeper != null)
     {
         GoodsReceiptSession.SetStorekeeper(this.HttpContext, simpleViewModel.Storekeeper.EmployeeID, simpleViewModel.Storekeeper.Name);
     }
 }
        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);
        }
 protected override void BackupViewModelToSession(SemifinishedProductViewModel simpleViewModel)
 {
     base.BackupViewModelToSession(simpleViewModel);
     ShiftSession.SetShift(this.HttpContext, simpleViewModel.ShiftID);
 }
 protected override void BackupViewModelToSession(TViewDetailViewModel simpleViewModel)
 {
     base.BackupViewModelToSession(simpleViewModel);
     ShiftSession.SetShift(this.HttpContext, ((IWarehouseTransferPrimitiveDTO)simpleViewModel).ShiftID);
     WarehouseTransferSession.SetStorekeeper(this.HttpContext, simpleViewModel.Storekeeper.EmployeeID, simpleViewModel.Storekeeper.Name);
 }
 protected override void BackupViewModelToSession(FinishedProductViewModel simpleViewModel)
 {
     base.BackupViewModelToSession(simpleViewModel);
     ShiftSession.SetShift(this.HttpContext, simpleViewModel.ShiftID);
     FinishedProductSession.SetCrucialWorker(this.HttpContext, simpleViewModel.CrucialWorker.EmployeeID, simpleViewModel.CrucialWorker.Name);
 }