Esempio n. 1
0
        public ActionResult Others(OtherModel model)
        {
            int pageIndex = model.Page ?? 1;

            using (EquipmentsEntities data = new EquipmentsEntities())
            {
                model.OtherSearch = (from c in data.TB_Others.Where(p => p.KayitDurum == "Active" && (String.IsNullOrEmpty(model.Users) || p.Users.Contains(model.Users)) &&
                                                                    (String.IsNullOrEmpty(model.SerialNumber) || p.SerialNumber.Contains(model.SerialNumber))).OrderByDescending(p => p.ID)
                                     select new OtherListModel
                {
                    Users = c.Users,
                    Brand = c.Brand,
                    Features = c.Features,
                    InvoiceNumber = c.InvoiceNumber,
                    Location = c.Location,
                    OldUser = c.OldUser,
                    PurchaseDate = c.PurchaseDate,
                    SerialNumber = c.SerialNumber,
                    Specification = c.Specification,
                    UserCode = c.UserCode,
                }).ToPagedList(pageIndex, 15);
                if (Request.IsAjaxRequest())
                {
                    return(PartialView("_Others", model));
                }
                else
                {
                    return(View(model));
                }
            }
        }
Esempio n. 2
0
        public MainViewModel()
        {
            OtherModel = new OtherModel();

            Processes = new ObservableCollection <ProcessList>();
            foreach (Process process in Process.GetProcesses())
            {
                try
                {
                    Processes.Add(new ProcessList(process));
                }
                catch (Exception)

                {
                }
            }

            _tokenSource = new CancellationTokenSource();
            _token       = _tokenSource.Token;

            StationManager.StopThreads += StopWorkingThread;

            IsControlEnabled = true;
            Thread.Sleep(5000);

            StartWorkingThread();
        }
 public ModelThatCanBeConvertedToString(
     int value,
     int value2,
     OtherModel otherModel)
 {
     this.Value      = value;
     this.Value2     = value2;
     this.OtherModel = otherModel;
 }
        // zobrazení stránky Other
        public ActionResult Other()
        {
            ViewBag.Message = "Other funcionality.";
            OtherModel model = new OtherModel();

            // nastavení počáteční hodnoty náhodné čísla na 0
            model.RandomNum = 0;
            return(View(model));
        }
Esempio n. 5
0
        public ActionResult ShowImages(string userToken, string culture, bool isTesting = false)
        {
            //isTesting = true;//for test only
            var m = new OtherModel {
                Culture = culture, UserToken = userToken, IsTesting = isTesting
            };

            //string path = Server.MapPath("XmlSample.txt");
            //var s = CmpHelper.GetCmpData("111", "222", path);
            //ViewBag.UserAgentStr = HttpContext.Request.UserAgent;
            return(View(m));
        }
Esempio n. 6
0
        public Decimal Populate(OtherModel other, BenchmarkValueResolver valueResolver)
        {
            var total     = 0m;
            var residents = other.GetResidents();

            foreach (var resident in residents)
            {
                total += this.PopulateOnceResolved(resident, valueResolver);
            }
            other.Benchmark = total;
            return(total);
        }
Esempio n. 7
0
        protected void TraverseOther(OtherModel model, ICollection <IGlobeResident> result)
        {
            result.Add(model);
            foreach (var resident in model.BasketCountries)
            {
                resident.Parent = model;
                this.TraverseBasketCountry(resident, result);
            }

            foreach (var resident in model.UnsavedBasketCountries)
            {
                resident.Parent = model;
                this.TraverseUnsavedBasketCountry(resident, result);
            }
        }
        public ActionResult Other(OtherModel model, string submitButton)
        {
            // switch zjišťující, jaké z tlačítek bylo zvoleno
            switch (submitButton)
            {
            case "Six":
                model.RandomNum = Six();
                break;

            case "Twelve":
                model.RandomNum = Twelve();
                break;

            default:
                return(View());
            }
            return(View(model));
        }
Esempio n. 9
0
 public void Resolve(OtherModel model)
 {
     // do nothing
 }
Esempio n. 10
0
 public void put_other(OtherModel input)
 {
 }
Esempio n. 11
0
 public void Resolve(OtherModel model)
 {
     this.populator.Populate(model, this.valueResolver);
 }
 public void Resolve(OtherModel model)
 {
     this.Result = this.parent.OtherTemplate;
 }
Esempio n. 13
0
 private void OpenMoreInfoExecute(object obj)
 {
     OtherModel.OpenMoreInfo(SelectedProcess);
 }
Esempio n. 14
0
 public CountryBasketChange(UnsavedBasketCountryModel unsavedBasketCountry, OtherModel other)
 {
     this.UnsavedBasketCountry = unsavedBasketCountry;
     this.Other = other;
 }
Esempio n. 15
0
 public void Resolve(OtherModel model)
 {
     this.traverser.TraverseOther(model, this.result);
 }
Esempio n. 16
0
 public ActionResult SomeAction(OtherModel model)
 {
     return(Ok($"I have done something after reCaptcha was validated"));
 }
Esempio n. 17
0
 private void OpenFolderExecute(object obj)
 {
     OtherModel.OpenFileFolder(SelectedProcess);
 }
        private void Init()
        {
            ObservableCollection <LightModel>            lights        = new ObservableCollection <LightModel>();
            ObservableCollection <APortEntryModel>       ports         = new ObservableCollection <APortEntryModel>();
            ObservableCollection <SavedLightPresetModel> local_presets = new ObservableCollection <SavedLightPresetModel>();

            OtherModel init_other = new OtherModel
            {
                PortStatus = "PLACEHOLDER", //placeholder
                Mode       = "",            //placeholder ->init based on data recieved from Arduino
                CurrPort   = null,
                //Auto_Mode_Timer = new Timer(Auto_Mode_Timer_Tick, null, 2000, 300);
            };

            init_other.Auto_Mode_Timer  = new Timer(Auto_Mode_Timer_Tick, null, Timeout.Infinite, 250);
            init_other.Dispatcher_Timer = Dispatcher.CurrentDispatcher;


            if (SerialPort.GetPortNames().Length > 0)
            {
                init_other.PortStatus = "Status: Port(s) available";
            }
            else
            {
                init_other.PortStatus = "Status: No ports available";
            }

            //f*****g hell, this small assumption made me spend a whole day debugging
            //if you add same LightModel object to lights and point Lights to it, it is all the exact same forever
            LightModel InitLight0 = new LightModel {
                Light_text = "Luminosity Percentage: ", Light_val = 0
            };
            LightModel InitLight1 = new LightModel {
                Light_text = "Luminosity Percentage: ", Light_val = 0
            };
            LightModel InitLight2 = new LightModel {
                Light_text = "Luminosity Percentage: ", Light_val = 0
            };
            LightModel InitLight3 = new LightModel {
                Light_text = "Luminosity Percentage: ", Light_val = 0
            };

            //initializing is done in viewmodel
            lights.Add(InitLight0);
            lights.Add(InitLight1);
            lights.Add(InitLight2);
            lights.Add(InitLight3);

            var temp = PresetLoc.Db.Query <SavedLightPresetModel>("SELECT * FROM presets");

            foreach (SavedLightPresetModel aSet in temp)
            {
                local_presets.Add(aSet);
            }//copy list in database to "local" list ->is therea way to do this directly?
             //finish binding local list, work on listbox data

            Lights        = lights; //why make this distinction? AH, might be b/c it gives it an instance to start with
            other_stuff   = init_other;
            Ports         = ports;
            Local_Presets = local_presets;
        }
Esempio n. 19
0
 private void KillExecute(object obj)
 {
     OtherModel.Kill(SelectedProcess);
 }
 public void Resolve(OtherModel model)
 {
     this.ResultOpt = null;
 }
Esempio n. 21
0
 public void Resolve(OtherModel model)
 {
     model.IsExpanded = true;
 }
Esempio n. 22
0
 public void Resolve(OtherModel model)
 {
 }