public EmailSender(IOptions <SendGridOptions> sendGridOptions,
                    IFunctional functional,
                    IOptions <SmtpOptions> smtpOptions)
 {
     _sendGridOptions = sendGridOptions.Value;
     _functional      = functional;
     _smtpOptions     = smtpOptions.Value;
 }
 public FilesController(IFileProvider fileProvider, IHostingEnvironment hostingEnvironment, AppDbContext context, IFunctional functionalService, UserManager <AppUser> userManager)
 {
     _hostingEnvironment = hostingEnvironment;
     _context            = context;
     _functionalService  = functionalService;
     _userManager        = userManager;
     this.fileProvider   = fileProvider;
 }
Example #3
0
 public MyAgendaController(IFunctional functionalService,
                           IMapper mapper,
                           UserManager <ApplicationUser> userManager)
 {
     _functionalService = functionalService;
     _mapper            = mapper;
     _userManager       = userManager;
 }
Example #4
0
 public UserController(IFunctional functionalService,
                       UserManager <ApplicationUser> userManager,
                       RoleManager <IdentityRole> roleManager)
 {
     _functionalService = functionalService;
     _userManager       = userManager;
     _roleManager       = roleManager;
 }
 public UploadProfilePictureController(IFunctional functionalService,
                                       IHostingEnvironment env,
                                       UserManager <ApplicationUser> userManager,
                                       ApplicationDbContext context)
 {
     _functionalService = functionalService;
     _env         = env;
     _userManager = userManager;
     _context     = context;
 }
        public EmailSender(IOptions <SendGridOptions> sendGridOptions,
                           IFunctional functional,
                           IOptions <SmtpOptions> smtpOptions)
        {
            _sendGridOptions = sendGridOptions.Value;
            _functional      = functional;
            _smtpOptions     = smtpOptions.Value;

            MyHttpApplication.MyEmailSender = this;
        }
 public UserController(IFunctional functionalService,
                       UserManager <ApplicationUser> userManager,
                       RoleManager <IdentityRole> roleManager,
                       INumberSequence numberSequence)
 {
     _functionalService = functionalService;
     _userManager       = userManager;
     _roleManager       = roleManager;
     _numberSequence    = numberSequence;
 }
Example #8
0
        public IVector <T> Minimize(IFunctional <T> objective, IParametricFunction <T> function, IVector <T> initialParameters, IVector <T> minimumParameters = default,
                                    IVector <T> maximumParameters = default)
        {
            if (!(objective is IDifferentiableFunctional <T> o1))
            {
                throw new ArgumentException("This optimizer accept only IDifferentiableFunctional", nameof(objective));
            }

            return(MinimizeInternal(o1, function, initialParameters, minimumParameters, maximumParameters));
        }
Example #9
0
 public AccountController(
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager,
     IBasketService basketService,
     IAppLogger <AccountController> logger,
     IFunctional functional
     )
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _basketService = basketService;
     _logger        = logger;
     _functional    = functional;
 }
Example #10
0
 public AccountController(
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager,
     IEmailSender emailSender,
     ILogger <AccountController> logger,
     ApplicationDbContext ctx,
     IBasketService basketService,
     IFunctional functional)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _emailSender   = emailSender;
     _logger        = logger;
     _context       = ctx;
     _basketService = basketService;
     _functional    = functional;
 }
Example #11
0
        public static async Task Initialize(ApplicationDbContext context,
                                            IFunctional functional)
        {
            context.Database.EnsureCreated();

            //check for users
            if (context.VinarishUser.Any())
            {
                return; //if user is not empty, DB has been seed
            }

            //init app with super admin user
            await functional.CreateDefaultSuperAdmin();

            //init app data
            await functional.InitAppData();
        }
Example #12
0
        public static async Task Initialize(ApplicationDbContext context,
                                            IFunctional functional)
        {
            context.Database.EnsureCreated();

            //check for users
            if (context.ApplicationUser.Any())
            {
                return; //if user is not empty, DB has been seed
            }

            //init app with super admin user
            await functional.CreateDefaultSuperAdmin();

            List <string> warehouseRoles = new List <string> {
                "Dashboard Main", "Warehouse", "Sales Order", "Event Log", "Product", "Shipment", "Vendor Type", "Vendor", "Purchase Type", "Purchase Order", "Goods Received Note", "Bill", "Payment Voucher", "Product", "Product Type", "Unit Of Measure", "Change Password"
            };
            List <string> salesRoles = new List <string> {
                "Dashboard Main", "Sales Order", "Sales Type", "Event Log", "Customer", "Customer Type", "Change Password"
            };
            List <string> operationRoles = new List <string> {
                "Dashboard Main", "Sales Order", "Event Log", "Change Password"
            };
            List <string> accountRoles = new List <string> {
                "Dashboard Main", "Sales Order", "Event Log", "Change Password"
            };
            //Warehouse
            await functional.CreateUsers("*****@*****.**", "test1234", "Rogan", "Beasley", 1, warehouseRoles);

            //Sales
            await functional.CreateUsers("*****@*****.**", "test1234", "Javier", "Lu", 2, salesRoles);

            //Operatioin
            await functional.CreateUsers("*****@*****.**", "test1234", "Jiya", "Lane", 3, operationRoles);

            //Account
            await functional.CreateUsers("*****@*****.**", "test1234", "Abel", "Williams", 4, accountRoles);

            //init app data
            await functional.InitAppData();
        }
Example #13
0
        public static T FindMin(IFunctional <T> functional, IParametricFunction <T> function, IVector <T> s, IVector <T> p, T eps)
        {
            var la = LinearAlgebra.Value;

            var a = la.Cast(0);
            var b = la.Cast(1e2);
            var x = la.Sum(a, la.Mult(la.Mult(la.Cast(0.5), la.Sub(la.Cast(3), la.Sqrt(la.Cast(5.0)))), (la.Sub(b, a))));
            var y = la.Sum(la.Sub(b, x), a);

            var fx     = function.Bind(s.AddWithCloning(p.MultWithCloning(la.Mult(x, la.Cast(-1)))));
            var fy     = function.Bind(s.AddWithCloning(p.MultWithCloning(la.Mult(y, la.Cast(-1)))));
            var valueX = functional.Value(fx);

            var valueY = functional.Value(fy);

            while (la.Compare(la.Abs(la.Sub(b, a)), la.Cast(1e-5)) == 1)
            {
                if (la.Compare(valueX, valueY) == -1)
                {
                    b      = y;
                    y      = x;
                    fy     = fx;
                    valueY = valueX;
                    x      = la.Sub(la.Sum(b, a), y);
                    fx     = function.Bind(s.AddWithCloning(p.MultWithCloning(la.Mult(x, la.Cast(-1)))));
                    valueX = functional.Value(fx);
                }
                else
                {
                    a      = x;
                    x      = y;
                    fx     = fy;
                    valueX = valueY;
                    y      = la.Sub(la.Sum(b, a), x);
                    fy     = function.Bind(s.AddWithCloning(p.MultWithCloning(la.Mult(y, la.Cast(-1)))));
                    valueY = functional.Value(fy);
                }
            }
            return(la.Div(la.Sum(a, b), la.Cast(2)));
        }
Example #14
0
        public IVector <T> Minimize(IFunctional <T> objective, IParametricFunction <T> function, IVector <T> initialParameters, IVector <T> minimumParameters = default,
                                    IVector <T> maximumParameters = default)
        {
            var         k     = 0;
            var         la    = LinearAlgebra.Value;
            IVector <T> xPrev = initialParameters.Clone() as IVector <T>;
            IVector <T> xNew  = initialParameters.Clone() as IVector <T>;

            var normalDist = new Normal(Mean, StdDev);
            T   prevValue  = objective.Value(function.Bind(xPrev));

            do
            {
                var t = 20d / Math.Log(k, Math.E);

                for (int i = 0; i < xPrev.Count; i++)
                {
                    var nR = normalDist.Sample() * t;
                    xNew[i] = la.Sum(xPrev[i], la.Cast(nR));
                }

                this.ApplyMinimumAndMaximumValues(minimumParameters, maximumParameters, xNew, la);

                var newValue = objective.Value(function.Bind(xNew));

                var sub = la.Sub(newValue, prevValue);

                if (la.Compare(sub, la.GetZeroValue()) == -1) // || la.Exp(la.Mult(la.Cast(-1/t), sub)) >= rand.NextDouble())
                {
                    prevValue = newValue;
                    xPrev     = xNew.Clone() as IVector <T>;
                }
            } while ((MaxIter.HasValue && MaxIter > k++ && la.Compare(prevValue, Eps) == 1) || (!MaxIter.HasValue && la.Compare(prevValue, Eps) == 1));

            return(xPrev);
        }
 public InvoiceTypeController(IFunctional functionalService)
 {
     _functionalService = functionalService;
 }
Example #16
0
 public BillController(IFunctional functionalService,
                       INumberSequence numberSequence)
 {
     _functionalService = functionalService;
     _numberSequence    = numberSequence;
 }
Example #17
0
 public PaymentTypeController(IFunctional functionalService)
 {
     _functionalService = functionalService;
 }
 public PurchaseTypeController(IFunctional functionalService)
 {
     _functionalService = functionalService;
 }
 public VendorController(IFunctional functionalService)
 {
     _functionalService = functionalService;
 }
 public BookGeneralController(IFunctional functionalService,
                              IMapper mapper)
 {
     _functionalService = functionalService;
     _mapper            = mapper;
 }
 public PaymentReceiveController(IFunctional functionalService,
                                 INumberSequence numberSequence)
 {
     _functionalService = functionalService;
     _numberSequence    = numberSequence;
 }
Example #22
0
 public UnitOfMeasureController(IFunctional functionalService)
 {
     _functionalService = functionalService;
 }
Example #23
0
 public PurchaseOrderLineController(IFunctional functionalService,
                                    IMapper mapper)
 {
     _mapper            = mapper;
     _functionalService = functionalService;
 }
 public CurrencyController(IFunctional functionalService)
 {
     _functionalService = functionalService;
 }
 public DashboardController(IFunctional functionalService)
 {
     _functionalService = functionalService;
 }
Example #26
0
 public CashBankController(IFunctional functionalService)
 {
     _functionalService = functionalService;
 }
Example #27
0
 public CustomerTypeController(IFunctional functionalService)
 {
     _functionalService = functionalService;
 }
 public MeetingRoomController(IFunctional functionalService,
                              INumberSequence numberSequence)
 {
     _functionalService = functionalService;
     _numberSequence    = numberSequence;
 }
Example #29
0
 public SalesOrderLineController(IFunctional functionalService,
                                 IMapper mapper)
 {
     _functionalService = functionalService;
     _mapper            = mapper;
 }
 public PurchaseOrderController(IFunctional functionalService,
                                INumberSequence numberSequence)
 {
     _functionalService = functionalService;
     _numberSequence    = numberSequence;
 }