private void getcorreo() { DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("id_correo")); dt.Columns.Add(new DataColumn("correo")); DataColumn col = new DataColumn("check"); col.DataType = System.Type.GetType("System.Boolean"); dt.Columns.Add(col); List <Correo> lcorreo = new CorreoBC().getcorreos(Convert.ToInt32(rut)); foreach (Correo mcorreo in lcorreo) { DataRow dr = dt.NewRow(); dr["id_correo"] = mcorreo.Id_correo; dr["correo"] = mcorreo.Correo1; dr["check"] = mcorreo.Check; dt.Rows.Add(dr); } this.gr_dato.DataSource = dt; this.gr_dato.DataBind(); }
protected void GuardarForm() { string output = new CorreoBC().add_correos(this.Rut, this.txt_correo.Text.Trim(), Convert.ToInt32(this.hdn_id_correo.Value)); if (output != "") { ScriptManager.RegisterStartupScript(this.up_control, this.up_control.GetType(), "ErrorPersona", "alert('Ha ocurrido un error al guardar los datos del correo:\\n\\n" + output + "');", true); return; } this.Guardar_Correo(new EventArgs()); }
protected void chk_prioridad_CheckedChanged(object sender, EventArgs e) { int index = ((GridViewRow)((CheckBox)sender).Parent.Parent).RowIndex; for (int i = 0; i < this.gr_datos.Rows.Count; i++) { int id_correo = Convert.ToInt32(this.gr_datos.DataKeys[i].Values[0]); CheckBox chk = (CheckBox)this.gr_datos.Rows[i].FindControl("chk_prioridad"); chk.Checked = (index == i) ? true : false; chk.Enabled = (index == i) ? false : true; string output = new CorreoBC().actu_checkCorreo(id_correo, chk.Checked.ToString()); } this.Cambiar_Correo(new EventArgs()); }
protected void Button1_Click(object sender, EventArgs e) { if (this.txt_correo.Text == "") { FuncionGlobal.alerta("INGRESE LOS DATOS CORRESPONDIENTES", Page); return; } string add = new CorreoBC().add_correos(rut, this.txt_correo.Text, 0); FuncionGlobal.alerta("CORREO INGRESADA CON EXITO", Page); this.txt_correo.Text = ""; getcorreo(); }
public void actualizar() { GridViewRow row; for (int i = 0; i < gr_dato.Rows.Count; i++) { row = gr_dato.Rows[i]; CheckBox chk = (CheckBox)gr_dato.Rows[i].FindControl("chk"); string id_correo = this.gr_dato.Rows[i].Cells[0].Text; string add = new CorreoBC().actu_checkCorreo(Convert.ToInt32(id_correo), chk.Checked.ToString()); FuncionGlobal.alerta("PRIORIDAD ACTUALIZADA CON EXITO", Page); } getcorreo(); }
protected void bt_guardar_Click(object sender, EventArgs e) { UpdatePanel up = (UpdatePanel)this.Master.FindControl("UpdatePanel1"); if (tipo_operacion == "CVT" || tipo_operacion == "CCV") { Correo mcorreo = new CorreoBC().getCorreoPorDefecto(Convert.ToInt32(this.Datoscomprador.getRut().ToString())); if (mcorreo == null) { FuncionGlobal.alerta_updatepanel( "Vendedor: En esta venta debe ingresar el correo del Comprador, o ingresar su correo Personal", Page, up); return; } } if (!this.chk_leasing.Checked) { if (this.txt_patente.Text.Trim() == "") { FuncionGlobal.alerta_updatepanel("Debe ingresar la patente", Page, up); return; } } if (this.dl_sucursal_origen.SelectedValue == "0") { FuncionGlobal.alerta_updatepanel("Ingrese la Sucursal de origen", Page, up); return; } double rut_vendedor = this.Datosvendedor.getRut(); List <Direcciones> ldireccion_vendedor = new DireccionesBC().getdirecciones(Convert.ToInt32(rut_vendedor)); if (ldireccion_vendedor.Count == 0) { FuncionGlobal.alerta_updatepanel("El Vendedor no tiene direccion", Page, up); return; } else { if (chk_leasing.Checked == true) { if (tipo_operacion == "CTC") { double rut = this.Datosvendedor.getRut(); List <Participante> lparticipantes = new ParticipanteBC().Getparticipante(rut); if (lparticipantes.Count > 0) { add(); } else { FuncionGlobal.alerta_updatepanel("El vendedor no tiene participantes", Page, up); return; } } else { double rut = this.Datosvendedor.getRut(); List <Participante> lparticipantes = new ParticipanteBC().Getparticipante(rut); double rut2 = this.Datoscomprador.getRut(); List <Participante> lparticipantes2 = new ParticipanteBC().Getparticipante(rut2); if (lparticipantes.Count > 0 && lparticipantes2.Count >= 0) { add(); } else { FuncionGlobal.alerta_updatepanel("Faltan Participantes", Page, up); return; } } } else { if (this.txt_kilometraje.Text == "") { FuncionGlobal.alerta_updatepanel("Debe ingresar el kilometraje", Page, up); return; } if (this.lbl_codigo.Text == "")// modificar a { FuncionGlobal.alerta_updatepanel("Ingrese el codigo de Servicio Impuestos Internos", Page, up); return; } else { if (this.txt_precio.Text == "") { FuncionGlobal.alerta_updatepanel("Ingrese el precio del vehiculo", Page, up); return; } else { double rut = this.Datosvendedor.getRut(); List <Participante> lparticipantes = new ParticipanteBC().Getparticipante(rut); double rut2 = this.Datoscomprador.getRut(); List <Participante> lparticipantes2 = new ParticipanteBC().Getparticipante(rut2); List <Direcciones> ldireccion = new DireccionesBC().getdirecciones(Convert.ToInt32(rut2)); List <Correo> lcorreo = new CorreoBC().getcorreos(Convert.ToInt32(rut2)); if (tipo_operacion != "CTC" && tipo_operacion != "CTMAG") { if (this.Datoscomprador.getRut() >= 50000000) { if (lparticipantes2.Count == 0) { FuncionGlobal.alerta_updatepanel("El comprador no tiene Representantes", Page, up); return; } } if (id_cliente == 3 || id_cliente == 4) { if (lcorreo.Count == 0) { FuncionGlobal.alerta_updatepanel("No ingreso correo electronico para el comprador", Page, up); return; } } if (ldireccion.Count == 0) { FuncionGlobal.alerta_updatepanel("El comprador no tiene direccion", Page, up); return; } } if (this.Datosvendedor.getRut() >= 50000000) { if (lparticipantes.Count == 0) { FuncionGlobal.alerta_updatepanel("El vendedor no tiene Representantes", Page, up); return; } } add(); } } } } }