Exemple #1
0
        public bool InsertarAlmacen(tblAlmacen _TBL_Alm)
        {
            bool respuesta = false;

            try
            {
                contexto.tblAlmacen.InsertOnSubmit(_TBL_Alm);
                contexto.SubmitChanges();
                respuesta = true;
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(ex.ToString());
                respuesta = false;
            }
            return(respuesta);
        }
Exemple #2
0
        protected void btnaceptar_Click(object sender, EventArgs e)
        {
            var encargado = ddlEncargado.SelectedItem.Value;

            tblAlmacen alm = new tblAlmacen();

            alm.strNombre      = txtNombre.Text.ToUpper();
            alm.strDescripcion = txtDescrip.Text.ToUpper();
            alm.intCapacidad   = Int32.Parse(txtCapacidad.Text);
            alm.fkEncargado    = Int32.Parse(encargado);
            alm.idActivo       = 1;

            ControllerAlmacen ctrlAlm = new ControllerAlmacen();

            ctrlAlm.InsertarAlmacen(alm);
            this.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "exito()", true);
            this.LimpiarCampos();
        }