Пример #1
0
        public static EstadoOperacion eliminarValoresTabla(string tabla,
            int Id)
        {
            string query = "delete from " + tabla + " where ID=" + Id.ToString();

            try
            {
                using (Switch contexto = new Switch())
                {
                    DbCommand Comando = contexto.CreateCommand(query, CommandType.Text);

                    using (contexto.CreateConeccionScope())
                    {
                        if (Comando.ExecuteNonQuery() != 1)
                        {
                            return new EstadoOperacion(false, null, null);
                        }
                        return new EstadoOperacion(true, null, null);
                    }
                }
            }
            catch (Exception e)
            {

                return new EstadoOperacion(false, e.Message, e);
            }
        }
        public static EstadoOperacion eliminarMensajeTransaccional(MENSAJE_TRANSACCIONAL MensajeTransaccional)
        {
            DbFactory Factoria = DataAccessFactory.ObtenerProveedor();
            try
            {
                using (Switch contexto = new Switch())
                {
                    using (contexto.CreateConeccionScope())
                    {
                        string query =
                            "DELETE FROM MENSAJE_TRANSACCIONAL" +
                            " WHERE MTR_CODIGO = @codigo";

                        DbCommand Comando = contexto.CreateCommand(query, CommandType.Text);
                        Comando.Parameters.Add(Factoria.CrearParametro("@codigo", MensajeTransaccional.MTR_CODIGO));

                        if (Comando.ExecuteNonQuery() != 1)
                        {
                            return new EstadoOperacion(false, null, null);
                        }

                        return new EstadoOperacion(true, null, null);
                    }
                }
            }
            catch (Exception e)
            {

                return new EstadoOperacion(false, e.Message, e);
            }
        }
Пример #3
0
        public static EstadoOperacion eliminarTabla(TABLA tabla)
        {
            DbFactory Factoria = DataAccessFactory.ObtenerProveedor();
            try
            {
                using (Switch contexto = new Switch())
                {
                    using (contexto.CreateConeccionScope())
                    {
                        string query = "EliminarTabla";

                        DbCommand Comando = contexto.CreateCommand(query, CommandType.StoredProcedure);
                        Comando.Parameters.Add(Factoria.CrearParametro("@codigo", tabla.TBL_CODIGO));

                        if (Comando.ExecuteNonQuery() != 1)
                        {
                            return new EstadoOperacion(false, null, null);
                        }

                        return new EstadoOperacion(true, null, null);
                    }
                }
            }
            catch (DbException dbex)
            {
                return new EstadoOperacion(false, dbex.Message, dbex);
            }
            catch (Exception e)
            {

                return new EstadoOperacion(false, e.Message, e);
            }
        }
        public static EstadoOperacion eliminarCriptografiaCampo(CRIPTOGRAFIA_CAMPO CriptografiaCampo)
        {
            try
            {
                DbFactory Factoria = DataAccessFactory.ObtenerProveedor();
                using (Switch contexto = new Switch())
                {
                    using (contexto.CreateConeccionScope())
                    {
                        string query =
                            "DELETE FROM CRIPTOGRAFIA_CAMPO" +
                            " WHERE CRC_CODIGO =@codigo;";

                        DbCommand Comando = contexto.CreateCommand(query, CommandType.Text);

                        Comando.Parameters.Add(Factoria.CrearParametro("@codigo", CriptografiaCampo.CRC_CODIGO));

                        if (Comando.ExecuteNonQuery() != 1)
                        {
                            return new EstadoOperacion(false, null, null);
                        }

                        return new EstadoOperacion(true, null, null);
                    }
                }
            }
            catch (Exception e)
            {
                return new EstadoOperacion(false, e.Message, e);
            }
        }
        public static EstadoOperacion eliminarTransformacion(TRANSFORMACION Transformacion)
        {
            try
            {
                using (Switch contexto = new Switch())
                {
                    using (contexto.CreateConeccionScope())
                    {
                        string query =
                                "DELETE FROM TRANSFORMACION" +
                                 " WHERE TRM_CODIGO = @codigo";

                        DbCommand Comando = contexto.CreateCommand(query, CommandType.Text);
                        Comando.Parameters.Add(Factoria.CrearParametro("@codigo", Transformacion.TRM_CODIGO));

                        if (Comando.ExecuteNonQuery() != 1)
                        {
                            return new EstadoOperacion(false, null, null);
                        }

                        return new EstadoOperacion(true, null, null);
                    }
                }
            }
            catch (Exception e)
            {

                return new EstadoOperacion(false, e.Message, e);
            }
        }
        public static EstadoOperacion eliminarTransformacionCampo(TRANSFORMACION_CAMPO transformacionCampo)
        {
            DbFactory Factoria = DataAccessFactory.ObtenerProveedor();
            try
            {
                using (Switch contexto = new Switch())
                {
                    using (contexto.CreateConeccionScope())
                    {
                        string query =
                                "DELETE FROM TRANSFORMACION_CAMPO" +
                                      " WHERE TRM_CODIGO=@transaccion_codigo" +
                                           " AND CAM_CODIGO_CAMPO_DESTINO=@campoDestino_codigo" +
                                           " AND MEN_CODIGO_MENSAJE_DESTINO=@mensajeDestino_codigo";

                        DbCommand Comando = contexto.CreateCommand(query, CommandType.Text);
                        Comando.Parameters.Add(Factoria.CrearParametro("@transformacion_codigo", transformacionCampo.TRM_CODIGO));
                        Comando.Parameters.Add(Factoria.CrearParametro("@campoDestino_codigo", transformacionCampo.CAM_CODIGO_CAMPO_DESTINO));
                        Comando.Parameters.Add(Factoria.CrearParametro("@mensajeDestino_codigo", transformacionCampo.MEN_CODIGO_MENSAJE_DESTINO));

                        if (Comando.ExecuteNonQuery() != 1)
                        {
                            return new EstadoOperacion(false, null, null);
                        }

                        return new EstadoOperacion(true, null, null);
                    }
                }
            }
            catch (Exception e)
            {

                return new EstadoOperacion(false, e.Message, e);
            }
        }
Пример #7
0
 public FormFuzzy()
 {
     InitializeComponent();
     comboBoxDelay.SelectedIndex = 0;
     mySwitch += MotionDown;
     mySwitch += MotionUp;
     gr = new Randare(pictureBox1.Width, pictureBox1.Height, 0, 100, 1, 25);
     pos1 = pictureBox1.Location;
     pos2 = pictureBox2.Location;
     size1 = pictureBox1.Size;
     size2 = pictureBox1.Size;
     try
     {
         A = new NumarFuzzy(Convert.ToInt32(textBoxCentruA.Text), Convert.ToInt32(textBoxAlfaA.Text), Convert.ToInt32(textBoxBetaA.Text), gr.Max);
         B = new NumarFuzzy(Convert.ToInt32(textBoxCentruB.Text), Convert.ToInt32(textBoxAlfaB.Text), Convert.ToInt32(textBoxBetaB.Text), gr.Max);
         alfa = Convert.ToDouble(textBoxAlfa.Text);
         if (alfa < 0 || alfa > 1)
             throw new Exception();
         pictureBox1.Refresh();
         pictureBox2.Refresh();
         ValidareButoane(true);
     }
     catch
     {
         MessageBox.Show("Date gresite !");
         A = null;
         B = null;
     }
 }
Пример #8
0
        public static EstadoOperacion insertarColumna(COLUMNA Columna)
        {
            try
            {
                using (Switch contexto = new Switch())
                {

                    using (contexto.CreateConeccionScope())
                    {
                        Columna.COL_CODIGO = 0;
                        string query = "InsertarColumna";

                        DbCommand Comando = crearComando(contexto, Columna, query);

                        if (Comando.ExecuteNonQuery() != 1)
                        {
                            return new EstadoOperacion(false, null, null);
                        }
                        return new EstadoOperacion(true, null, null);
                    }
                }
            }
            catch (DbException ex)
            {
                return new EstadoOperacion(false, ex.Message, ex, false);
            }
            catch (Exception e)
            {

                return new EstadoOperacion(false, e.Message, e);
            }
        }
Пример #9
0
        public static void SetPeripheralState(Peripheral device, Switch state)
        {
            portState = state == Switch.On ? true : false;

            switch (device) {
                case Peripheral.Ethernet:
                    if (peripheralPorts[0] == null)
                        peripheralPorts[0] = new OutputPort((Cpu.Pin)Peripheral.Ethernet, !portState);
                    else
                        peripheralPorts[0].Write(!portState);
                    break;
                case Peripheral.PowerLED:
                    if (peripheralPorts[1] == null)
                        peripheralPorts[1] = new OutputPort((Cpu.Pin)Peripheral.PowerLED, portState);
                    else
                        peripheralPorts[1].Write(portState);
                    break;
                case Peripheral.SDCard:
                    if (peripheralPorts[2] == null)
                        peripheralPorts[2] = new OutputPort((Cpu.Pin)Peripheral.SDCard, portState);
                    else
                        peripheralPorts[2].Write(portState);
                    break;
                case Peripheral.PowerHeaders:
                    if (peripheralPorts[3] == null)
                        peripheralPorts[3] = new OutputPort((Cpu.Pin)Peripheral.PowerHeaders, portState);
                    else
                        peripheralPorts[3].Write(portState);
                    break;
                default:
                    throw new ArgumentOutOfRangeException("device");
            }
        }
        public static EstadoOperacion eliminarValidacionCampo(VALIDACION_CAMPO vcampo)
        {
            DbFactory Factoria = DataAccessFactory.ObtenerProveedor();
            try
            {
                using (Switch contexto = new Switch())
                {
                    using (contexto.CreateConeccionScope())
                    {
                        string query = "DELETE FROM [VALIDACON_CAMPO] " +
                                       "WHERE [VLC_CODIGO] = @codigo";

                        DbCommand Comando = contexto.CreateCommand(query, CommandType.Text);
                        Comando.Parameters.Add(Factoria.CrearParametro("@codigo", vcampo.VLC_CODIGO));

                        if (Comando.ExecuteNonQuery() != 1)
                        {
                            return new EstadoOperacion(false, null, null);
                        }

                        return new EstadoOperacion(true, null, null);
                    }
                }
            }
            catch (Exception e)
            {
                return new EstadoOperacion(false, e.Message, e);
            }
        }
Пример #11
0
		protected override void Init ()
		{
			var layout = new StackLayout ();
			var button = new Button { Text = "Click" };
			var tablesection = new TableSection { Title = "Switches" };
			var tableview = new TableView { Intent = TableIntent.Form, Root = new TableRoot { tablesection } };
			var viewcell1 = new ViewCell {
				View = new StackLayout {
					HorizontalOptions = LayoutOptions.FillAndExpand,
					Orientation = StackOrientation.Horizontal,
					Children = {
						new Label { Text = "Switch 1", HorizontalOptions = LayoutOptions.StartAndExpand },
						new Switch { AutomationId = "switch1", HorizontalOptions = LayoutOptions.End, IsToggled = true }
					}
				}
			};
			var viewcell2 = new ViewCell {
				View = new StackLayout {
					HorizontalOptions = LayoutOptions.FillAndExpand,
					Orientation = StackOrientation.Horizontal,
					Children = {
						new Label { Text = "Switch 2", HorizontalOptions = LayoutOptions.StartAndExpand },
						new Switch { AutomationId = "switch2", HorizontalOptions = LayoutOptions.End, IsToggled = true }
					}
				}
			};
			Label label = new Label { Text = "Switch 3", HorizontalOptions = LayoutOptions.StartAndExpand };
			Switch switchie = new Switch { AutomationId = "switch3", HorizontalOptions = LayoutOptions.End, IsToggled = true, IsEnabled = false };
			switchie.Toggled += (sender, e) => {
				label.Text = "FAIL";
			};
			var viewcell3 = new ViewCell {
				View = new StackLayout {
					HorizontalOptions = LayoutOptions.FillAndExpand,
					Orientation = StackOrientation.Horizontal,
					Children = {
						label,
						switchie,
					}
				}
			};

			tablesection.Add (viewcell1);
			tablesection.Add (viewcell2);
			tablesection.Add (viewcell3);

			button.Clicked += (sender, e) => {
				if (_removed)
					tablesection.Insert (1, viewcell2);
				else
					tablesection.Remove (viewcell2);

				_removed = !_removed;
			};

			layout.Children.Add (button);
			layout.Children.Add (tableview);

			Content = layout;
		}
 public static List<REGLA_MENSAJE_TRANSACCIONAL> obtenerMensajeTransaccional()
 {
     using (Switch contexto = new Switch())
     {
         contexto.REGLA_MENSAJE_TRANSACCIONAL.MergeOption = MergeOption.NoTracking;
         return contexto.REGLA_MENSAJE_TRANSACCIONAL.ToList<REGLA_MENSAJE_TRANSACCIONAL>();
     }
 }
Пример #13
0
 public StagedDeployTarget(string name, Parameter<string> stage)
 {
     Name = name;
     Stage = stage;
     Switch = new Switch<string>(stage);
     PrepareDeploy = package => package;
     InvokeRemoteDeploy = package => package;
     Deploy = package => package;
 }
Пример #14
0
        private static Level CreateLevel0()
        {
            Level lvl = new Level();

            lvl.Gravity = 9.80f;
            lvl.InitialPosition = new Vector2(0, -500);

            lvl.AssetName = "Level0";
            lvl.LevelIdentifier = 0;

            lvl.Tiles.Add(new Tile(new Rectangle(778, 0, 186, 281), Surface.Absorbs));
            lvl.Tiles.Add(new Tile(new Rectangle(964, 0, 420, 195), Surface.Normal));

            lvl.Tiles.Add(new Tile(new Rectangle(0, 473, 301, 151), Surface.Absorbs));
            lvl.Tiles.Add(new Tile(new Rectangle(301, 473, 411, 151), Surface.Normal));
            lvl.Tiles.Add(new Tile(new Rectangle(711, 473, 569, 151), Surface.Amplifies));

            lvl.Tiles.Add(new Tile(new Rectangle(0, 1500 - 364, 216, 364), Surface.Absorbs));
            lvl.Tiles.Add(new Tile(new Rectangle(216, 1500 - 364, 240, 364), Surface.Normal));
            lvl.Tiles.Add(new Tile(new Rectangle(456, 1500 - 364, 216, 364), Surface.Absorbs));
            lvl.Tiles.Add(new Tile(new Rectangle(672, 1500 - 364, 159, 364), Surface.Normal));
            lvl.Tiles.Add(new Tile(new Rectangle(0, 966, 216, 170), Surface.Normal));
            lvl.Tiles.Add(new Tile(new Rectangle(456, 966, 215, 170), Surface.Normal));

            lvl.Tiles.Add(new Tile(new Rectangle(936, 1500 - 421, 485, 421), Surface.Reflects));

            lvl.Tiles.Add(new Tile(new Rectangle(1718, 915, 282, 585), Surface.Absorbs));

            lvl.Checkpoints.Add(new Checkpoint(270, 1136 - 134, 0, 0, 4));
            lvl.Checkpoints.Add(new Checkpoint(680, 1136 - 134, 680, 1024, 1));
            lvl.Checkpoints.Add(new Checkpoint(1180, 1079 - 134, 1180, 1500, 1));
            lvl.Checkpoints.Add(new Checkpoint(1165, 473 - 134, 1275, 473, 2));
            lvl.Checkpoints.Add(new Checkpoint(75, 473 - 134, 100, 473, 2));

            Switch switch1 = new Switch(System.Guid.NewGuid(), new Vector2(1980, 815), Switch.SwitchState.Active);
            switch1.Actions.Add(new KeyValuePair<Guid, int>(Character.CharacterGuid, (int)Switch.SwitchState.Pressed));
            lvl.Obstacles.Add(switch1);

            Platform pf1 = new Platform(System.Guid.NewGuid(), new List<Vector2>() { new Vector2(1435, 1078), new Vector2(1607, 1078), new Vector2(1607, 473), new Vector2(1286, 473) }, 50, Platform.PlatformState.Forward);
            pf1.Actions.Add(new KeyValuePair<Guid, int>(switch1.Guid, (int)Platform.PlatformState.Startionary));
            lvl.Obstacles.Add(pf1);

            Door d1 = new Door(System.Guid.NewGuid(), new Vector2(778, 282), Door.DoorState.Stationary);
            d1.Actions.Add(new KeyValuePair<Guid, int>(switch1.Guid, (int)Door.DoorState.Opening));
            lvl.Obstacles.Add(d1);

            Enemy e1 = new Enemy(new Vector2(370, 472), 300);
            lvl.Actors.Add(e1);

            //Boundaries
            lvl.Tiles.Add(new Tile(new Rectangle(0, 1500 - 2, 2000, 2), Surface.Death));
            lvl.Tiles.Add(new Tile(new Rectangle(0, 0, 1500, 2), Surface.Absorbs));
            lvl.Tiles.Add(new Tile(new Rectangle(0, 0, 2, 2000), Surface.Absorbs));
            lvl.Tiles.Add(new Tile(new Rectangle(2000 - 2, 0, 2, 1500), Surface.Absorbs));

            return lvl;
        }
        public static EstadoOperacion insertarParametroTransformacionCampo(PARAMETRO_TRANSFORMACION_CAMPO parametroTransformacionCampo)
        {
            try
            {
                using (Switch contexto = new Switch())
                {

                    using (contexto.CreateConeccionScope())
                    {
                        parametroTransformacionCampo.PTC_CODIGO = (from c in contexto.PARAMETRO_TRANSFORMACION_CAMPO
                                                                   orderby c.PTC_CODIGO descending
                                                                   select c.PTC_CODIGO).FirstOrDefault() + 1;

                        string query =
                            "INSERT INTO PARAMETRO_TRANSFORMACION_CAMPO" +
                                       "(PTC_CODIGO" +
                                       ",TRM_CODIGO" +
                                       ",CAM_CODIGO_CAMPO_DESTINO" +
                                       ",MEN_CODIGO_MENSAJE_DESTINO" +
                                       ",CAM_CODIGO_CAMPO_ORIGEN" +
                                       ",MEN_CODIGO_MENSAJE_ORIGEN" +
                                       ",PTC_POSICION_INICIAL" +
                                       ",PTC_LONGITUD" +
                                       ",TBL_CODIGO" +
                                       ",COL_CODIGO_ORIGEN" +
                                       ",COL_CODIGO_DESTINO" +
                                       ",PTC_TIPO)" +
                                 "VALUES" +
                                       "(@codigo" +
                                       ",@transformacion_codigo" +
                                       ",@campoDestino_codigo" +
                                       ",@mensajeDestino_codigo" +
                                       ",@campoOrigen_codigo" +
                                       ",@mensajeOrigen_codigo" +
                                       ",@posicionInicial" +
                                       ",@longitud" +
                                       ",@tabla" +
                                       ",@columnaOrigen_codigo" +
                                       ",@columnaDestino_codigo" +
                                       ",@tipoParametroTransformacionCampo_codigo)";

                        DbCommand Comando = crearComando(contexto, parametroTransformacionCampo, query);

                        if (Comando.ExecuteNonQuery() != 1)
                        {
                            return new EstadoOperacion(false, null, null);
                        }
                        return new EstadoOperacion(true, null, null);
                    }
                }
            }
            catch (Exception e)
            {

                return new EstadoOperacion(false, e.Message, e);
            }
        }
 public static List<REGLA_MENSAJE_TRANSACCIONAL> obtenerReglaMensajeTransaccionalPorMensajeTransaccional(int codigoMensajeTransaccional)
 {
     using (Switch contexto = new Switch())
     {
         contexto.REGLA_MENSAJE_TRANSACCIONAL.MergeOption = MergeOption.NoTracking;
         return contexto.REGLA_MENSAJE_TRANSACCIONAL.Include("CAMPO").Include("CAMPO.TIPO_DATO")
             .Where(o => o.MENSAJE_TRANSACCIONAL.MTR_CODIGO == codigoMensajeTransaccional).ToList<REGLA_MENSAJE_TRANSACCIONAL>();
     }
 }
 public static REGLA_MENSAJE_TRANSACCIONAL obtenerMensajeTransaccional(int codigoReglaMensajeTransaccional)
 {
     using (Switch contexto = new Switch())
     {
         contexto.REGLA_MENSAJE_TRANSACCIONAL.MergeOption = MergeOption.NoTracking;
         return contexto.REGLA_MENSAJE_TRANSACCIONAL
             .Where(o => o.RMT_CODIGO == codigoReglaMensajeTransaccional).FirstOrDefault<REGLA_MENSAJE_TRANSACCIONAL>();
     }
 }
 public static PASO_DINAMICA obtenerPasoDinamica(int codigoPasoDinamica)
 {
     using (Switch contexto = new Switch())
     {
         contexto.PARAMETRO_TRANSFORMACION_CAMPO.MergeOption = MergeOption.NoTracking;
         return (from p in contexto.PASO_DINAMICA
                 where p.PDT_CODIGO == codigoPasoDinamica
                 select p).FirstOrDefault();
     }
 }
        public static EstadoOperacion insertarTransformacionCampo(TRANSFORMACION_CAMPO transformacionCampo)
        {
            DbFactory Factoria = DataAccessFactory.ObtenerProveedor();
            try
            {
                using (Switch contexto = new Switch())
                {

                    using (contexto.CreateConeccionScope())
                    {

                        string query =
                            "INSERT INTO TRANSFORMACION_CAMPO" +
                                       "(TRM_CODIGO" +
                                       ",CAM_CODIGO_CAMPO_DESTINO" +
                                       ",MEN_CODIGO_MENSAJE_DESTINO" +
                                       ",TCM_COMPONENTE" +
                                       ",TCM_CLASE" +
                                       ",TCM_METODO" +
                                       ",TCM_TIPO" +
                                       ",TCM_PROCEDIMIENTO" +
                                       ",TCM_VALOR_CONSTANTE" +
                                       ",TCM_FUNCIONALIDAD_ESTANDAR)" +
                                 "VALUES" +
                                       "(@transformacion_codigo" +
                                       ",@campoDestino_codigo" +
                                       ",@mensajeDestino_codigo" +
                                       ",@componente" +
                                       ",@clase" +
                                       ",@metodo" +
                                       ",@tipoTransformacion_codigo" +
                                       ",@procedimiento" +
                                       ",@valorConstante" +
                                       ",@funcionalidadEstandar_codigo)";

                        DbCommand Comando = crearComando(contexto, transformacionCampo, query);

                        Comando.Parameters.Add(Factoria.CrearParametro("@tieneParametros", 0));

                        if (Comando.ExecuteNonQuery() != 1)
                        {
                            return new EstadoOperacion(false, null, null);
                        }
                        return new EstadoOperacion(true, null, null);
                    }
                }
            }
            catch (Exception e)
            {

                return new EstadoOperacion(false, e.Message, e);
            }
        }
        public SwitchPropertiesWindow(Switch mswitch, DesignerItem item, Level level)
            : base()
        {
            InitializeComponent();
            item.PropertyWindow = this;
            DataContext = new SwitchModel(mswitch, item, level);

            foreach(Obstacle target in level.Obstacles.Where(o => o.Actions.Any(pair => pair.Key == mswitch.Guid)))
                mTriggers.Children.Add(new ActionControl(mTriggers, mswitch, level, target));

            UpdatePossibleActions();
        }
Пример #21
0
 public static bool ExisteValorTabla(string tabla, string columnaOrigen, string cadenaBuscar)
 {
     using (Switch contexto = new Switch())
     {
         using (DbCommand Comando = contexto.CreateCommand("Select count(*) from " + tabla + " where " + columnaOrigen + "='" + cadenaBuscar + "'",
         CommandType.Text))
         {
             Comando.Connection.Open();
             int cantidad = (int)Comando.ExecuteScalar();
             return cantidad>0?true:false;
         }
     }
 }
Пример #22
0
        private void Initialize ()
        {
            this.LayoutParameters = new LayoutParams (LayoutParams.FillParent, 75);
            this.switchCheck = new Switch (this.Context);
            this.AddView (this.switchCheck);

            this.textField = new EditText (this.Context) 
            { 
                Enabled = false,
                LayoutParameters = new LayoutParams(LayoutParams.FillParent, LayoutParams.FillParent)
            };

            this.AddView (this.textField);
        }
 private async Task OnSubmitClick(TextView dateText, TextView customerText, TextView projectText, Spinner hoursInput, EditText commentInput, Switch sickLeaveInput)
 {
     var timesheet = BindTimesheetEntry(dateText, customerText, projectText, hoursInput, commentInput, sickLeaveInput);
     var progress = CreateProgressDialog();
     progress.Show();
     try
     {
         await TimesheetService.SubmitTimesheetEntry(timesheet);
         Finish();
     }
     catch
     {
         CreateExceptionDialog();
     }
     progress.Hide();
 }
Пример #24
0
        public Settings(Text title, Switch[] switches, Drawable background, SpriteFont font)
            : base(background)
        {
            this.switches = switches;
            for (int i = 0; i < switches.Length; i++)
            {
                base.Add(this.switches[i]);
            }

            this.title = title;
            base.Add(this.title);

            exit = new Button("Back", font, new Vector2(512, 725), Color.Black);
            exit.height = 58;
            base.Add(exit);
        }
Пример #25
0
		// Use this for initialization
		#region methods
		void Start () {


			// Get the switch

			// Get the switch component
			_switch = this.gameObject.GetComponent<Switch> ();


			// If a switch doesn't exist, add the component but send an error message
			if (_switch == null) {
				Debug.LogError ("Could not find a switch on the " + this.gameObject.name + " game screen. Adding a switch but this could cause issues, please attach the switch component to it in your scene.");
				_switch = this.gameObject.AddComponent<Switch>();
			}

		}
Пример #26
0
        public static object EjecutarProcedure(string procedure, string parametro)
        {
            using (Switch contexto = new Switch())
            {
                using (SqlCommand Comando = (SqlCommand)contexto.CreateCommand(procedure, CommandType.StoredProcedure))
                {
                    Comando.Parameters.Add("@input", SqlDbType.VarChar, 500).Value = parametro;
                    Comando.Parameters.Add("@output", SqlDbType.VarChar, 500).Direction = ParameterDirection.Output;

                    using (contexto.CreateConeccionScope())
                    {
                        Comando.ExecuteNonQuery();
                        return Comando.Parameters["@output"].Value;
                    }
                }
            }
        }
        public static EstadoOperacion eliminarDinamicaCriptografia(DINAMICA_CRIPTOGRAFIA DinamicaCriptografia)
        {
            DbFactory Factoria = DataAccessFactory.ObtenerProveedor();
            try
            {
                using (Switch contexto = new Switch())
                {
                    using (contexto.CreateConeccionScope())
                    {
                        string query =
                                "DELETE FROM DINAMICA_CRIPTOGRAFIA" +
                                 " WHERE DNC_CODIGO = @codigo";

                        DbCommand Comando = contexto.CreateCommand(query, CommandType.Text);
                        Comando.Parameters.Add(Factoria.CrearParametro("@codigo", DinamicaCriptografia.DNC_CODIGO));

                        if (Comando.ExecuteNonQuery() != 1)
                        {
                            return new EstadoOperacion(false, null, null);
                        }

                        return new EstadoOperacion(true, null, null);
                    }
                }
            }
            catch (DbException e)
            {
                DbExceptionProduct exception = Factoria.CrearException(e);
                if (exception.ForeignKeyError())
                {
                    return new EstadoOperacion(false, "La Dinamica Criptografia tiene Campos Criptografía y no se puede eliminar", e, true);
                }
                else
                {
                    return new EstadoOperacion(false, e.Message, e);
                }
            }
            catch (Exception e)
            {

                return new EstadoOperacion(false, e.Message, e);
            }
        }
Пример #28
0
        public static EstadoOperacion eliminarMensaje(MENSAJE Mensaje)
        {
            DbFactory Factoria = DataAccessFactory.ObtenerProveedor();
            try
            {
                using (Switch contexto = new Switch())
                {
                    using (contexto.CreateConeccionScope())
                    {
                        string query =
                            "DELETE FROM MENSAJE" +
                            " WHERE MEN_CODIGO = @codigo";

                        DbCommand Comando = contexto.CreateCommand(query, CommandType.Text);
                        Comando.Parameters.Add(Factoria.CrearParametro("@codigo", Mensaje.MEN_CODIGO));

                        if (Comando.ExecuteNonQuery() != 1)
                        {
                            return new EstadoOperacion(false, null, null);
                        }

                        return new EstadoOperacion(true, null, null);
                    }
                }
            }
            catch (DbException e)
            {
                DbExceptionProduct exception = Factoria.CrearException(e);
                if (exception.ForeignKeyError())
                {
                    return new EstadoOperacion(false, "El Mensaje esta siendo utilizado por la aplicación y no se puede eliminar", e, true);
                }
                else
                {
                    return new EstadoOperacion(false, e.Message, e);
                }
            }
            catch (Exception e)
            {

                return new EstadoOperacion(false, e.Message, e);
            }
        }
Пример #29
0
			public SwitchDemoPage()
			{
				Label header = new Label
				{
					Text = "Switch",
#pragma warning disable 618
					Font = Font.BoldSystemFontOfSize(50),
#pragma warning restore 618
					HorizontalOptions = LayoutOptions.Center
				};

				Switch switcher = new Switch
				{
					HorizontalOptions = LayoutOptions.Center,
					VerticalOptions = LayoutOptions.CenterAndExpand
				};
				switcher.Toggled += switcher_Toggled;

				_label = new Label
				{
					Text = "Switch is now False",
#pragma warning disable 618
					Font = Font.SystemFontOfSize(NamedSize.Large),
#pragma warning restore 618
					HorizontalOptions = LayoutOptions.Center,
					VerticalOptions = LayoutOptions.CenterAndExpand
				};

				// Accomodate iPhone status bar.
				Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5);

				// Build the page.
				Content = new StackLayout
				{
					Children =
					{
						header,
						switcher,
						_label
					}
				};
			}
        public static EstadoOperacion eliminarCampoPlantilla(CAMPO_PLANTILLA CampoPlantilla)
        {
            DbFactory Factoria = DataAccessFactory.ObtenerProveedor();
            try
            {
                using (Switch contexto = new Switch())
                {
                    using (contexto.CreateConeccionScope())
                    {
                        string query =
                            "DELETE FROM [CAMPO_PLANTILLA]" +
                            " WHERE [CMP_CODIGO] = @codigo";

                        DbCommand Comando = contexto.CreateCommand(query, CommandType.Text);
                        Comando.Parameters.Add(Factoria.CrearParametro("@codigo", CampoPlantilla.CMP_CODIGO));

                        if (Comando.ExecuteNonQuery() != 1)
                        {
                            return new EstadoOperacion(false, null, null);
                        }

                        return new EstadoOperacion(true, null, null);
                    }
                }
            }
            catch (DbException e)
            {
                DbExceptionProduct exception = Factoria.CrearException(e);
                if (exception.ForeignKeyError())
                {
                    return new EstadoOperacion(false, "El Campo Plantilla corresponde a un campo en el sistema y no se puede eliminar", e, true);
                }
                else
                {
                    return new EstadoOperacion(false, e.Message, e);
                }
            }
            catch (Exception e)
            {
                return new EstadoOperacion(false, e.Message, e);
            }
        }