protected void btnDelete_Click(object sender, EventArgs e) { Person person = new Person(); if (person.DeletePerson(txtCedula.Text) == 1) msg.Text = person.Message; else msg.Text = person.Message; }
public ExampleTaskbarNotifier() { Person actualCall = new Person(); int ide = 9; bool a = personManager.Delete(ide); String name = actualCall.Firstname + " " + actualCall.Surname; //Thread t = new Thread(getPerson); //t.Start(); InitializeComponent(); this.Show(); this.NotifyContent.Add(new NotifyObject("Details", name ,actualCall.TelephoneNumber)); this.Notify(); //Thread.Sleep(3000); }
protected void btnUpdate_Click(object sender, EventArgs e) { Person person = new Person(); person.document = txtCedula.Text; person.name = txtNombre.Text; person.lastName = txtApellido.Text; person.gender = txtGenero.Text; person.city = txtCiudad.Text; person.address = txtDireccion.Text; person.phone = txtTelefono.Text; if (person.NewPerson(person) == 1) msg.Text = person.Message; else msg.Text = person.Message; }
public int NewPerson(Person person) { string[] parameters = { "@operacion", "@cedula", "@nombres", "@apellidos", "@genero", "@ciudad", "@direccion", "@telefono"}; if (!mc.OpenConnection()) { mc.CloseConnection(); message = mc.Error; return 0; } else { if (mc.ExecuteProcedures("spPersonIA", parameters, "I", person.document, person.name, person.lastName, person.gender, person.city, person.address, person.phone) > 0) message = "Registro ingresado correctamente"; mc.CloseConnection(); return 1; } }
protected void btnSelect_Click(object sender, EventArgs e) { Person person = new Person(); if ((person = person.GetPerson(txtCedula.Text)) != null) { txtCedula.Text = person.document; txtNombre.Text = person.name; txtApellido.Text = person.lastName; txtGenero.Text = person.gender; txtCiudad.Text = person.city; txtDireccion.Text = person.address; txtTelefono.Text = person.phone; /*ClientScript.RegisterClientScriptBlock(this.GetType(), "registro", "<script>alert('registro encontrado')</script>");*/ msg.Text = person.Message; } else { msg.Text = person.Message; /*ClientScript.RegisterClientScriptBlock(this.GetType(), "registro", "<script>alert('registro no encontrado')</script>");*/ } }
protected void Page_Load(object sender, EventArgs e) { Person person = new Person(); gdPersonas.DataSource = person.PeopleList(); gdPersonas.DataBind(); }
public List <Attendance> GetOnesAttendances(Person p) { return(p.GetAttendances()); }
public void EditPerson(Person oldp, Person newp) { allpeople.Remove(GetPerson(oldp.PCN)); AddPerson(newp); }
public Person GetPerson(string document) { DataTable dt = new DataTable(); Person person = new Person(); string[] parameters = { "@operacion", "@cedula" }; dt = mc.GetData("spPersonSE", parameters, "S", document); foreach (DataRow fila in dt.Rows) { person.document = fila["cedula"].ToString(); person.name = fila["nombres"].ToString(); person.lastName = fila["apellidos"].ToString(); person.gender = fila["genero"].ToString(); person.city = fila["ciudad"].ToString(); person.address = fila["direccion"].ToString(); person.phone = fila["telefono"].ToString(); message = "Registros encontrados"; } return person; }