示例#1
0
        protected override void LoadData()
        {
            ISalesOrderService svcSalesOrder = DI.Resolve <ISalesOrderService>();
            ErrorList          errorList     = new ErrorList();

            try
            {
                SalesOrder_ReadOutput outRead;
                using (TimeTracker.ServiceCall)
                    outRead = svcSalesOrder.Read((int)obj.SalesOrderIdProperty.TransportValue);
                obj.FromDataContract(outRead);
            }
            catch (Exception ex)
            {
                errorList.MergeWith(ErrorList.FromException(ex));
            }
            try
            {
                IEnumerable <SalesOrderDetail_ReadListOutput> outDetail_ReadList;
                using (TimeTracker.ServiceCall)
                    outDetail_ReadList = svcSalesOrder.Detail_ReadList((int)obj.SalesOrderIdProperty.TransportValue);
                obj.DetailList.FromDataContract(outDetail_ReadList);
            }
            catch (Exception ex)
            {
                errorList.MergeWith(ErrorList.FromException(ex));
            }
            if (svcSalesOrder is IDisposable)
            {
                ((IDisposable)svcSalesOrder).Dispose();
            }
            errors.List.DataSource = errorList.Errors;
            errors.List.DataBind();
            Page.DataBind();
        }
示例#2
0
 public bool ValidDeleteObject(Contact contact, ICoreIdentificationService _coreIdentificationService, IBarringService _barringService,
                               IPurchaseOrderService _purchaseOrderService, ISalesOrderService _salesOrderService)
 {
     contact.Errors.Clear();
     VDeleteObject(contact, _coreIdentificationService, _barringService, _purchaseOrderService, _salesOrderService);
     return(isValid(contact));
 }
 public SalesController()
 {
     var dbfactory = new DatabaseFactory();
     var unitOfWork = new UnitOfWork(dbfactory);
     _salesOrderService = new SalesOrderService(new SalesOrderRepository(dbfactory),
         new SalesOrderDetailRepository(dbfactory),
         new SalesOrderApprovalRepository(dbfactory),
         new NotificationRepository(dbfactory),
         new NotificationDetailRepository(dbfactory),
         unitOfWork);
     _approvalController = new ApprovalController<SlsSalesOrderApproval, SlsSalesOrderViewModel>(_salesOrderService);
     _deliveryService = new DeliveryService(new DeliveryRepository(dbfactory), new DeliveryDetailRepository(dbfactory), unitOfWork);
     _SecCompanyService = new SecCompanyService(new SecCompanyRepository(dbfactory), unitOfWork);
     _hrmEmployeeService = new HrmEmployeeService(new HrmEmployeeRepository(dbfactory), unitOfWork);
     _officeService = new OfficeService(new OfficeRepository(dbfactory), unitOfWork);
     _DistributorService = new DistributorService(new DistributorRepository(dbfactory), unitOfWork);
     _DealerService = new DealerService(new DealerRepository(dbfactory), unitOfWork);
     _CorporateClientService = new CorporateClientService(new CorporateClientRepository(dbfactory), unitOfWork);
     _RetailerService = new RetailerService(new RetailerRepository(dbfactory), unitOfWork);
     _FreeProductService = new FreeProductService(new FreeProductRepository(dbfactory), new ChartOfProductRepository(dbfactory),
         new UnitOfMeasurementRepository(dbfactory), unitOfWork);
     _ProductService = new ChartOfProductService(new ChartOfProductRepository(dbfactory), unitOfWork);
     _UnitService = new UnitOfMeasurementService(new UnitOfMeasurementRepository(dbfactory), unitOfWork);
     _salesDiscountSettingService = new SalesDiscountSettingService(new SalesDiscountSettingRepository(dbfactory), unitOfWork);
     _PartyCreditService = new PartyCreditReportService(new InvStoreOpeningRepository(dbfactory), unitOfWork);
     _promotionalOfferService = new PromotionalOfferService(new PromotionalOfferRepository(dbfactory),
         new PromotionalOfferDetailRepository(dbfactory),
         new UnitOfWork(dbfactory));
 }
示例#4
0
 public SalesOrderProcessor(IStorageQueueHelper serviceBusHelper,
                            IProductService productService,
                            ISalesOrderService salesOrderService)
 {
     _serviceBusHelper  = serviceBusHelper;
     _productService    = productService;
     _salesOrderService = salesOrderService;
 }
 public MstContactController()
 {
     _contactService            = new ContactService(new ContactRepository(), new ContactValidator());
     _coreIdentificationService = new CoreIdentificationService(new CoreIdentificationRepository(), new CoreIdentificationValidator());
     _barringService            = new BarringService(new BarringRepository(), new BarringValidator());
     _purchaseOrderService      = new PurchaseOrderService(new PurchaseOrderRepository(), new PurchaseOrderValidator());
     _salesOrderService         = new SalesOrderService(new SalesOrderRepository(), new SalesOrderValidator());
 }
 public SalesOrdersController(IProductServices productServices, ISalesOrderService salesOrderService, ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices,
                              IAppointmentsService appointmentsService, IGaneConfigurationsHelper configurationsHelper, IEmailServices emailServices, ITenantLocationServices tenantLocationservices, ITenantsServices tenantsServices)
     : base(orderService, propertyService, accountServices, lookupServices, appointmentsService, configurationsHelper, emailServices, tenantLocationservices, tenantsServices)
 {
     _salesServices   = orderService;
     _accountServices = accountServices;
     _productServices = productServices;
 }
示例#7
0
 public EditModel(ISalesOrderService salesOrderService,
                  IGenericServiceFactory genericServiceFactory,
                  ISalesOrderDetailService salesOrderDetailService)
 {
     _salesOrderService       = salesOrderService;
     _genericServices         = genericServiceFactory;
     _salesOrderDetailService = salesOrderDetailService;
 }
 public CoreOrderService(IOrderService orderService, IPurchaseOrderService purchaseOrderService, IWorksOrderService worksOrderService, ITransferOrderService transferOrderService, ISalesOrderService salesOrderService)
 {
     TransferOrderService = transferOrderService;
     OrderService         = orderService;
     PurchaseOrderService = purchaseOrderService;
     WorksOrderService    = worksOrderService;
     SalesOrderService    = salesOrderService;
 }
示例#9
0
        public SalesOrderViewModel(int salesOrderId,
                                   IWorkspaceManager workspaceManager,
                                   ISalesOrderService service)
        {
            WorkspaceManager = workspaceManager;
            _service         = service;

            Initialize(salesOrderId);
        }
 public InvoiceController(IInvoiceService invoiceService, IGroupService groupService, IUserService userService, IAccountService accountService , IContactService contactService, ISalesOrderService salesOrderService)
 {
     this.invoiceService = invoiceService;
     this.groupService = groupService;
     this.userService = userService;
     this.contactService = contactService;
     this.accountService = accountService;
     this.salesOrderService = salesOrderService;
 }
示例#11
0
 public SalesOrderDetail CreateObject(SalesOrderDetail salesOrderDetail, ISalesOrderService _salesOrderService, IItemService _itemService)
 {
     salesOrderDetail.Errors = new Dictionary <String, String>();
     if (_validator.ValidCreateObject(salesOrderDetail, this, _salesOrderService, _itemService))
     {
         _repository.CreateObject(salesOrderDetail);
     }
     return(salesOrderDetail);
 }
 public InvoiceController(IProductServices productServices, ISalesOrderService salesOrderService, ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices,
                          IAppointmentsService appointmentsService, IGaneConfigurationsHelper configurationsHelper, IEmailServices emailServices, ITenantLocationServices tenantLocationservices, ITenantsServices tenantsServices, IProductPriceService priceService, IGaneConfigurationsHelper helper, IInvoiceService invoiceService)
     : base(orderService, propertyService, accountServices, lookupServices, appointmentsService, configurationsHelper, emailServices, tenantLocationservices, tenantsServices)
 {
     _priceService    = priceService;
     _helper          = helper;
     _productServices = productServices;
     _invoiceService  = invoiceService;
 }
示例#13
0
        public Contact VHasSalesOrder(Contact contact, ISalesOrderService _salesOrderService)
        {
            IList <SalesOrder> salesOrders = _salesOrderService.GetObjectsByContactId(contact.Id);

            if (salesOrders.Any())
            {
                contact.Errors.Add("Generic", "Contact masih memiliki asosiasi dengan sales order");
            }
            return(contact);
        }
 public SalesOrderController(ISalesOrderService salesOrderService, IUserService userService,IGroupService groupService,IAccountService accountService,IContactService contactService, IPotentialService potentialService, IQuoteService quoteService)
 {
     this.salesOrderService = salesOrderService;
     this.potentialService = potentialService;
     this.quoteService = quoteService;
     this.contactService = contactService;
     this.accountService = accountService;
     this.groupService = groupService;
     this.userService = userService;
 }
示例#15
0
        public DeliveryOrder VHasSalesOrder(DeliveryOrder deliveryOrder, ISalesOrderService _salesOrderService)
        {
            SalesOrder salesOrder = _salesOrderService.GetObjectById(deliveryOrder.SalesOrderId);

            if (salesOrder == null)
            {
                deliveryOrder.Errors.Add("SalesOrderId", "Tidak terasosiasi dengan sales order");
            }
            return(deliveryOrder);
        }
示例#16
0
 public DeliveryOrder VUpdateObject(DeliveryOrder deliveryOrder, ISalesOrderService _salesOrderService, IWarehouseService _warehouseService)
 {
     VCreateObject(deliveryOrder, _salesOrderService, _warehouseService);
     if (!isValid(deliveryOrder))
     {
         return(deliveryOrder);
     }
     VHasNotBeenConfirmed(deliveryOrder);
     return(deliveryOrder);
 }
示例#17
0
        public SalesOrderDetail VHasSalesOrder(SalesOrderDetail salesOrderDetail, ISalesOrderService _salesOrderService)
        {
            SalesOrder so = _salesOrderService.GetObjectById(salesOrderDetail.SalesOrderId);

            if (so == null)
            {
                salesOrderDetail.Errors.Add("SalesOrderId", "Tidak terasosiasi dengan sales order");
            }
            return(salesOrderDetail);
        }
 public SalesOrderController()
 {
     var dbfactory = new DatabaseFactory();
     var unitOfWork = new UnitOfWork(dbfactory);
     _salesOrderService = new SalesOrderService(new SalesOrderRepository(dbfactory),
         new SalesOrderDetailRepository(dbfactory),
         new SalesOrderApprovalRepository(dbfactory),
         new NotificationRepository(dbfactory),
         new NotificationDetailRepository(dbfactory),
         unitOfWork);
 }
示例#19
0
 public SalesOrderController()
 {
     _itemService                = new ItemService(new ItemRepository(), new ItemValidator());
     _warehouseItemService       = new WarehouseItemService(new WarehouseItemRepository(), new WarehouseItemValidator());
     _stockMutationService       = new StockMutationService(new StockMutationRepository(), new StockMutationValidator());
     _barringService             = new BarringService(new BarringRepository(), new BarringValidator());
     _contactService             = new ContactService(new ContactRepository(), new ContactValidator());
     _salesOrderService          = new SalesOrderService(new SalesOrderRepository(), new SalesOrderValidator());
     _salesOrderDetailService    = new SalesOrderDetailService(new SalesOrderDetailRepository(), new SalesOrderDetailValidator());
     _deliveryOrderService       = new DeliveryOrderService(new DeliveryOrderRepository(), new DeliveryOrderValidator());
     _deliveryOrderDetailService = new DeliveryOrderDetailService(new DeliveryOrderDetailRepository(), new DeliveryOrderDetailValidator());
 }
 public SalesOrderController(IProductService productService,
                             ICustomerService customerService,
                             ISalesOrderService salesOrderService,
                             ISalesOrderDetailService salesOrderDetailService,
                             IChequeService chequeService
                             )
 {
     this.productService          = productService;
     this.customerService         = customerService;
     this.salesOrderService       = salesOrderService;
     this.salesOrderDetailService = salesOrderDetailService;
     this.chequeService           = chequeService;
 }
 public CommissionPaymentController()
 {
     var dbfactory = new DatabaseFactory();
     _salesOrderService = new SalesOrderService(new SalesOrderRepository(dbfactory),
         new SalesOrderDetailRepository(dbfactory),
         new SalesOrderApprovalRepository(dbfactory),
         new NotificationRepository(dbfactory),
         new NotificationDetailRepository(dbfactory),
         new UnitOfWork(dbfactory));
     _CommissionPackageService = new CommissionPackageService(new CommissionPackageRepository(dbfactory),
         new UnitOfWork(dbfactory));
     _CommissionService = new CommissionService(new CommissionRepository(dbfactory),
         new UnitOfWork(dbfactory));
 }
示例#22
0
 public PurchaseOrdersController(ITenantLocationServices tenantLocationServices, ICoreOrderService orderService, IStockTakeApiService stockTakeApiService, IPropertyService propertyService, IAccountServices accountServices,
                                 ILookupServices lookupServices, IAppointmentsService appointmentsService, IProductServices productServices, IProductLookupService productLookupService, IGaneConfigurationsHelper ganeConfigurationHelper,
                                 IEmailServices emailServices, ICommonDbServices commonDbServices, ITenantLocationServices tenantLocationservices, ISalesOrderService salesOrderService, ITenantsServices tenantsServices)
     : base(orderService, propertyService, accountServices, lookupServices, appointmentsService, ganeConfigurationHelper, emailServices, tenantLocationservices, tenantsServices)
 {
     StockTakeApiService     = stockTakeApiService;
     _productServices        = productServices;
     _productLookupService   = productLookupService;
     _orderService           = orderService;
     _tenantLocationServices = tenantLocationServices;
     _salesServices          = salesOrderService;
     _accountServices        = accountServices;
     _commonDbServices       = commonDbServices;
 }
示例#23
0
        protected virtual void btnSave_Click(object sender, EventArgs e)
        {
            obj.Validate(true);
            ErrorList valErr = obj.GetValidationErrors();

            errors.List.DataSource = valErr.Errors;
            errors.List.DataBind();
            if (valErr.HasErrors())
            {
                return;
            }

            ISalesOrderService svcSalesOrder = DI.Resolve <ISalesOrderService>();

            try
            {
                // for new objects create the object and store its key
                if (IsNew)
                {
                    SalesOrder_CreateInput inCreate = new SalesOrder_CreateInput();
                    obj.ToDataContract(inCreate);
                    SalesOrder_CreateOutput outCreate;
                    using (TimeTracker.ServiceCall)
                        outCreate = svcSalesOrder.Create(inCreate);
                    obj.FromDataContract(outCreate);
                    IsNew = false;
                }
                else
                {
                    SalesOrder_UpdateInput_Data inUpdate_Data = new SalesOrder_UpdateInput_Data();
                    obj.ToDataContract(inUpdate_Data);
                    using (TimeTracker.ServiceCall)
                        svcSalesOrder.Update((int)obj.SalesOrderIdProperty.TransportValue, inUpdate_Data);
                }
                obj.SetModified(false, true);
                OnSaved(EventArgs.Empty);
            }
            catch (Exception ex)
            {
                errors.List.DataSource = ErrorList.FromException(ex).Errors;
                errors.List.DataBind();
            }
            finally
            {
                if (svcSalesOrder is IDisposable)
                {
                    ((IDisposable)svcSalesOrder).Dispose();
                }
            }
        }
        public DeliveryOrderDetail CreateObject(int deliveryOrderId, int itemId, int quantity, int salesOrderDetailId,
                                                IDeliveryOrderService _deliveryOrderService, ISalesOrderDetailService _salesOrderDetailService,
                                                ISalesOrderService _salesOrderService, IItemService _itemService)
        {
            DeliveryOrderDetail deliveryOrderDetail = new DeliveryOrderDetail
            {
                DeliveryOrderId    = deliveryOrderId,
                ItemId             = itemId,
                Quantity           = quantity,
                SalesOrderDetailId = salesOrderDetailId
            };

            return(this.CreateObject(deliveryOrderDetail, _deliveryOrderService, _salesOrderDetailService, _salesOrderService, _itemService));
        }
 public SalesIncentiveSettingsController()
 {
     var dbfactory = new DatabaseFactory();
     _salesIncentiveService = new SalesIncentiveSettingsService(new SalesIncentiveSettingsRepository(dbfactory), new UnitOfWork(dbfactory));
     _salesOrderService = new SalesOrderService(new SalesOrderRepository(dbfactory),
         new SalesOrderDetailRepository(dbfactory),
         new SalesOrderApprovalRepository(dbfactory),
         new NotificationRepository(dbfactory),
         new NotificationDetailRepository(dbfactory),
         new UnitOfWork(dbfactory));
     _incentivePaymentService = new IncentivePaymentService(new IncentivePaymentRepository(dbfactory),
         new SalesIncentiveSettingsRepository(dbfactory) ,new UnitOfWork(dbfactory));
     _hrmDesignationService = new HrmDesignationService(new HrmDesignationRepository(dbfactory), new UnitOfWork(dbfactory));
     _hrmEmployeeService = new HrmEmployeeService(new HrmEmployeeRepository(dbfactory), new UnitOfWork(dbfactory));
     _SecCompanyService = new SecCompanyService(new SecCompanyRepository(dbfactory), new UnitOfWork(dbfactory));
 }
示例#26
0
 public SalesOrderDetail UnconfirmObject(SalesOrderDetail salesOrderDetail, ISalesOrderService _salesOrderService, IDeliveryOrderDetailService _deliveryOrderDetailService,
                                         IStockMutationService _stockMutationService, IItemService _itemService, IBarringService _barringService, IWarehouseItemService _warehouseItemService)
 {
     if (_validator.ValidUnconfirmObject(salesOrderDetail, _deliveryOrderDetailService, _itemService))
     {
         salesOrderDetail = _repository.UnconfirmObject(salesOrderDetail);
         Item item = _itemService.GetObjectById(salesOrderDetail.ItemId);
         IList <StockMutation> stockMutations = _stockMutationService.SoftDeleteStockMutationForSalesOrder(salesOrderDetail, item);
         foreach (var stockMutation in stockMutations)
         {
             _stockMutationService.ReverseStockMutateObject(stockMutation, _itemService, _barringService, _warehouseItemService);
             //item.PendingDelivery -= salesOrderDetail.Quantity;
         }
     }
     return(salesOrderDetail);
 }
        public DashboardController()
        {
            InitStyle();
            randomGen = new Random();

            var dbfactory = new DatabaseFactory();
            var newUoW = new UnitOfWork(dbfactory);

            _SalesTargetService = new SalesTargetService(new SalesTargetRepository(dbfactory), newUoW);
            _SalesOrderService = new SalesOrderService(new SalesOrderRepository(dbfactory), new SalesOrderDetailRepository(dbfactory),
                new SalesOrderApprovalRepository(dbfactory), new NotificationRepository(dbfactory),
                new NotificationDetailRepository(dbfactory), newUoW);
            _collectionTargetService = new CollectionTargetService(new CollectionTargetRepository(dbfactory), newUoW);
            _collectionEntryService = new CollectionEntryService(new CollectionEntryRepository(dbfactory), newUoW);
            _hrmEmployeeService = new HrmEmployeeService(new HrmEmployeeRepository(dbfactory), newUoW);
            _companyService = new SecCompanyService(new SecCompanyRepository(dbfactory), newUoW);
        }
 public CorporateSalesOrderController()
 {
     var dbfactory = new DatabaseFactory();
     var unitOfWork = new UnitOfWork(dbfactory);
     _salesOrderService = new SalesOrderService(new SalesOrderRepository(dbfactory),
         new SalesOrderDetailRepository(dbfactory),
         new SalesOrderApprovalRepository(dbfactory),
         new NotificationRepository(dbfactory),
         new NotificationDetailRepository(dbfactory),
         unitOfWork);
     _officeService = new OfficeService(new OfficeRepository(dbfactory), unitOfWork);
     _SecCompanyService = new SecCompanyService(new SecCompanyRepository(dbfactory), unitOfWork);
     _FreeProductService = new FreeProductService(new FreeProductRepository(dbfactory), new ChartOfProductRepository(dbfactory),
         new UnitOfMeasurementRepository(dbfactory), unitOfWork);
     _hrmEmployeeService = new HrmEmployeeService(new HrmEmployeeRepository(dbfactory), unitOfWork);
     _salesDiscountSettingService = new SalesDiscountSettingService(new SalesDiscountSettingRepository(dbfactory), unitOfWork);
     _PartyCreditService = new PartyCreditReportService(new InvStoreOpeningRepository(dbfactory), unitOfWork);
 }
 public CorporateSalesController()
 {
     var dbfactory = new DatabaseFactory();
     _service = new CorporateSalesService(new CorporateSalesRepository(dbfactory), new CorporateSalesDetailRepository(dbfactory),
         new CorporateSalesApprovalRepository(dbfactory), new NotificationRepository(dbfactory), new NotificationDetailRepository(dbfactory),
         new UnitOfWork(dbfactory));
     _approvalController = new ApprovalController<SlsCorporateSalesApproval, SlsCorporateSalesApplication>(_service);
     _SecCompanyService = new SecCompanyService(new SecCompanyRepository(dbfactory), new UnitOfWork(dbfactory));
     _officeService = new OfficeService(new OfficeRepository(dbfactory), new UnitOfWork(dbfactory));
     _hrmEmployeeService = new HrmEmployeeService(new HrmEmployeeRepository(dbfactory), new UnitOfWork(dbfactory));
     _CorporateClientService = new CorporateClientService(new CorporateClientRepository(dbfactory), new UnitOfWork(dbfactory));
     _salesOrderService = new SalesOrderService(new SalesOrderRepository(dbfactory),
         new SalesOrderDetailRepository(dbfactory),
         new SalesOrderApprovalRepository(dbfactory),
         new NotificationRepository(dbfactory),
         new NotificationDetailRepository(dbfactory),
         new UnitOfWork(dbfactory));
 }
示例#30
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="TransController" /> class.
 /// </summary>
 /// <param name="transService">The trans service.</param>
 public TransController(ITransService transService,
                        IEnumService enumService,
                        ISaleRMAService saleRmaService,
                        IRmaService rmaService,
                        IPaymentMethodRepository paymentMethodRepository,
                        ISalesOrderService saleOrderService,
                        IExpressService expressService,
                        IShippingSaleService shippingSaleService
                        )
 {
     _transService            = transService;
     _enumService             = enumService;
     _saleRmaService          = saleRmaService;
     _rmaService              = rmaService;
     _paymentMethodRepository = paymentMethodRepository;
     _saleOrderService        = saleOrderService;
     _expressService          = expressService;
     _shippingSaleService     = shippingSaleService;
 }
 public DashboardController(IUtilityService utilityservice, IUserCredentialService usercredentialservice, IModuleService iIModuleService, IPurchaseOrderDetailService IPurchaseOrderDetailService, IOutwardToShopService OutwardToShopService, IOutwardToClientService IOutwardToClientService, IShopStockService IShopStockService,
                            IGodownStockService GodownStockService, IStockItemDistributionService IStockItemDistributionService, IRetailBillService IRetailInvoiceMasterService, ISalesBillService ISalesBillService, IEmployeeMasterService EmployeeMasterService, IEntryStockItemService EntryStockItemService,
                            IQuotationService QuotationService, ISalesOrderService SalesOrderService, IDeliveryChallanService DeliveryChallanService, IInwardFromGodownService InwardFromGodownService, IInwardFromShopToGodownService InwardFromShopToGodownService, IInwardInterGodownService InwardInterGodownService, IInwardInterShopService InwardInterShopService,
                            IRequisitionForShopService RequisitionForShopService, IRequisitionForGodownService RequisitionForGodownService, IOutwardShopToGodownService OutwardShopToGodownService, IOutwardInterGodownService OutwardInterGodownService, IOutwardInterShopService OutwardInterShopService, ISalesReturnService SalesReturnService,
                            IPurchaseReturnService PurchaseReturnService, IInwardFromSupplierService InwardFromSupplierService, ICashierSalesOrderService CashierSalesOrderService, ICashierRetailBillService CashierRetailBillService, ICashierTemporaryCashMemoService CashierTemporaryCashMemoService, ICashierSalesBillService CashierSalesBillService,
                            ICashierRefundOrderService CashierRefundOrderService, ICashHandoverService CashHandoverService, ICardChequeHandoverService CardChequeHandoverService, IIncomeExpenseVoucherService IncomeExchangeVoucherService)
 {
     this._IUserCredentialService          = usercredentialservice;
     this._iIModuleService                 = iIModuleService;
     this._IPurchaseOrderDetailService     = IPurchaseOrderDetailService;
     this._IOutwardToClientService         = IOutwardToClientService;
     this._EntryStockItemService           = EntryStockItemService;
     this._IShopStockService               = IShopStockService;
     this._GodownStockService              = GodownStockService;
     this._IStockItemDistributionService   = IStockItemDistributionService;
     this._IRetailInvoiceMasterService     = IRetailInvoiceMasterService;
     this._ISalesBillService               = ISalesBillService;
     this._EmployeeMasterService           = EmployeeMasterService;
     this._QuotationService                = QuotationService;
     this._SalesOrderService               = SalesOrderService;
     this._DeliveryChallanService          = DeliveryChallanService;
     this._RequisitionForShopService       = RequisitionForShopService;
     this._RequisitionForGodownService     = RequisitionForGodownService;
     this._OutwardToShopService            = OutwardToShopService;
     this._OutwardShopToGodownService      = OutwardShopToGodownService;
     this._OutwardInterGodownService       = OutwardInterGodownService;
     this._OutwardInterShopService         = OutwardInterShopService;
     this._InwardFromGodownService         = InwardFromGodownService;
     this._InwardFromShopToGodownService   = InwardFromShopToGodownService;
     this._InwardInterGodownService        = InwardInterGodownService;
     this._InwardInterShopService          = InwardInterShopService;
     this._SalesReturnService              = SalesReturnService;
     this._PurchaseReturnService           = PurchaseReturnService;
     this._InwardFromSupplierService       = InwardFromSupplierService;
     this._CashierSalesOrderService        = CashierSalesOrderService;
     this._CashierRetailBillService        = CashierRetailBillService;
     this._CashierTemporaryCashMemoService = CashierTemporaryCashMemoService;
     this._CashierSalesBillService         = CashierSalesBillService;
     this._CashierRefundOrderService       = CashierRefundOrderService;
     this._CashHandoverService             = CashHandoverService;
     this._CardChequeHandoverService       = CardChequeHandoverService;
     this._IncomeExchangeVoucherService    = IncomeExchangeVoucherService;
 }
示例#32
0
 public DeliveryOrder UnconfirmObject(DeliveryOrder deliveryOrder, IDeliveryOrderDetailService _deliveryOrderDetailService,
                                      ISalesInvoiceService _salesInvoiceService, ISalesInvoiceDetailService _salesInvoiceDetailService,
                                      ISalesOrderService _salesOrderService, ISalesOrderDetailService _salesOrderDetailService,
                                      IStockMutationService _stockMutationService, IItemService _itemService, IBarringService _barringService,
                                      IWarehouseItemService _warehouseItemService)
 {
     if (_validator.ValidUnconfirmObject(deliveryOrder, _salesInvoiceService))
     {
         IList <DeliveryOrderDetail> deliveryOrderDetails = _deliveryOrderDetailService.GetObjectsByDeliveryOrderId(deliveryOrder.Id);
         foreach (var detail in deliveryOrderDetails)
         {
             detail.Errors = new Dictionary <string, string>();
             _deliveryOrderDetailService.UnconfirmObject(detail, this, _salesOrderService, _salesOrderDetailService,
                                                         _salesInvoiceDetailService, _stockMutationService,
                                                         _itemService, _barringService, _warehouseItemService);
         }
         _repository.UnconfirmObject(deliveryOrder);
     }
     return(deliveryOrder);
 }
示例#33
0
 public DeliveryOrder VCreateObject(DeliveryOrder deliveryOrder, ISalesOrderService _salesOrderService, IWarehouseService _warehouseService)
 {
     VHasWarehouse(deliveryOrder, _warehouseService);
     if (!isValid(deliveryOrder))
     {
         return(deliveryOrder);
     }
     VHasSalesOrder(deliveryOrder, _salesOrderService);
     if (!isValid(deliveryOrder))
     {
         return(deliveryOrder);
     }
     VSalesOrderHasBeenConfirmed(deliveryOrder, _salesOrderService);
     if (!isValid(deliveryOrder))
     {
         return(deliveryOrder);
     }
     VHasDeliveryDate(deliveryOrder);
     return(deliveryOrder);
 }
 ////
 // GET: /Sales/Delivery/
 public DeliveryController()
 {
     var dbfactory = new DatabaseFactory();
     _DeliveryService = new DeliveryService(new DeliveryRepository(dbfactory), new DeliveryDetailRepository(dbfactory), new SalesOrderDetailRepository(dbfactory),
         new UnitOfWork(dbfactory));
     _DeliveryDetailsService = new DeliveryDetailsService(new DeliveryDetailsRepository(dbfactory), new ChartOfProductRepository(dbfactory),
         new UnitOfMeasurementRepository(dbfactory), new DeliveryRepository(dbfactory), new SalesOrderDetailRepository(dbfactory),
         new UnitOfWork(dbfactory));
     _SecCompanyService = new SecCompanyService(new SecCompanyRepository(dbfactory), new UnitOfWork(dbfactory));
     _salesOrderService = new SalesOrderService(new SalesOrderRepository(dbfactory),
        new SalesOrderDetailRepository(dbfactory),
        new SalesOrderApprovalRepository(dbfactory),
        new NotificationRepository(dbfactory),
        new NotificationDetailRepository(dbfactory),
        new UnitOfWork(dbfactory));
     _officeService = new OfficeService(new OfficeRepository(dbfactory), new UnitOfWork(dbfactory));
     _hrmEmployeeService = new HrmEmployeeService(new HrmEmployeeRepository(dbfactory), new UnitOfWork(dbfactory));
     _objRptInvoiceService = new RptInvoiceService(new DistributorRepository(dbfactory), new UnitOfWork(dbfactory));
     _objChallenReportService = new ChallenReportService(new DistributorRepository(dbfactory), new UnitOfWork(dbfactory));
 }
示例#35
0
 public Contact VDeleteObject(Contact contact, ICoreIdentificationService _coreIdentificationService, IBarringService _barringService,
                              IPurchaseOrderService _purchaseOrderService, ISalesOrderService _salesOrderService)
 {
     VHasCoreIdentification(contact, _coreIdentificationService);
     if (!isValid(contact))
     {
         return(contact);
     }
     VHasBarring(contact, _barringService);
     if (!isValid(contact))
     {
         return(contact);
     }
     VHasSalesOrder(contact, _salesOrderService);
     if (!isValid(contact))
     {
         return(contact);
     }
     VHasPurchaseOrder(contact, _purchaseOrderService);
     return(contact);
 }
示例#36
0
 public SalesInvoiceController()
 {
     _purchaseOrderService          = new PurchaseOrderService(new PurchaseOrderRepository(), new PurchaseOrderValidator());
     _purchaseOrderDetailService    = new PurchaseOrderDetailService(new PurchaseOrderDetailRepository(), new PurchaseOrderDetailValidator());
     _purchaseInvoiceService        = new PurchaseInvoiceService(new PurchaseInvoiceRepository(), new PurchaseInvoiceValidator());
     _purchaseInvoiceDetailService  = new PurchaseInvoiceDetailService(new PurchaseInvoiceDetailRepository(), new PurchaseInvoiceDetailValidator());
     _purchaseReceivalService       = new PurchaseReceivalService(new PurchaseReceivalRepository(), new PurchaseReceivalValidator());
     _purchaseReceivalDetailService = new PurchaseReceivalDetailService(new PurchaseReceivalDetailRepository(), new PurchaseReceivalDetailValidator());
     _paymentVoucherDetailService   = new PaymentVoucherDetailService(new PaymentVoucherDetailRepository(), new PaymentVoucherDetailValidator());
     _payableService              = new PayableService(new PayableRepository(), new PayableValidator());
     _itemService                 = new ItemService(new ItemRepository(), new ItemValidator());
     _salesInvoiceService         = new SalesInvoiceService(new SalesInvoiceRepository(), new SalesInvoiceValidator());
     _salesInvoiceDetailService   = new SalesInvoiceDetailService(new SalesInvoiceDetailRepository(), new SalesInvoiceDetailValidator());
     _deliveryOrderDetailService  = new DeliveryOrderDetailService(new DeliveryOrderDetailRepository(), new DeliveryOrderDetailValidator());
     _receiptVoucherDetailService = new ReceiptVoucherDetailService(new ReceiptVoucherDetailRepository(), new ReceiptVoucherDetailValidator());
     _receivableService           = new ReceivableService(new ReceivableRepository(), new ReceivableValidator());
     _salesOrderService           = new SalesOrderService(new SalesOrderRepository(), new SalesOrderValidator());
     _deliveryOrderDetailService  = new DeliveryOrderDetailService(new DeliveryOrderDetailRepository(), new DeliveryOrderDetailValidator());
     _salesOrderDetailService     = new SalesOrderDetailService(new SalesOrderDetailRepository(), new SalesOrderDetailValidator());
     _deliveryOrderService        = new DeliveryOrderService(new DeliveryOrderRepository(), new DeliveryOrderValidator());
 }
示例#37
0
 public DeliveryOrder ConfirmObject(DeliveryOrder deliveryOrder, DateTime ConfirmationDate, IDeliveryOrderDetailService _deliveryOrderDetailService,
                                    ISalesOrderService _salesOrderService, ISalesOrderDetailService _salesOrderDetailService,
                                    IStockMutationService _stockMutationService, IItemService _itemService,
                                    IBarringService _barringService, IWarehouseItemService _warehouseItemService)
 {
     deliveryOrder.ConfirmationDate = ConfirmationDate;
     if (_validator.ValidConfirmObject(deliveryOrder, _deliveryOrderDetailService))
     {
         IList <DeliveryOrderDetail> deliveryOrderDetails = _deliveryOrderDetailService.GetObjectsByDeliveryOrderId(deliveryOrder.Id);
         foreach (var detail in deliveryOrderDetails)
         {
             detail.Errors = new Dictionary <string, string>();
             _deliveryOrderDetailService.ConfirmObject(detail, ConfirmationDate, this, _salesOrderDetailService, _stockMutationService, _itemService,
                                                       _barringService, _warehouseItemService);
         }
         _repository.ConfirmObject(deliveryOrder);
         SalesOrder salesOrder = _salesOrderService.GetObjectById(deliveryOrder.SalesOrderId);
         _salesOrderService.CheckAndSetDeliveryComplete(salesOrder, _salesOrderDetailService);
     }
     return(deliveryOrder);
 }
示例#38
0
        public override bool Search(bool preserveSelection)
        {
            criteria.Validate(true);
            ErrorList valErr = criteria.GetValidationErrors();

            errors.List.DataSource = valErr.Errors;
            errors.List.DataBind();
            if (valErr.HasErrors())
            {
                return(false);
            }

            ISalesOrderService svcSalesOrder = DI.Resolve <ISalesOrderService>();

            try
            {
                SalesOrder_ReadListInput_Criteria inReadList_Criteria = new SalesOrder_ReadListInput_Criteria();
                criteria.ToDataContract(inReadList_Criteria);
                IEnumerable <SalesOrder_ReadListOutput> outReadList;
                using (TimeTracker.ServiceCall)
                    outReadList = svcSalesOrder.ReadList(inReadList_Criteria);
                list.FromDataContract(outReadList, preserveSelection);
                list.AppliedCriteria = criteria.GetFieldCriteriaSettings();
                uclAppliedCriteria.BindTo(list.AppliedCriteria);
                return(true);
            }
            catch (Exception ex)
            {
                errors.List.DataSource = ErrorList.FromException(ex).Errors;
                errors.List.DataBind();
            }
            finally
            {
                if (svcSalesOrder is IDisposable)
                {
                    ((IDisposable)svcSalesOrder).Dispose();
                }
            }
            return(false);
        }
示例#39
0
        protected virtual void btnDelete_Click(object sender, EventArgs e)
        {
            ISalesOrderService svcSalesOrder = DI.Resolve <ISalesOrderService>();

            try
            {
                using (TimeTracker.ServiceCall)
                    svcSalesOrder.Delete((int)obj.SalesOrderIdProperty.TransportValue);
                obj.SetModified(false, true);
                OnDeleted(EventArgs.Empty);
                Hide();
            }
            catch (Exception ex)
            {
                errors.List.DataSource = ErrorList.FromException(ex).Errors;
                errors.List.DataBind();
            }
            if (svcSalesOrder is IDisposable)
            {
                ((IDisposable)svcSalesOrder).Dispose();
            }
        }
 public DeliveryOrderDetail UnconfirmObject(DeliveryOrderDetail deliveryOrderDetail, IDeliveryOrderService _deliveryOrderService,
                                            ISalesOrderService _salesOrderService, ISalesOrderDetailService _salesOrderDetailService,
                                            ISalesInvoiceDetailService _salesInvoiceDetailService, IStockMutationService _stockMutationService,
                                            IItemService _itemService, IBarringService _barringService, IWarehouseItemService _warehouseItemService)
 {
     if (_validator.ValidUnconfirmObject(deliveryOrderDetail, _salesInvoiceDetailService))
     {
         deliveryOrderDetail = _repository.UnconfirmObject(deliveryOrderDetail);
         DeliveryOrder         deliveryOrder  = _deliveryOrderService.GetObjectById(deliveryOrderDetail.DeliveryOrderId);
         WarehouseItem         warehouseItem  = _warehouseItemService.FindOrCreateObject(deliveryOrder.WarehouseId, deliveryOrderDetail.ItemId);
         Item                  item           = _itemService.GetObjectById(deliveryOrderDetail.ItemId);
         IList <StockMutation> stockMutations = _stockMutationService.SoftDeleteStockMutationForDeliveryOrder(deliveryOrderDetail, warehouseItem);
         foreach (var stockMutation in stockMutations)
         {
             //item.PendingDelivery += deliveryOrderDetail.Quantity;
             //item.Quantity += deliveryOrderDetail.Quantity;
             _stockMutationService.ReverseStockMutateObject(stockMutation, _itemService, _barringService, _warehouseItemService);
         }
         SalesOrderDetail salesOrderDetail = _salesOrderDetailService.GetObjectById(deliveryOrderDetail.SalesOrderDetailId);
         _salesOrderDetailService.UnsetDeliveryComplete(salesOrderDetail, deliveryOrderDetail.Quantity, _salesOrderService);
     }
     return(deliveryOrderDetail);
 }