protected void Fun_Buscar_factura() { if (Txtidcliente.Fun_SQL_Buscar_CodigoRegistro("prudbffactura", "idfactura")) { DataSet ds = Txtidcliente._Dataset; if (ds.Tables[0].Rows[0]["idfactura"].ToString() == "1") { Txtidcliente.Text = ""; Txtidcliente.Focus(); Mensajes.Msgb_NoRegistro_CliContado(); } else { Txtcliente.Text = ds.Tables[0].Rows[0]["idcliente"].ToString(); Fun_Buscar_Cliente(); //string cmd = string.Format("SELECT dbo.cxcdbfcliente.idcliente, dbo.cxcdbfcliente.nombre, dbo.cxcdbfcliente.direccion, dbo.cxcdbfcliente.telefono, dbo.cxcdbfcliente.referencia, dbo.nomdbfempleado.idempleado, dbo.nomdbfempleado.nombre AS nombre_vendedor, dbo.cxcdbfconcepto.idconcepto, dbo.cxcdbfconcepto.descripcion FROM dbo.cxcdbfregistro INNER JOIn dbo.cxcdbfcliente ON dbo.cxcdbfregistro.idcliente = dbo.cxcdbfcliente.idcliente CROSS JOIN dbo.nomdbfempleado CROSS JOIN dbo.cxcdbfconcepto where dbo.cxcdbfconcepto.idconcepto='" + Funciones_Duke4.Funciones.Fun_Convierte_String_aEntrero(Txtidcliente.Text.Trim()) + "' and cxcdbfcliente.nulo=0"); //DataSet ds2 = FuncionesSQL.Fun_Sql_Ejecutar(cmd); //if (ds2.Tables[0].Rows.Count > 0) //{ // dia = Funciones_Duke4.Funciones.Fun_Convierte_String_aEntrero(Convert.ToString(ds2.Tables[0].Rows[0][0])); //} //Fun_Buscar_Fecha_Vencimiento(); } if (_OpcionSQL != "Modificar") { FuncionesSQL.Fun_SQL_Buscar_Secuencia_NCF(Funciones_Duke4.Funciones.Fun_Convierte_String_aEntrero(ds.Tables[0].Rows[0]["idncf"].ToString()), Dtpfecha.Value, Msknfc); } } else { Txtcliente.Text = Txtdireccion.Text = Txttelefono.Text = Msknfc.Text = Txtbalance.Text = ""; } }
private void Rbncredito_CheckedChanged(object sender, EventArgs e) { if (Rbncredito.Checked) { Txtregistro.Text = FuncionesSQL.Fun_SQL_Buscar_UltimoNumReg("NOTA DE CREDITO CXC"); FuncionesSQL.Fun_SQL_Buscar_Secuencia_NCF(4, Dtpfecha.Value, Mskncf); } }
private void Dtpfecha_Validating(object sender, CancelEventArgs e) { if (Rbncredito.Checked) { FuncionesSQL.Fun_SQL_Buscar_Secuencia_NCF(4, Dtpfecha.Value, Mskncf); } else if (Rbndebito.Checked) { FuncionesSQL.Fun_SQL_Buscar_Secuencia_NCF(3, Dtpfecha.Value, Mskncf); } }
private void Dtpfecha_Validating(object sender, CancelEventArgs e) { string cmd = "select idncf from cxcdbfcliente where idcliente ='" + Txtcodigocliente.Text.Trim() + "'"; DataSet ds = FuncionesSQL.Fun_Sql_Ejecutar(cmd); if (ds.Tables[0].Rows.Count > 0) { FuncionesSQL.Fun_SQL_Buscar_Secuencia_NCF(Funciones_Duke4.Funciones.Fun_Convierte_String_aEntrero(ds.Tables[0].Rows[0][0].ToString()), Dtpfecha.Value, Mskncf); } Fun_Buscar_Fecha_Vencimiento(); }
private void Ckbncf_CheckedChanged(object sender, EventArgs e) { if (Ckbncf.Checked) { Mskncf.Visible = true; if (Rbncredito.Checked) { FuncionesSQL.Fun_SQL_Buscar_Secuencia_NCF(4, Dtpfecha.Value, Mskncf); } else if (Rbndebito.Checked) { FuncionesSQL.Fun_SQL_Buscar_Secuencia_NCF(3, Dtpfecha.Value, Mskncf); } } else { Mskncf.Visible = false; } }
protected void Fun_Buscar_Cliente() { if (Txtcodigocliente.Fun_SQL_Buscar_CodigoRegistro("cxcdbfcliente", "idcliente")) { DataSet ds = Txtcodigocliente._Dataset; if (ds.Tables[0].Rows[0]["idcliente"].ToString() == "1") { Txtcodigocliente.Text = ""; Txtcodigocliente.Focus(); Mensajes.Msgb_NoRegistro_CliContado(); } else { dia = 0; Txtnombrecliente.Text = ds.Tables[0].Rows[0]["nombre"].ToString(); Txtdireccioncliente.Text = ds.Tables[0].Rows[0]["direccion"].ToString(); Txttelefonocliente.Text = ds.Tables[0].Rows[0]["telefono"].ToString(); Txtrnccliente.Text = ds.Tables[0].Rows[0]["rnc"].ToString(); Txtbalancecliente.Text = FuncionesSQL.Fun_SQL_Buscar_Balance_Cliente(Txtcodigocliente.Text); string cmd = string.Format("SELECT dbo.gendbfcondicion.cantidad_dia FROM dbo.cxcdbfcliente CROSS JOIN dbo.gendbfcondicion where gendbfcondicion.idcondicion =cxcdbfcliente.idcondicion and cxcdbfcliente.idcliente='" + Funciones_Duke4.Funciones.Fun_Convierte_String_aEntrero(Txtcodigocliente.Text.Trim()) + "' and cxcdbfcliente.nulo=0"); DataSet ds2 = FuncionesSQL.Fun_Sql_Ejecutar(cmd); if (ds2.Tables[0].Rows.Count > 0) { dia = Funciones_Duke4.Funciones.Fun_Convierte_String_aEntrero(Convert.ToString(ds2.Tables[0].Rows[0][0])); } Fun_Buscar_Fecha_Vencimiento(); } if (_OpcionSQL != "Modificar") { FuncionesSQL.Fun_SQL_Buscar_Secuencia_NCF(Funciones_Duke4.Funciones.Fun_Convierte_String_aEntrero(ds.Tables[0].Rows[0]["idncf"].ToString()), Dtpfecha.Value, Mskncf); } } else { Txtnombrecliente.Text = Txtdireccioncliente.Text = Txttelefonocliente.Text = Txtrnccliente.Text = Txtbalancecliente.Text = ""; } }