public void getreferencia(string solicitud) { DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("referencia")); List <DatoContacto> ldatocontacto = new DatoContactoBC().getdatocontactobysolicitud(Convert.ToInt32(solicitud)); if (ldatocontacto.Count > 0) { this.bt_guardar.Visible = true; } foreach (DatoContacto mdatocontactoin in ldatocontacto) { DataRow dr = dt.NewRow(); dr["referencia"] = mdatocontactoin.Referencia; dt.Rows.Add(dr); } DataRow draux = dt.NewRow(); draux["referencia"] = ""; dt.Rows.Add(draux); this.gr_dato.DataSource = dt; this.gr_dato.DataBind(); }
private void add_operacion() { double rut_deudor = 0; GridViewRow row; string rutvend = "0"; Int32 monto_final = 0; DateTime fecha = Convert.ToDateTime("01/01/1900"); if (this.Datosvendedor.Guardar_Form()) { if (this.Datosvendedor.InfoPersona != null) { rutvend = this.Datosvendedor.InfoPersona.Rut.ToString(); } } if (this.txt_rut_deudor.Text == "") { rut_deudor = 0; } else { rut_deudor = Convert.ToDouble(this.txt_rut_deudor.Text); string persona = new PersonaBC().add_personaCG(Convert.ToDouble(this.txt_rut_deudor.Text), this.txt_dv.Text, 1, "", this.txt_nombre_deudor.Text, this.txt_paterno.Text, this.txt_materno.Text, "", "", "", "", "0", "0", "", "", "", "", "", "0"); } Int32 add = new OperacionBC().add_operacion(Convert.ToInt32(this.lbl_numero.Text), Convert.ToInt16(id_cliente), "SGI", (string)(Session["usrname"]), 0, "", Convert.ToInt32(this.dl_sucursal_origen.SelectedValue), 0); if (this.txt_monto_final.Text != "") { monto_final = Convert.ToInt32(this.txt_monto_final.Text); } if (this.txt_fecha_gestion.Text != "") { fecha = Convert.ToDateTime(this.txt_fecha_gestion.Text); } string addI_CTG = new ControlGestionBC().add_controlgestion(add, Convert.ToInt32(this.txt_rut_deudor.Text), Convert.ToInt32(this.dl_producto_Cliente.SelectedValue), Convert.ToInt32(FuncionGlobal.NumeroSinFormato(this.txt_total.Text)), fecha, Convert.ToInt32(this.txt_ncuotas.Text), this.txt_noperacion.Text, Convert.ToInt32(this.dl_sucursal_origen.SelectedValue.ToString()), this.txt_observacion.Text, Convert.ToInt32(this.dl_forma_pago.SelectedValue.ToString()), Convert.ToInt32(rutvend), this.txt_patente.Text, monto_final ); string add_SGI = ""; string del_SGI = ""; if (add != 0) { del_SGI = new DatoContactoBC().del_DatoContacto(add); for (int i = 0; i < gr_dato.Rows.Count; i++) { row = gr_dato.Rows[i]; TextBox txt_referencia = (TextBox)gr_dato.Rows[i].FindControl("txt_referencia"); add_SGI = new DatoContactoBC().add_DatoContacto(add, txt_referencia.Text ); } if (add_SGI == "") { string add_or = new EstadooperacionBC().add_estado_orden(Convert.ToInt32(add), 1, "SGI", "", (string)(Session["usrname"])); } } this.lbl_operacion.Visible = true; this.lbl_numero.Visible = true; this.ib_mas.Enabled = true; this.lbl_operacion.Text = "Operación de Gestion y Control Numero:"; this.lbl_numero.Text = Convert.ToString(add); getreferencia(Convert.ToString(add)); //carga_rpt(add); }