Ejemplo n.º 1
0
 private void LoadOrdersData()
 {
     ordersService             = Program.kernel.Get <IOrdersService>();
     contractorsService        = Program.kernel.Get <IContractorsService>();
     receiptsService           = Program.kernel.Get <IReceiptsService>();
     receiptAcceptancesService = Program.kernel.Get <IReceiptAcceptancesService>();
 }
Ejemplo n.º 2
0
 public PackagesController(ApplicationDbContext db, IUsersService usersService, IPackageService packageService, IReceiptsService receiptsService)
 {
     this.db              = db;
     this.usersService    = usersService;
     this.packageService  = packageService;
     this.receiptsService = receiptsService;
 }
        private void LoadReceiptsData(int statusValue)
        {
            receiptsService = Program.kernel.Get <IReceiptsService>();

            switch (statusValue)
            {
            case 0:
                receiptsList = receiptsService.GetReceiptsForAcceptance().Where(r => r.StatusId == 5).ToList();
                break;

            case 1:
                receiptsList = receiptsService.GetReceiptsForAcceptance().Where(r => r.StatusId == 6).ToList();
                break;

            case 2:
                receiptsList = receiptsService.GetReceiptsForAcceptance().ToList();
                break;

            default:
                break;
            }

            receiptsBS.DataSource   = receiptsList;
            receiptsGrid.DataSource = receiptsBS;
        }
Ejemplo n.º 4
0
 public ReceiptsController(IReceiptsService receiptsService,
                           IPackagesService packagesService, IAddressesService addressesService, ILogger <ReceiptsController> logger)
 {
     this._receiptsService  = receiptsService;
     this._packagesService  = packagesService;
     this._addressesService = addressesService;
     this._logger           = logger;
 }
Ejemplo n.º 5
0
 public ReceiptsController(
     IReceiptsService receiptsService,
     ICloudinaryService cloudinaryService)
     : base(receiptsService, cloudinaryService)
 {
     this.receiptsService   = receiptsService;
     this.cloudinaryService = cloudinaryService;
 }
 public PackagesController(UserManager <ApplicationUser> userManager,
                           IPackageService packageService,
                           IReceiptsService receiptsService)
 {
     this.userManager     = userManager;
     this.packageService  = packageService;
     this.receiptsService = receiptsService;
 }
Ejemplo n.º 7
0
 public OrdersController(
     IOrdersService ordersService,
     IReceiptsService receiptsService,
     ICloudinaryService cloudinaryService)
 {
     this.ordersService     = ordersService;
     this.receiptsService   = receiptsService;
     this.cloudinaryService = cloudinaryService;
 }
Ejemplo n.º 8
0
 public OrdersController(
     ICartsService cartsService,
     IUsersService usersService,
     IOrdersService ordersService,
     IReceiptsService receiptsService)
 {
     this.cartsService    = cartsService;
     this.usersService    = usersService;
     this.ordersService   = ordersService;
     this.receiptsService = receiptsService;
 }
Ejemplo n.º 9
0
        private void LoadKeepingData(int storeEntry)
        {
            receiptsService     = Program.kernel.Get <IReceiptsService>();
            wareHousesService   = Program.kernel.Get <IWareHousesService>();
            materialsService    = Program.kernel.Get <IMaterialsService>();
            keepingsService     = Program.kernel.Get <IKeepingsService>();
            expendituresService = Program.kernel.Get <IExpendituresService>();

            keepingMaterials            = keepingsService.GetExpendituresFromKeeping().Where(s => s.StoreNameId == storeEntry || s.StoreNameId == 0).ToList();
            keepingBS.DataSource        = keepingMaterials;
            expendituresGrid.DataSource = keepingBS;
        }
Ejemplo n.º 10
0
        private void LoadData()
        {
            receiptsService = Program.kernel.Get <IReceiptsService>();
            DateTime beginDate = (DateTime)beginDateEdit.EditValue;
            DateTime endDate   = (DateTime)endDateEdit.EditValue;;

            receiptsJournal = receiptsService.GetReceiptsForJournal(beginDate, endDate).GroupBy(x => new { x.MaterialId, x.UnitId }).Select(x => new ReceiptsJournal
            {
                Article       = x.First().Article,
                Name          = x.First().Name,
                Quantity      = x.Sum(y => y.Quantity),
                UnitLocalName = x.First().UnitLocalName
            }).ToList();
            receiptsBS.DataSource = receiptsJournal;
            this.receiptsJournalGrid.DataSource = receiptsBS;
        }
Ejemplo n.º 11
0
        private void saveBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (receiptsList.Any(r => r.Checked))
            {
                if (MessageBox.Show("Сохранить изменения?", "Сохранение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    int curOrderId = 0;

                    ordersService             = Program.kernel.Get <IOrdersService>();
                    receiptsService           = Program.kernel.Get <IReceiptsService>();
                    receiptAcceptancesService = Program.kernel.Get <IReceiptAcceptancesService>();

                    foreach (var checkReceipt in receiptsList.Where(r => r.Checked))
                    {
                        if (curOrderId != checkReceipt.OrderId)
                        {
                            curOrderId = checkReceipt.OrderId;
                            var orderItem = ordersService.GetOrderById(curOrderId);
                            orderItem.StatusId = 2;
                            ordersService.OrderUpdate(orderItem);
                        }

                        var receiptItem = receiptsService.GetReceiptById(checkReceipt.ReceiptId);
                        receiptItem.StatusId = 6;
                        receiptsService.ReceiptUpdate(receiptItem);

                        var curReceiptAcceptancesList = receiptAcceptancesService.GetReceiptAcceptanceByReceiptId(checkReceipt.ReceiptId).Select(ra => { ra.StatusId = 6; return(ra); }).ToList();
                        receiptAcceptancesService.UpdateRange(curReceiptAcceptancesList);
                    }

                    receiptsGridView.BeginDataUpdate();
                    LoadReceiptsData((int)statusItem.EditValue);
                    receiptsGridView.EndDataUpdate();

                    if (receiptsBS.Count > 0)
                    {
                        receiptsGridView.FocusedRowHandle = 0;
                        receiptsGridView.ExpandAllGroups();
                    }
                }
            }
            else
            {
                MessageBox.Show("Не выбраны данные для принятия!", "Принятие прихода", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 12
0
        private void cancelAcceptanceBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            receiptAcceptancesService = Program.kernel.Get <IReceiptAcceptancesService>();
            receiptsService           = Program.kernel.Get <IReceiptsService>();
            ordersService             = Program.kernel.Get <IOrdersService>();

            if (receiptsBS.List.Count == 0)
            {
                return;
            }

            var currentReceipt = (ReceiptsForAcceptanceDTO)receiptsBS.Current;

            if ((currentReceipt.StatusId == 6) && (!receiptAcceptancesList.Any(ra => ra.StatusId > 6))) // отменить прием можно если статус Принят и нет не одной записи в receiptAcceptances со статусом Выше (хранение, частично обработан или отгружен)
            {
                if (MessageBox.Show("Отменить прием выбранной номенклатуры?", "Сохранение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    if (receiptsService.GetReceiptsForAcceptance().Any(m => m.OrderId == currentReceipt.OrderId && m.StatusId == 6 && m.ReceiptId != currentReceipt.ReceiptId))
                    {
                        var orderItem = ordersService.GetOrderById(currentReceipt.OrderId);
                        orderItem.StatusId = 1;
                        ordersService.OrderUpdate(orderItem);
                    }

                    var receiptItem = receiptsService.GetReceiptById(currentReceipt.ReceiptId);
                    receiptItem.StatusId = 5;
                    receiptsService.ReceiptUpdate(receiptItem);

                    receiptAcceptancesService.UpdateRange(receiptAcceptancesList.Select(ra => { ra.StatusId = 5; return(ra); }).ToList());

                    receiptsGridView.BeginDataUpdate();

                    LoadReceiptsData((int)statusItem.EditValue);

                    receiptsGridView.EndDataUpdate();

                    int handle = receiptsGridView.LocateByValue("ReceiptId", currentReceipt.ReceiptId);
                    receiptsGridView.FocusedRowHandle = handle;
                }
            }
            else
            {
                MessageBox.Show("Нельзя отменить принятие, поскольку один или несколько комплектов находятся на хранении.", "Отменить принятие прихода", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 13
0
 public ReceiptsController(IReceiptsService receiptsService, IPackagesService packagesService, IUsersService usersService)
 {
     _receiptsService = receiptsService;
     _packagesService = packagesService;
     _usersService    = usersService;
 }
Ejemplo n.º 14
0
 public PackagesController(IPackageService packageService, IUsersService usersService, IReceiptsService receiptsService)
 {
     this.packageService  = packageService;
     this.usersService    = usersService;
     this.receiptsService = receiptsService;
 }
Ejemplo n.º 15
0
 public PackagesService(PandaDbContext context, IReceiptsService receiptsService) : base(context)
 {
     this.receiptsService = receiptsService;
 }
Ejemplo n.º 16
0
 public PackagesService(ScaleDeliDbContext db, IReceiptsService receiptsService)
 {
     this.db = db;
     this.receiptsService = receiptsService;
 }
Ejemplo n.º 17
0
 public UsersController(IUsersService usersService, ILogger logger, IReceiptsService receiptsService)
 {
     this.receiptsService = receiptsService;
     this.usersService    = usersService;
     this.logger          = logger;
 }
Ejemplo n.º 18
0
 public PackageService(ApplicationDbContext db, IReceiptsService receiptsService)
 {
     this.db = db;
     this.receiptsService = receiptsService;
 }
 public ReceiptsController(IMapper mapper, IReceiptsService receiptsService)
 {
     this.mapper          = mapper;
     this.receiptsService = receiptsService;
 }
 public PackagesService(PandaDbContext context, IReceiptsService receiptsService, IUsersService usersService)
 {
     this.context         = context;
     this.receiptsService = receiptsService;
     this.usersService    = usersService;
 }
 public UsersController(IUsersService userService, IReceiptsService receiptsService)
 {
     this.userService     = userService;
     this.receiptsService = receiptsService;
 }
Ejemplo n.º 22
0
        private bool TakeKeeping(KeepingMaterialsDTO model)
        {
            receiptsService           = Program.kernel.Get <IReceiptsService>();
            receiptAcceptancesService = Program.kernel.Get <IReceiptAcceptancesService>();
            ordersService             = Program.kernel.Get <IOrdersService>();
            keepingsService           = Program.kernel.Get <IKeepingsService>();
            expendituresService       = Program.kernel.Get <IExpendituresService>();

            int wareHouseId = model.WareHouseId;

            if (wareHouseId > 0)
            {
                firstWindDefaultCell = wareHouseId;

                if ((int)barEditItem1.EditValue == 0)
                {
                    if (cellPresenceList == null)
                    {
                        cellPresenceList = wareHousesService.GetCellPresence(wareHouseId).ToList();
                    }

                    keepingsFirtWndBS.DataSource     = cellPresenceList;
                    keepingsFirstWindGrid.DataSource = keepingsFirtWndBS;

                    WareHousesDTO cellInfo = wareHousesService.GetCellInfo(wareHouseId);
                    numberCellFirstLbl.Text         = cellInfo.NumberCell.ToString();
                    cellCompletedFirstChk.EditValue = (cellInfo.LoadingStatusId == 3 ? true : false);

                    bool canEdit = true;

                    ConfirmQuantityDTO kdto = new ConfirmQuantityDTO
                    {
                        Quantity     = (decimal)model.QuantityStore,
                        Article      = model.Article,
                        MaterialName = model.MaterialName,
                        KeepingId    = model.KeepingId
                    };

                    //using (ConfirmQuantityFm confirmQuantityFm = new ConfirmQuantityFm(kdto, canEdit))
                    //{
                    //    if (confirmQuantityFm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    //    {
                    //        kdto = confirmQuantityFm.Return();

                    //        keepingsFirstWindGridView.BeginDataUpdate();
                    //        cellPresenceList.Where(c => c.KeepingId == (int)kdto.KeepingId).Select(c => { c.QuantityStore = (c.QuantityStore - kdto.Quantity); c.QuantityChanged = c.QuantityChanged + kdto.Quantity; return c; }).ToList();
                    //        keepingsFirstWindGridView.EndDataUpdate();

                    //        expendituresGridView.BeginDataUpdate();
                    //        keepingMaterials.Where(c => c.KeepingId == (int)kdto.KeepingId).Select(k => { k.QuantityStore = (k.QuantityStore - kdto.Quantity); return k; }).ToList();
                    //        expendituresGridView.EndDataUpdate();

                    //        int rowHandle = keepingsFirstWindGridView.LocateByValue("KeepingId", model.KeepingId);
                    //        keepingsFirstWindGridView.FocusedRowHandle = rowHandle;
                    //    }
                    //}
                }

                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 23
0
 public ReceiptsController(IReceiptsService receiptsService, IOrdersService ordersService, IUsersService usersService)
 {
     this.receiptsService = receiptsService;
     this.ordersService   = ordersService;
     this.usersService    = usersService;
 }
Ejemplo n.º 24
0
 public void LoadOrdersData()
 {
     receiptsService = Program.kernel.Get <IReceiptsService>();
     ordersService   = Program.kernel.Get <IOrdersService>();
 }
Ejemplo n.º 25
0
 public PackagesService(PandaDbContext db, IReceiptsService receiptsService)
 {
     this.db = db;
     this.receiptsService = receiptsService;
 }
 public ReceiptsController(IReceiptsService receiptsService, IPackagesService packagesService)
 {
     this.receiptsService = receiptsService;
     this.packagesService = packagesService;
 }
 public PackageService(PandaDbContext context, IReceiptsService receiptService)
 {
     this.context        = context;
     this.receiptService = receiptService;
 }
Ejemplo n.º 28
0
 public ReceiptsController(IReceiptsService receiptsService, UserManager <PandaUser> userManager)
 {
     _receiptsService = receiptsService;
     _userManager     = userManager;
 }
Ejemplo n.º 29
0
 public ReceiptsController(IReceiptsService receiptsService)
 {
     this.receiptsService = receiptsService;
 }
Ejemplo n.º 30
0
 public OrdersController(IOrdersService ordersService, IReceiptsService receiptsService)
 {
     this.ordersService   = ordersService;
     this.receiptsService = receiptsService;
 }