public ActionResult GetYears()
        {
            var dbfactory = new DatabaseFactory();
            ERPOptima.Data.Common.Repository.CmnFinancialYearRepository fyRep = new ERPOptima.Data.Common.Repository.CmnFinancialYearRepository(dbfactory);
            UnitOfWork uow = new UnitOfWork(dbfactory);
            ERPOptima.Service.Common.ICmnFinancialYearService fyService = new ERPOptima.Service.Common.CmnFinancialYearService(fyRep, uow);

            int financialYearId = Convert.ToInt32(Session["financialYear"]);
            //int financialYearId = 34;
            var years = new List<object>();
            if (financialYearId != null)
            {

                ERPOptima.Model.Common.CmnFinancialYear fy = fyService.GetById(financialYearId);
                if(fy!=null)
                {
                    //Add string Year
                    var strYear = fy.OpeningDate.Year;
                    var obj = new { Name = strYear };
                    years.Add(obj);
                    //Add End Year
                    if (fy.ClosingDate.HasValue)
                    {
                        var endYear = fy.ClosingDate.Value.Year;
                        if(!years.Equals(endYear))
                        {
                            obj = new { Name = endYear };
                            years.Add(obj);
                        }
                    }

                }
            }
            return Json(years, JsonRequestBehavior.AllowGet);
        }
 public SalesDiscountSettingController()
 {
     var dbfactory = new DatabaseFactory();
      ISalesDiscountSettingRepository rpos=new SalesDiscountSettingRepository(dbfactory);
      UnitOfWork unit=new UnitOfWork(dbfactory);
     _salesDiscountSettingService = new SalesDiscountSettingService(rpos, unit);
 }
예제 #3
0
 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));
 }
 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);
 }
 //
 // GET: /Sales/RouteSetup/
 public RouteSetupController()
 {
     var dbfactory = new DatabaseFactory();
     var unitOfWork = new UnitOfWork(dbfactory);
     _service = new RouteSetupService(new RouteSetupRepository(dbfactory),
         new RouteSetupDetailRepository(dbfactory), new UnitOfWork(dbfactory));
     _routePlanService = new RoutePlanService(new RoutePlanRepository(dbfactory), new RoutePlanDetailRepository(dbfactory),
         new RoutePlanApprovalRepository(dbfactory), new NotificationRepository(dbfactory),
         new NotificationDetailRepository(dbfactory), new UnitOfWork(dbfactory));
     _approvalController = new ApprovalController<SlsRoutePlanApproval, SlsRoutePlan>(_routePlanService);
     _distributorservice = new DistributorService(new DistributorRepository(dbfactory), unitOfWork);
     _retailerservice = new RetailerService(new RetailerRepository(dbfactory), unitOfWork);
     _delearservice = new DealerService(new DealerRepository(dbfactory), unitOfWork);
     _corporateclientservice = new CorporateClientService(new CorporateClientRepository(dbfactory), unitOfWork);
 }
        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);
 }