public void consulta() { string test = selectLinea.Value; string test2 = selectBodega.Value; string[] palabras = test.Split('/'); string[] palabras2 = test2.Split('/'); string idlinea = palabras[0]; string idbodega = palabras2[0]; try { var registrosr = Controlasql.Cventashoralinea(txtfecha.Value, idlinea, idbodega); if (registrosr.Tables[0].Rows.Count > 0) { GridViewsupermio.DataSource = registrosr; GridViewsupermio.DataBind(); } else { GridViewsupermio.DataSource = null; GridViewsupermio.DataBind(); } } catch (Exception e) { txtnotifica.InnerText = e.Message; } }
protected void listadoactivosserial(object sender, EventArgs e) { var ser = searh_serial.Value; try { String bd = Session["BD"].ToString(); var registros = Controlasql.listaactivoserial(ser, bd); if (registros.Tables[0].Rows.Count > 0) { GridViewNovedades.DataSource = registros; GridViewNovedades.DataBind(); } else { GridViewNovedades.DataSource = null; GridViewNovedades.DataBind(); } } catch (Exception ex) { notificacion.Visible = false; excepcion.Visible = true; error.InnerText = "No Registros. Error: " + ex.Message; } }
public void Listarsaldos() { string[] palabras = Select1.Value.Split('/'); string serial = palabras[0]; try {//aqui String bd = Session["BD"].ToString(); // var registros16 = Controlasql.saldokardex(txtfechaini.Value,txtfechafin.Value, serial,selectbodega.Value.ToString(),bd); var registros16 = Controlasql.listakardexreport(serial, txtfechaini.Value, txtfechafin.Value, selectbodega.Value.ToString(), bd); if (registros16.Tables[0].Rows.Count > 0) { Gridkardex.DataSource = registros16; Gridkardex.DataBind(); } else { Gridkardex.DataSource = null; Gridkardex.DataBind(); } Listarsaldostotal(); } catch (Exception ex) { notificacion.Visible = false; excepcion.Visible = true; error.InnerText = "No se Cargo los saldos. Error: " + ex.Message; } }
protected void CreaActivo_Click(object sender, EventArgs e) { String Vmodelo = Selectmodelo.Value; String Vfabricante = SelectFabricante.Value; llenavariableid(); String Varserial = txtserial.Value.ToUpper(); try { var registros = Controlasql.Ccreaactivo(txtaviso.InnerText, txtserial.Value.ToUpper(), txtnombre.Value.ToUpper(), Selectmodelo.Value, SelectFabricante.Value, SelectCategoria.Value, txtcoment.Value.ToUpper(), SelectTercero.Value.ToString(), txtgarantia.Value, txtfechacompra.Value, txtvalor.Value, Session["USUARIO"].ToString(), Session["BD"].ToString()); if (registros > 0) { serialcantidad.Value = txtserial.Value.ToUpper(); modal.Visible = true; } else { serialcantidad.Value = txtserial.Value.ToUpper(); alertaid.Visible = true; } } catch (Exception ex) { notificacion.Visible = false; excepcion.Visible = true; error.InnerText = "No Registro. Error: " + ex.Message; } }
public void si_Click(object sender, EventArgs e) { serialcantidad.Value = txtserial.Value.ToUpper(); llenavariablecant_articulo(); try { var registros = Controlasql.Ccreacantidadactivo(txtaviso.InnerText, serialcantidad.Value, canti.Value, Session["BD"].ToString()); if (registros > 0) { modal.Visible = false; notificacion.Visible = true; txtnotifica.InnerText = "Registro Exitoso"; } else { alertaid.Visible = true; } //aqui limpia la pantalla } catch (Exception ex) { notificacion.Visible = false; excepcion.Visible = true; error.InnerText = "No se Registro la Cantidad. Error: " + ex.Message; } }
public void llenatipomantenimiento() { try { String bd = Session["BD"].ToString(); var registrotipom = Controlasql.Clistaclasemantenimiento(bd); if (registrotipom.Tables[0].Rows.Count > 0) { DataTable dt = registrotipom.Tables[0]; Selecttipo.Items.Clear(); foreach (DataRow row in dt.Rows) { Selecttipo.Items.Add(Convert.ToString(row["Nombre"])); Selecttipo.DataBind(); } } else { Selecttipo.DataSource = null; Selecttipo.DataBind(); } } catch (Exception) { } }
protected void Creanuevalinea(object sender, EventArgs e) { try { var registros = Controlasql.CcreaFabricante(Textfabricante.Value.ToUpper(), Session["USUARIO"].ToString(), Session["BD"].ToString()); if (registros > 0) { llenafabricante(); SelectFabricante.Focus(); excepcion.Visible = false; notificacion.Visible = true; txtnotifica.InnerText = "Registro Exitoso"; } else { serialcantidad.Value = txtserial.Value.ToUpper(); alertaid.Visible = true; } } catch (Exception ex) { notificacion.Visible = false; excepcion.Visible = true; error.InnerText = "No se Registro. Error: " + ex.Message; } }
protected void CreaActivo_Click(object sender, EventArgs e) { String Vmodelo = Select1.Value; String Vfabricante = Select2.Value; llenavariableid(); String Varserial = txtserial.Value.ToUpper(); try { var registros = Controlasql.Ccreaactivo(txtaviso.InnerText, txtserial.Value.ToUpper(), txtnombre.Value.ToUpper(), Select1.Value, Select2.Value, Select3.Value, txtcoment.Value.ToUpper(), Select4.Value.ToString(), txtgarantia.Value, txtfechacompra.Value, txtvalor.Value, Session["USUARIO"].ToString(), Session["BD"].ToString()); if (registros > 0) { serialcantidad.Value = txtserial.Value.ToUpper(); modal.Visible = true; } else { serialcantidad.Value = txtserial.Value.ToUpper(); alerta.Visible = true; } } catch (Exception ex) { throw ex; } }
public async Task SendSms(string tel, string nombre, string sms) { try { var send = $"https://api101.hablame.co/api/sms/v2.1/send/?apiKey=LyRMarMdWrdCIkxPCONFCg6Hbr6AcQ&account=10011043&token=f94dd6bde1f654cab0e08c90cd64981e&toNumber= {tel}&sms=Hola {nombre}, {sms}"; var client = new HttpClient(); var res = await client.GetAsync(send); var json = await res.Content.ReadAsStringAsync(); try { String bd = Session["BD"].ToString(); var registros = Controlasql.CClog_cumples(nombre, tel, sms, Session["USUARIO"].ToString(), bd); } catch (Exception EX) { alerta.MessageBox(this, $" {EX}"); } //var rest = JsonConvert.DeserializeObject<List<smsobjet>>(json); alerta.MessageBox(this, "Mensaje Enviado Exitosamente"); Debug.WriteLine(await res.Content.ReadAsStringAsync());//Stifen } catch (Exception e) { alerta.MessageBox(this, $" {e}"); } // r.sms = $"Hola {nombre}, En nuestro calendario siempre esta marcada la fecha de tu cumpleaños porque eres una persona muy especial para SUPERMIO. ¡Que pases un bonito dia ! ¡Muchas felicidades!. para cancelar suscripcion: https://bit.ly/2Bgdf8X"; //var messagePost = Newtonsoft.Json.JsonConvert.SerializeObject(r); //Debug.WriteLine(messagePost); }
public void llenaubicacion() { try { String bd = Session["BD"].ToString(); var registroubica = Controlasql.Clistaubicacion(bd); if (registroubica.Tables[0].Rows.Count > 0) { DataTable dt = registroubica.Tables[0]; //Selectubicacion.Items.Clear(); foreach (DataRow row in dt.Rows) { //Selectubicacion.Items.Add(Convert.ToString(row["Nombre"])); //Selectubicacion.DataBind(); } } else { //Selectubicacion.DataSource = null; //Selectubicacion.DataBind(); } } catch (Exception ex) { alerta.MessageBox(this, ex.Message); } }
public void llenaProveedores() { try { String bd = Session["BD"].ToString(); var registroubica = Controlasql.ClistaPROVEEDORES2(bd); if (registroubica.Tables[0].Rows.Count > 0) { DataTable dt = registroubica.Tables[0]; SelectProveedores.Items.Clear(); foreach (DataRow row in dt.Rows) { SelectProveedores.Items.Add(Convert.ToString(row["nomb"])); SelectProveedores.DataBind(); } } else { SelectProveedores.DataSource = null; SelectProveedores.DataBind(); } } catch (Exception ex) { alerta.MessageBox(this, ex.Message); } }
protected void GridViewlista_SelectedIndexChanged(object sender, EventArgs e) { //ul3.Style.Add("display", "block"); //lista_Mant_preaprobadas.Style.Add("display", "none"); //ul1.Style.Add("display", "none"); GridViewRow gr = GridViewlista.SelectedRow; Textidacta.Value = Page.Server.HtmlDecode(gr.Cells[1].Text); Selectordenes.Value = Page.Server.HtmlDecode(gr.Cells[5].Text); Selectproveedor.Value = Page.Server.HtmlDecode(gr.Cells[2].Text); OBSERVACIONG.Value = Page.Server.HtmlDecode(gr.Cells[4].Text); fechaacta.Value = Page.Server.HtmlDecode(gr.Cells[3].Text); try { String bd = Session["BD"].ToString(); var registro_detalle_preap = Controlasql.Clista_detamant_preaprobadas(Textidacta.Value, bd); if (registro_detalle_preap.Tables[0].Rows.Count > 0) { GridViewdetalles_preaprob.DataSource = registro_detalle_preap; GridViewdetalles_preaprob.DataBind(); //ul8.Style.Add("display", "block"); } else { GridViewdetalles_preaprob.DataSource = null; GridViewdetalles_preaprob.DataBind(); } } catch (Exception ex) { alerta.MessageBox(this, ex.Message); } view_detalles.Visible = true; }
public void llenaempleados() { try { String bd = Session["BD"].ToString(); var registroPROVEE = Controlasql.ctraeEmpleado_Sin_contra(bd); if (registroPROVEE.Tables[0].Rows.Count > 0) { DataTable dt = registroPROVEE.Tables[0]; select_cc.Items.Clear(); foreach (DataRow row in dt.Rows) { select_cc.Items.Add(Convert.ToString(row["NOMB"])); select_cc.DataBind(); } } else { select_cc.DataSource = null; select_cc.DataBind(); } } catch (Exception EXCP) { String dato = EXCP.Message; excepcion.Visible = true; error.InnerText = dato; } }
protected void btnguardar_Click(object sender, EventArgs e) { string[] palabras = Selectarticulo.Value.Split('/'); string serial = palabras[0]; try { var registros3 = Controlasql.ccreadetalleactamante(txtidacta.Value, serial, txtRepuestos.Value.ToUpper().Trim(), valorManObra.Value, V_repuestos.Value, txtobserva.Value.ToUpper(), SelecttipoMant.Value, Textnumeroexterno.Value, Session["BD"].ToString()); if (registros3 > 0) { string script = @"<script type='text/javascript'> alert('Fila insertada '); </script>"; ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, false); cargarInfo(); } } catch (Exception ex) { throw ex; } }
public void Llenasalas() { try { string bd = Session["BD"].ToString(); var registros = Controlasql.CSalaventas(bd); Selectsala.Items.Clear(); if (registros.Tables[0].Rows.Count > 0) { DataTable dt = registros.Tables[0]; foreach (DataRow row in dt.Rows) { Selectsala.Items.Add(Convert.ToString(row["NOMBRE"])); Selectsala.DataBind(); } } else { Selectsala.DataSource = null; Selectsala.DataBind(); } } catch (Exception ex) { //notificacion.Visible = false; //excepcion.Visible = true; //error.InnerText = "No Registros. Error: " + ex.Message; } }
public void llenapersonas() { try { String bd = Session["BD"].ToString(); var registroPROVEE = Controlasql.ClistaPROVEEDORES(bd); if (registroPROVEE.Tables[0].Rows.Count > 0) { DataTable dt = registroPROVEE.Tables[0]; SelectProveedor.Items.Clear(); foreach (DataRow row in dt.Rows) { SelectProveedor.Items.Add(Convert.ToString(row["nomb"])); SelectProveedor.DataBind(); } } else { SelectProveedor.DataSource = null; SelectProveedor.DataBind(); } } catch (Exception) { } }
public void llenaarea() { try { String bd = Session["BD"].ToString(); var registroubica = Controlasql.Clistaarea(bd); if (registroubica.Tables[0].Rows.Count > 0) { DataTable dt = registroubica.Tables[0]; Selectarea.Items.Clear(); foreach (DataRow row in dt.Rows) { Selectarea.Items.Add(Convert.ToString(row["Nombre"])); Selectarea.DataBind(); } } else { Selectarea.DataSource = null; Selectarea.DataBind(); } } catch (Exception) { } }
private DataTable GetData(string acta) { //DataTable dt = new DataTable(); //string connex = "server=192.168.1.133;port=3306;database='" + Session["BD"].ToString() + "';Uid=root;pwd=dibal;SslMode=none"; //using (MySqlConnection cn = new MySqlConnection(connex)) //{ // MySqlCommand cmd = new MySqlCommand("LISTAASIGNACIONORDENMANTENIMIENTO", cn); // // cmd.CommandType = CommandType.Text; // cmd.CommandType = CommandType.StoredProcedure; // cmd.Parameters.Add("@parm", MySqlDbType.String).Value = acta; // MySqlDataAdapter adp = new MySqlDataAdapter(cmd); // adp.Fill(dt); //} //return dt; DataTable dt = new DataTable(); try { String bd = Session["BD"].ToString(); var registros = Controlasql.ctraeactaasignado(acta, bd); if (registros.Tables[0].Rows.Count > 0) { dt = registros.Tables[0]; } } catch (Exception e) { throw e; } return(dt); }
protected void CreaCategoria_Click(object sender, EventArgs e) { try { var registros = Controlasql.Ccreacategoria(Textcategoria.Value.ToUpper(), TxtVidaUtil.Value.ToUpper(), Session["USUARIO"].ToString(), Session["BD"].ToString()); if (registros > 0) { llenaCategoria(); SelectCategoria.Focus(); excepcion.Visible = false; notificacion.Visible = true; txtnotifica.InnerText = "Registro Exitoso"; } else { serialcantidad.Value = txtserial.Value.ToUpper(); alertaid.Visible = true; } } catch (Exception ex) { notificacion.Visible = false; excepcion.Visible = true; error.InnerText = "No se registro. Error: " + ex.Message; } }
protected void btnguardar_Click(object sender, EventArgs e) { try { var registros = Controlasql.Cupdateincapacidad(Selectempleado.Value, txtobserva.Value.ToUpper().ToString(), txtfechaini.Value, txtfechafin.Value, Session["USUARIO"].ToString(), txtidempleado.Value, Session["BD"].ToString()); if (registros > 0) { btnguardar.Visible = false; btncancelar.Visible = false; string script = @"<script type='text/javascript'> alert('Guardado con Exito'); </script>"; ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, false); cargarinfo(); } } catch (Exception ex) { throw ex; } }
protected void CreaTercero_Click(object sender, EventArgs e) { try { var registros = Controlasql.CcreaTercero(txtccoNit.Value.ToUpper(), txtNomb.Value.ToUpper(), txtdir.Value.ToUpper(), txttel.Value, txtCiudad.Value.ToUpper(), txtEmail.Value.ToUpper(), Session["USUARIO"].ToString(), Session["BD"].ToString()); if (registros > 0) { llenaproveedor(); SelectTercero.Focus(); notificacion.Visible = true; excepcion.Visible = false; txtnotifica.InnerText = "Registro Exitoso"; } else { serialcantidad.Value = txtserial.Value.ToUpper(); alertaid.Visible = true; } } catch (Exception ex) { notificacion.Visible = false; excepcion.Visible = true; error.InnerText = "No se Registro. Error: " + ex.Message; } }
public void Consultageneral() { if (txtdesde.Value.Length == 0 || txthasta.Value.Length == 0) { alerta.Visible = true; alerta.Text = "Ingrese un rango de Fechas"; } info1.Text = txtdesde.Value.ToString() + " - " + txthasta.Value.ToString(); try { var registros13 = Controlasql.Cventas_linea_general(txtdesde.Value, txthasta.Value); if (registros13.Tables[0].Rows.Count > 0) { GridGeneral.DataSource = registros13; GridGeneral.DataBind(); alerta.Visible = false; } else { GridGeneral.DataSource = null; GridGeneral.DataBind(); } } catch (Exception es) { alerta.Visible = true; alerta.Text = (es.Message.ToString()); } }
public void llenaCategoria() { try { String bd = Session["BD"].ToString(); var registros = Controlasql.ctraecategoriaactivos(bd); SelectCategoria.Items.Clear(); if (registros.Tables[0].Rows.Count > 0) { DataTable dt = registros.Tables[0]; foreach (DataRow row in dt.Rows) { SelectCategoria.Items.Add(Convert.ToString(row["nombCat"])); SelectCategoria.DataBind(); } } else { SelectCategoria.DataSource = null; SelectCategoria.DataBind(); } } catch (Exception e) { alerta.MessageBox(this, "excepcion Interna: " + e.Message); } }
public void Consultalaversalles(object sender, EventArgs e) { string idcosto = "000004"; if (txtdesde.Value.Length == 0 || txthasta.Value.Length == 0) { alerta.Visible = true; alerta.Text = "Ingrese un rango de Fechas"; } info4.Text = txtdesde.Value.ToString() + " - " + txthasta.Value.ToString(); try { var registros13 = Controlasql.Cventas_linea(txtdesde.Value, txthasta.Value, idcosto); if (registros13.Tables[0].Rows.Count > 0) { GridVersalles.DataSource = registros13; GridVersalles.DataBind(); alerta.Visible = false; } else { GridVersalles.DataSource = null; GridVersalles.DataBind(); } } catch (Exception es) { alerta.Visible = true; alerta.Text = (es.Message.ToString()); } }
public void llenaLinea() { try { String bd = Session["BD"].ToString(); var registros = Controlasql.ctraelinea(bd); Selectlinea.Items.Clear(); if (registros.Tables[0].Rows.Count > 0) { DataTable dt = registros.Tables[0]; foreach (DataRow row in dt.Rows) { Selectlinea.Items.Add(Convert.ToString(row["nombre"])); Selectlinea.DataBind(); } } else { Selectlinea.DataSource = null; Selectlinea.DataBind(); } } catch (Exception ex) { notificacion.Visible = false; excepcion.Visible = true; error.InnerText = "No Registros. Error: " + ex.Message; } }
public void llenaarticulo() { try { String bd = Session["BD"].ToString(); var registrosseriales = Controlasql.listaserial(bd); if (registrosseriales.Tables[0].Rows.Count > 0) { DataTable dt = registrosseriales.Tables[0]; Selectarticulo.Items.Clear(); foreach (DataRow row in dt.Rows) { Selectarticulo.Items.Add(Convert.ToString(row["Nombre"])); Selectarticulo.DataBind(); } } else { Selectarticulo.DataSource = null; Selectarticulo.DataBind(); } } catch (Exception e) { throw e; } }
protected void CreaMOdelo_Click(object sender, EventArgs e) { try { var registros = Controlasql.CcreaModelo(Textmodelo.Value.ToUpper(), Session["USUARIO"].ToString(), Session["BD"].ToString()); if (registros > 0) { excepcion.Visible = false; notificacion.Visible = true; txtnotifica.InnerText = "Registro exitoso"; llenamodelos(); Selectmodelo.Focus(); } else { serialcantidad.Value = txtserial.Value.ToUpper(); alertaid.Visible = true; } } catch (Exception ex) { notificacion.Visible = false; excepcion.Visible = true; error.InnerText = "No se Registro el Modelo. Error: " + ex.Message; } }
public void llenaempleados() { try { String bd = Session["BD"].ToString(); var registroPROVEE = Controlasql.ctraeEmpleado(bd); if (registroPROVEE.Tables[0].Rows.Count > 0) { DataTable dt = registroPROVEE.Tables[0]; Select1.Items.Clear(); foreach (DataRow row in dt.Rows) { Select1.Items.Add(Convert.ToString(row["Proveedor"])); Select1.DataBind(); } } else { Select1.DataSource = null; Select1.DataBind(); } } catch (Exception) { } }
protected void GridViewnovedades_SelectedIndexChanged(object sender, EventArgs e) { GridViewRow gr = Gridkardex.SelectedRow; string idtabla = gr.Cells[1].Text;//coment String bd = Session["BD"].ToString(); try { var registros16 = Controlasql.Cdelete_kardex(idtabla, bd); if (registros16 > 0) { lblalerta.Visible = true; alertant.InnerText = registros16 + " Eliminado"; Listarsaldos(); } else { lblalerta.Visible = true; alertant.InnerText = "Sin Eliminar"; Listarsaldos(); } } catch (Exception ex) { lblalerta.Visible = true; alertant.InnerText = "Con excepcion interna :" + ex.Message; } }
public void llenalineas() { try { var registroubica = Controlasql.traelineassupermio(); if (registroubica.Tables[0].Rows.Count > 0) { DataTable dt = registroubica.Tables[0]; selectLinea.Items.Clear(); foreach (DataRow row in dt.Rows) { selectLinea.Items.Add(Convert.ToString(row["Nombre"])); selectLinea.DataBind(); } } else { selectLinea.DataSource = null; selectLinea.DataBind(); } } catch (Exception ex) { txtnotifica.InnerText = ex.Message; } }