public ActionResult View(int DeviceId)
        {
            this._provider = new GsmConfigurationService(DomainSession.GetAlarmConfigForContextWithDeviceId(this.HttpContext, DeviceId));
            AlarmSystemGsmConfigModel model = new AlarmSystemGsmConfigModel(this._provider.GetAll());

            return(View(model));
        }
        public ActionResult Edit(int Id)
        {
            AlarmSystemGsmAddRcptModel model = new AlarmSystemGsmAddRcptModel();

            this._provider = new GsmConfigurationService(DomainSession.GetAlarmConfigForContextSession(this.HttpContext));
            model.GsmRcpt  = _provider.GetById(Id);
            return(View(model));
        }
Beispiel #3
0
 public AlarmGsmConfigViewModel(IAlarmConfigManager manager, IRegionManager regionManager)
 {
     Config              = new ObservableCollection <sconnGsmRcpt>();
     this._manager       = (AlarmSystemConfigManager)manager;
     this._provider      = new GsmConfigurationService(_manager);
     this._regionManager = regionManager;
     GetData();
 }
        public ActionResult Remove(int Id)
        {
            this._provider = new GsmConfigurationService(DomainSession.GetAlarmConfigForContextSession(this.HttpContext));
            AlarmSystemGsmConfigModel model = new AlarmSystemGsmConfigModel(_provider.GetAll());
            bool remRes = _provider.RemoveById(Id);

            model.Result = StatusResponseGenerator.GetStatusResponseResultForReturnParam(remRes);
            return(View(model));
        }
        public ActionResult Remove(sconnGsmRcpt Rcpt)
        {
            AlarmSystemGsmAddRcptModel model = new AlarmSystemGsmAddRcptModel();

            this._provider = new GsmConfigurationService(DomainSession.GetAlarmConfigForContextSession(this.HttpContext));
            var remRes = this._provider.Remove(Rcpt);

            model.Result = StatusResponseGenerator.GetStatusResponseResultForReturnParam(remRes);
            return(View(model));
        }
        public ActionResult Search(string key)
        {
            this._provider = new GsmConfigurationService(DomainSession.GetAlarmConfigForContextSession(this.HttpContext));
            AlarmSystemGsmConfigModel model = new AlarmSystemGsmConfigModel(_provider.GetAll());

            if (!String.IsNullOrEmpty(key))
            {
                model.GsmRcpts = model.GsmRcpts.Where(d => d.NumberE164.Contains(key) || d.Name.Contains(key)).ToList();
            }
            return(View(model));
        }
 public async Task <ActionResult> Edit(AlarmSystemGsmAddRcptModel model)
 {
     try
     {
         this._provider = new GsmConfigurationService(DomainSession.GetAlarmConfigForContextSession(this.HttpContext));
         if (ModelState.IsValid)
         {
             var res = (_provider.Update(model.GsmRcpt));
             model.Result = StatusResponseGenerator.GetStatusResponseResultForReturnParam(res);
         }
     }
     catch (Exception e)
     {
         model.Result = StatusResponseGenerator.GetRequestResponseCriticalError();
     }
     return(View(model));
 }
        public static IAlarmSystemConfigurationService <T> GetAlarmService <T>()
        {
            AlarmSystemConfigManager man = FakeAlarmServiceFactory.GetAlarmConfigManager();

            man.RemoteDevice = GetFakeAlarmDevice();

            IAlarmSystemConfigurationService <T> service;
            var type = typeof(T);

            if (typeof(T) == typeof(sconnAlarmZone))
            {
                service = new ZoneConfigurationService(man) as IAlarmSystemConfigurationService <T>;
            }
            else if (typeof(T) == typeof(sconnUser))
            {
                service = new UsersConfigurationService(man) as IAlarmSystemConfigurationService <T>;
            }
            else if (typeof(T) == typeof(sconnGsmRcpt))
            {
                service = new GsmConfigurationService(man) as IAlarmSystemConfigurationService <T>;
            }
            else if (typeof(T) == typeof(sconnAuthorizedDevice))
            {
                service = new AuthorizedDevicesConfigurationService(man) as IAlarmSystemConfigurationService <T>;
            }
            else
            {
                service = null;
            }
            if (service != null)
            {
                service.Online = false; //Disable online config sync for testing
            }

            return(service);
        }
Beispiel #9
0
 public AlarmGsmConfigViewModel()
 {
     _name          = "Gsm";
     this._provider = new GsmConfigurationService(_manager);
 }