public AreaController()
 {
     var dbfactory = new DatabaseFactory();
     _areaService = new AreaService(new AreaRepository(dbfactory), new UnitOfWork(dbfactory));
     _areaConfigurationService = new AreaConfigurationService(new AreaConfigurationRepository(dbfactory), new UnitOfWork(dbfactory));
     _areaConfigurationDetailService = new AreaConfigurationDetailService(new AreaConfigurationDetailRepository(dbfactory), new UnitOfWork(dbfactory));
 }
 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 ProductUnitsController()
 {
     var dbfactory = new DatabaseFactory();
     _ProductUnitService = new ProductUnitService(new ProductUnitRepository(dbfactory), new UnitOfWork(dbfactory));
     _unitOfMeasurementService = new UnitOfMeasurementService(new UnitOfMeasurementRepository(dbfactory), new UnitOfWork(dbfactory));
     _ProductPriceService = new ProductPriceService(new ProductPriceRepository(dbfactory), new UnitOfWork(dbfactory));
 }
        public RegionController()
        {
            var dbfactory = new DatabaseFactory();
            var datacontext=dbfactory.Get();

            _regionService = new RegionService(new RegionRepository(dbfactory), new UnitOfWork(dbfactory));
        }
 public ProjectCloseController()
 {
     // Session["ModuleId"] = 2;
     var dbfactory = new DatabaseFactory();
     _CmnProjectService = new CmnProjectService(new CmnProjectRepository(dbfactory), new UnitOfWork(dbfactory));
     //_CmnBusinessService = new CmnBusinessService(new CmnBusinessRepository(dbfactory), new UnitOfWork(dbfactory));
 }
 public SalesDiscountSettingController()
 {
     var dbfactory = new DatabaseFactory();
      ISalesDiscountSettingRepository rpos=new SalesDiscountSettingRepository(dbfactory);
      UnitOfWork unit=new UnitOfWork(dbfactory);
     _salesDiscountSettingService = new SalesDiscountSettingService(rpos, unit);
 }
 public CompanyUserController()
 {
     //Session["ModuleId"] = 1;
     var dbfactory = new DatabaseFactory();
     _su = new SecUserService(new SecUserRepository(dbfactory), new UnitOfWork(dbfactory));
     _cu = new SecCompanyUserService(new SecCompanyUserRepository(dbfactory), new UnitOfWork(dbfactory));
 }
        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 void GetAll()
        {
            DatabaseFactory dbFactory = new DatabaseFactory();
            IFreeProductService service = new FreeProductService(new FreeProductRepository(dbFactory),
                new ChartOfProductRepository(dbFactory), new UnitOfMeasurementRepository(dbFactory), new UnitOfWork(dbFactory));
            var list = service.GetAll(1);
            var result = list.Select(i => new SlsFreeProductsViewModel()
            {
                Id = i.Id,
                SlsProductId = i.SlsProductId,
                StartDate = i.StartDate,
                EndDate = i.EndDate,
                MeasurementQuantity = i.MeasurementQuantity,
                SlsUnitId = i.SlsUnitId,
                FreeQuantity = i.FreeQuantity,
                FreeUnitId = i.FreeUnitId,
                Remarks = i.Remarks,
                SecCompnayId = i.SecCompnayId,
                CreatedBy = i.CreatedBy,
                CreatedDate = i.CreatedDate,
                ModifiedBy = i.ModifiedBy,
                ModifiedDate = i.ModifiedDate,

                SlsProductName = i.SlsProductName,
                SlsUnitName = i.SlsUnitName,
                FreeUnitName = i.FreeUnitName
            }).Distinct().ToList();

            Assert.IsInstanceOfType(result, typeof(JsonResult));
        }
 public PromotionalOffersController()
 {
     var dbfactory = new DatabaseFactory();
     _promotionalOfferService = new PromotionalOfferService(new PromotionalOfferRepository(dbfactory),
         new PromotionalOfferDetailRepository(dbfactory),
         new UnitOfWork(dbfactory));
 }
        public AnfAdvancetAdjustmentService(IAnfAdvanceAdjustmentRepository anfAnfAdvanceAdjustmentRepository, IUnitOfWork unitOfWork)
        {
            var dbfactory = new DatabaseFactory(); //Add by me

            this._AnfAdvanceAdjustmentRepository = anfAnfAdvanceAdjustmentRepository;
            this._UnitOfWork = unitOfWork;
            _anfAdvancetListRepository = new AnfAdvancetListepository(dbfactory); // add  by me
        }
 //  private ICmnProjectService _CmnProjectService;
 public ChartofAccountController()
 {
     // Session["ModuleId"] = 2;
     var dbfactory = new DatabaseFactory();
     // _CmnProjectService = new CmnProjectService(new CmnProjectRepository(dbfactory), new UnitOfWork(dbfactory));
     _AnFChartOfAccountService = new ChartOfAccountService(new AnFChartOfAccountRepository(dbfactory), new UnitOfWork(dbfactory));
     _AnFOpeningBalanceService = new AnFOpeningBalanceService(new AnFOpeningBalanceRepository(dbfactory), new UnitOfWork(dbfactory));
 }
 public RequisitionBoardController()
 {
     var dbfactory = new DatabaseFactory();
     _RequisitionService = new RequisitionService(new RequisitionRepository(dbfactory),
         new RequisitionApprovalRepository(dbfactory),
         new NotificationRepository(dbfactory), new NotificationDetailRepository(dbfactory),
         new UnitOfWork(dbfactory));
 }
 public CollectionController()
 {
     var dbfactory = new DatabaseFactory();
     _collectionEntryService = new CollectionEntryService(new CollectionEntryRepository(dbfactory), new UnitOfWork(dbfactory));
     _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));
 }
 public IssueController()
 {
     var dbfactory = new DatabaseFactory();
      _IssueService = new IssueService(new IssueRepository(dbfactory), new UnitOfWork(dbfactory));
      _IssueDetailService = new IssueDetailService(new IssueDetailRepository(dbfactory), new UnitOfWork(dbfactory));
      _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));
 }
 public SalesTargetController()
 {
     var dbfactory = new DatabaseFactory();
      _SalesTargetService = new SalesTargetService(new SalesTargetRepository(dbfactory), new UnitOfWork(dbfactory));
      _SalesTargetDetailService = new SalesTargetDetailService(new SalesTargetDetailRepository(dbfactory), new UnitOfWork(dbfactory));
      _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));
 }
 public SalesReturnController()
 {
     var dbfactory = new DatabaseFactory();
     _SalesReturnService = new SalesReturnService(new SalesReturnRepository(dbfactory),
         new SalesReturnDetailRepository(dbfactory), new StockInRepository(dbfactory), new UnitOfWork(dbfactory));
     _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));
 }
 public ExpenseController()
 {
     var dbfactory = new DatabaseFactory();
     _anfExpenseService = new AnFExpenseService(new ERPOptima.Data.Accounts.Repository.AnFExpenseRepository(dbfactory), new UnitOfWork(dbfactory));
     _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));
     _ccService = new AnFCostCenterService(new AnFCostCenterRepository(dbfactory), new UnitOfWork(dbfactory)); //Add by Bably
 }
        private ISecCompanyService _SecCompanyService; //Add by Bably

        #endregion Fields

        #region Constructors

        public AdvanceController()
        {
            var dbfactory = new DatabaseFactory();
            _advanceListService = new AnfAdvancetListService(new AnfAdvancetListepository(dbfactory),new UnitOfWork(dbfactory));
            _advancetAdjustmentService = new AnfAdvancetAdjustmentService(new AnfAdvanceAdjustmentRepository(dbfactory), new UnitOfWork(dbfactory));
            _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));
        }
 public DashBoardController()
 {
     var dbFactory = new DatabaseFactory();
      _anfVoucherService = new AnFVoucherService(new AnFVoucherRepository(dbFactory), new UnitOfWork(dbFactory));
      _cmnApprovalProcessService=new CmnApprovalProcessService(new CmnApprovalProcessRepository(dbFactory),new UnitOfWork(dbFactory));
      _cmnApprovalProcessLevelService = new CmnApprovalProcessLevelService(new CmnApprovalProcessLevelRepository(dbFactory), new UnitOfWork(dbFactory));
      _cmnProcessLevelService = new CmnProcessLevelService(new CmnProcessLevelRepository(dbFactory), new UnitOfWork(dbFactory));
      _cmnApprovalService = new CmnApprovalService(new CmnApprovalRepository(dbFactory), new UnitOfWork(dbFactory));
 }
 public DefectEntryController()
 {
     var dbfactory = new DatabaseFactory();
        _IDefectEntryService = new DefectEntryService(new DefectEntryRepository(dbfactory), new UnitOfWork(dbfactory));
     _IDefectDetailService = new DefectDetailEntryService(new DefectDetailEntryRepository(dbfactory), new UnitOfWork(dbfactory));
     _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));
 }
 public DefectReplacementController()
 {
     var dbfactory = new DatabaseFactory();
        _IDefectReplacementService = new DefectEntryService(new DefectEntryRepository(dbfactory), new UnitOfWork(dbfactory));
     _IDefectDetailService = new DefectDetailEntryService(new DefectDetailEntryRepository(dbfactory), new UnitOfWork(dbfactory));
     _SecCompanyService = new SecCompanyService(new SecCompanyRepository(dbfactory), new UnitOfWork(dbfactory));
     _ProductService = new ChartOfProductService(new ChartOfProductRepository(dbfactory), new UnitOfWork(dbfactory));
     _UnitService = new UnitOfMeasurementService(new UnitOfMeasurementRepository(dbfactory), new UnitOfWork(dbfactory));
 }
 public FixedAssetController()
 {
     var dbfactory = new DatabaseFactory();
     _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));
     _AnFFixedAssetService = new AnFFixedAssetService(new AnFFixedAssetRepository(dbfactory), new AnFFixedAcquisitionRepository(dbfactory), new AnFFixedAssetRevalueRepository(dbfactory), new UnitOfWork(dbfactory));
     _AnFFixedAssetRevalueService = new AnFFixedAssetRevalueService(new AnFFixedAssetRevalueRepository(dbfactory), new UnitOfWork(dbfactory));
 }
 //private IAnFOpeningBalanceService _opBalanceService;
 public ReportController()
 {
     var dbfactory = new DatabaseFactory();
     _anfVoucherService = new AnFVoucherService(new AnFVoucherRepository(dbfactory), new UnitOfWork(dbfactory));
     _CmnCompanyService = new SecCompanyService(new SecCompanyRepository(dbfactory), new UnitOfWork(dbfactory));
     //_CmnProjectService = new CmnProjectService(new CmnProjectRepository(dbfactory), new UnitOfWork(dbfactory));
     _ccService = new AnFCostCenterService(new AnFCostCenterRepository(dbfactory), new UnitOfWork(dbfactory));
     _coaService = new ChartOfAccountService(new AnFChartOfAccountRepository(dbfactory), new UnitOfWork(dbfactory));
     //_opBalanceService = new AnFOpeningBalanceService(new AnFOpeningBalanceRepository(dbfactory), new UnitOfWork(dbfactory));
 }
 public TransferController()
 {
     var dbfactory = new DatabaseFactory();
      _TransferService = new TransferService(new TransferRepository(dbfactory), new UnitOfWork(dbfactory));
      _TransferDetailService = new TransferDetailService(new TransferDetailRepository(dbfactory), new UnitOfWork(dbfactory));
      _SecCompanyService = new SecCompanyService(new SecCompanyRepository(dbfactory), new UnitOfWork(dbfactory));
      _officeService = new OfficeService(new OfficeRepository(dbfactory), new UnitOfWork(dbfactory));
      _StoreService = new StoreService(new InvStoreRepository(dbfactory), new UnitOfWork(dbfactory));
      _hrmEmployeeService = new HrmEmployeeService(new HrmEmployeeRepository(dbfactory), new UnitOfWork(dbfactory));
 }
 public FieldVisitController()
 {
     var dbfactory = new DatabaseFactory();
     _fieldVisitListService = new FieldVisitListService(new FieldVisitListRepository(dbfactory), new UnitOfWork(dbfactory));
     _fieldVisitService = new FieldVisitService(new FieldVisitRepository(dbfactory), new UnitOfWork(dbfactory));
     _SecCompanyService = new SecCompanyService(new SecCompanyRepository(dbfactory), new UnitOfWork(dbfactory));
     _SecUserService = new SecUserService(new ERPOptima.Data.Security.Repository.SecUserRepository(dbfactory), new UnitOfWork(dbfactory));
     _officeService = new OfficeService(new OfficeRepository(dbfactory), new UnitOfWork(dbfactory));
     _hrmEmployeeService = new HrmEmployeeService(new HrmEmployeeRepository(dbfactory), new UnitOfWork(dbfactory));
 }
 public ProductReceiveController()
 {
     var dbfactory = new DatabaseFactory();
     _ProductReceiveService = new ProductReceiveService(new ProductReceiveRepository(dbfactory), new UnitOfWork(dbfactory));
     _ProductReceiveDetailService = new ProductReceiveDetailService(new ProductReceiveDetailRepository(dbfactory), new UnitOfWork(dbfactory));
     _SecCompanyService = new SecCompanyService(new SecCompanyRepository(dbfactory), new UnitOfWork(dbfactory));
     _ProductDetailService = new ProductDetailService(new IssueDetailRepository(dbfactory), new UnitOfWork(dbfactory));
     _SlsProductReceiveService = new SlsProductReceiveService(new SlsProductReceiveRepository(dbfactory), new SlsProductReceiveDetailRepository(dbfactory),
         new ChartOfProductRepository(dbfactory), new UnitOfMeasurementRepository(dbfactory), new UnitOfWork(dbfactory));
 }
 public VoucherApprovalController()
 {
     var dbfactory = new DatabaseFactory();
     _IVoucherApprovalService = new VoucherApprovalService(new AnFVoucherApprovalRepository(dbfactory), new UnitOfWork(dbfactory));
     _su = new SecUserService(new SecUserRepository(dbfactory), new UnitOfWork(dbfactory));
     _ICmnApprovalCommentService = new CmnApprovalCommentService(new CmnApprovalCommentRepository(dbfactory), new UnitOfWork(dbfactory));
     _ICmnApprovalService = new CmnApprovalService(new CmnApprovalRepository(dbfactory), new UnitOfWork(dbfactory));
     _IAnFVoucherService = new AnFVoucherService(new AnFVoucherRepository(dbfactory), new UnitOfWork(dbfactory));
     _cmnApprovalProcessLevelService = new CmnApprovalProcessLevelService(new CmnApprovalProcessLevelRepository(dbfactory), new UnitOfWork(dbfactory));
     _anfVoucherDetailsService = new AnFVoucherDetailsService(new AnFVoucherDetailsRepository(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);
 }
 public DamageRequestController()
 {
     var dbfactory = new DatabaseFactory();
      _IDamageService = new DamageService(new InvDamageRepository(dbfactory),
         new NotificationRepository(dbfactory),
         new NotificationDetailRepository(dbfactory),
         new InvDamageApprovalRepository(dbfactory), new UnitOfWork(dbfactory));
     _IDamageDetailService = new DamageDetailService(new InvDamageDetailRepository(dbfactory), new UnitOfWork(dbfactory));
     _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));
 }