Ejemplo n.º 1
0
        public ActionResult Index(LoginDetails loninDetail)
        {
            if (loninDetail.CustomerEmail == null)
            {
                return RedirectToAction("LogIn");
            }
            CustomerController custReg = new CustomerController();
            List<Customer> customerList = custReg.Get().ToList();

            ViewBag.Message = "Food as a Service";
            ViewBag.Message = "Your Products page.";
            var teantid = FAAS.App_Start.Helper.GetTeantId();
            //ServiceController con = new ServiceController();
            // IEnumerable<string> pro =con.Get();
            ProductController proCon = new ProductController();
            var products = proCon.Get();

            //  var products = FAAS.App_Start.Helper.GetProducts(teantid);
            FAAS.Models.HeaderModel model = new Models.HeaderModel();
            model.TenantImageUrl = FAAS.App_Start.Helper.GetCustomLogo(teantid);

            model.productItems = products.ToList().FindAll(a => a.ProductId == 100);
            if (customerList.Count > 0)
            {
                var customer = customerList.Find(a => a.EmailId == loninDetail.CustomerEmail);
                model.CustmorID = customer.CustomerID;
                Session["userId"] = model.CustmorID;
                Session["CustomerName"] = loninDetail.CustomerName;
                Session["Image"] = customer.ImageUrl;
            }

            return View(model);
        }
Ejemplo n.º 2
0
    public ActionResult HeaderNav()
    {
        var model = new Models.HeaderModel
        {
            NavigationHtml = HttpContext.Application["HeaderNav"] as string
        };

        return(PartialView("_Header", model));
    }
Ejemplo n.º 3
0
        public MainWindowViewModel()
        {
            //Instantiate client file header model object
            Header = new Models.HeaderModel();
            // Instantiate file selection and dir path model
            FileSelect = new Models.FileSelectModel();
            //Default Pressure Units Combobox
            SelectedPresUnit = Models.PresUnitSelection.psia;
            //Default Temp Units Combobox
            SelectedTempUnit = Models.TempUnitSelection.degC;
            //All Data checkbox default value
            AllDataCb = true;
            //NotBusy set to true, export button enabled.
            NotBusy = true;
            // Progress bar text info
            ProgressText = "Ready";
            // default selected linear time shift direction
            SelectedShift = ShiftDirection[0];

            SelectFilesToExportCommand = new DelegateCommand(OnSelectFilesToExport, CanSelectFilesToExport);
            ExportDataFilesCommand     = new DelegateCommand(OnExportDataFiles, CanExportDataFiles);
        }
Ejemplo n.º 4
0
        public ActionResult Products(List<ProductItem> productItemVal)
        {
            if (TempData["myObject"] != null)
            {
                productItemVal = (List<ProductItem>)TempData["myObject"];
            }

            if (Session["userId"] == null)
            {
                return RedirectToAction("LogIn");
            }

            ViewBag.Title = "Products";
            ViewBag.Message = "Your Products page.";
            var teantid = FAAS.App_Start.Helper.GetTeantId();
            // var products = FAAS.App_Start.Helper.GetProducts(teantid);
            ProductController proCon = new ProductController();
            var products = proCon.Get();
            if (productItemVal != null)
            {
                products.Where(x => x.ProductId == productItemVal.First().ProductId).ToList().ForEach(a => a.Qty = productItemVal.First().Qty);

            }
            //  products.ToList().FindAll.ForEach(a => a.Qty == productItemVal.First().Qty);

            FAAS.Models.HeaderModel model = new Models.HeaderModel();
            model.TenantImageUrl = FAAS.App_Start.Helper.GetCustomLogo(teantid);
            model.productItems = products.ToList();
            if (Session["userId"] != null)
            {
                var uid = Session["userId"];
                model.CustmorID = (int)uid;
            }

            return View(model);
        }