コード例 #1
0
        public string Registrar(Ente_salud objEnte)
        {
            ORMDataContext BD = new ORMDataContext();

            try
            {
                BD.Ente_salud.InsertOnSubmit(objEnte);
                BD.SubmitChanges();
                return("Registro exitoso");
            }
            catch (Exception ex)
            {
                return("Error registro: " + ex.Message);
            }
        }
コード例 #2
0
        protected void btnRegistrarEnte_Click(object sender, EventArgs e)
        {
            string       mensaje    = string.Empty;
            ClsEnteSalud clsEnte    = new ClsEnteSalud();
            Ente_salud   ente_Salud = new Ente_salud();
            ClsPersona   clsPersona = new ClsPersona();
            Persona      persona    = new Persona();

            //ente_Salud.id_persona = int.Parse(Session["idPersona"].ToString());
            ente_Salud.nit                 = int.Parse(TextNit.Text);
            ente_Salud.razon_social        = TextRazonS.Text;
            ente_Salud.representante       = TextRepresentante.Text;
            ente_Salud.correo              = TextCorreo.Text;
            ente_Salud.telefono            = TextTelefono.Text;
            ente_Salud.sitio_web           = textSitioW.Text;
            ente_Salud.id_ciudad           = int.Parse(DropDownList.SelectedValue.ToString());
            ente_Salud.capacidad_pacientes = int.Parse(TextCapacidad.Text);
            mensaje = clsEnte.Registrar(ente_Salud);
            Page.RegisterStartupScript("script", "<script languaje=JavaScript>alert('" + mensaje + "');location.href='agregarEnte.aspx';</script>");
        }