private void LlenarGridExistenciaAlmacen() { try { DataTable dtAlmacenes = AlmacenBLL.ObtenerAlmacenes(Convert.ToInt32(Session["Company"])); if (dtAlmacenes.Rows.Count > 0) { if (dtAlmacenes.Rows.Count > 1) { DropTool.CompleteDrop(dtAlmacenes, 0, "-- TODOS LOS ALMACENES --"); } DropTool.FillDrop(drpAlmacenInventario, dtAlmacenes, "Descripcion", "Numero"); dtExistenciaAlmacen = AlmacenBLL.ObtenerExistenciaAlmacen(Convert.ToInt32(Session["Company"]), Convert.ToInt32(drpAlmacenInventario.SelectedValue)); if (dtExistenciaAlmacen.Rows.Count > 0) { GridViewTool.Bind(dtExistenciaAlmacen, grvExistenciaAlmacen); } else { LabelTool.ShowLabel(divAlert2, spnAlert2, lblAlert2, "Sin inventario disponible", 'i'); } } else { LabelTool.ShowLabel(divAlert2, spnAlert2, lblAlert2, "No tienes almacenes relacionados", 'i'); } } catch (Exception ex) { LabelTool.ShowSingleLabel(lblMsgMdlError, ex.Message, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle('#mdlError'); ToolTip();", true); } }
//protected void lnkXLS_Click(object sender, EventArgs e) //{ // try // { // if (fupXLS.HasFile) // { // string FileName = Path.GetFileName(fupXLS.PostedFile.FileName); // string Extension = Path.GetExtension(fupXLS.PostedFile.FileName); // string FolderPath = WebConfigurationManager.AppSettings["sFolderXLS"].ToString(); // string FilePath = Server.MapPath(FolderPath + FileName); // fupXLS.SaveAs(FilePath); // Import_To_Grid(FilePath, Extension, "Yes"); // } // //ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "LimpiarDatos();", true); // //ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "tabNuevos(); redirect('#nuevos');", true); // } // catch (Exception ex) // { // Label lblError = this.Master.FindControl("lblError") as Label; // LabelTool.ShowSingleLabel(lblError, ex.Message, System.Drawing.Color.Black); // ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "tabNuevos(); mdlToggle('#mdlError');", true); // } //} protected void lnkXLS_Click(object sender, EventArgs e) { try { if (Request.Files.Count > 0) { dtProductosExcel = new DataTable(); dtProductosExcel = CreardtProductos(); dtValidaciones = new DataTable(); dtValidaciones.Columns.Add("Descripcion"); for (int indice = 0; indice < Request.Files.Count; indice++) { string FileName = Path.GetFileName(Request.Files[indice].FileName); string Extension = Path.GetExtension(Request.Files[indice].FileName); string FolderPath = WebConfigurationManager.AppSettings["sFolderXLS"].ToString(); string FilePath = Server.MapPath(FolderPath + FileName); Request.Files[indice].SaveAs(FilePath); ObtenerProductosExcel(FilePath, Extension, "Yes", FileName); } AgregarProductosAGrid(); } //ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle('#mdlProceso'); tabNuevos();", true); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "smen();", true); } catch (Exception ex) { Label lblError = this.Master.FindControl("lblError") as Label; LabelTool.ShowSingleLabel(lblError, ex.Message, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "tabNuevos(); mdlToggle2('#mdlProceso','#mdlError');", true); } }
protected void txtBusquedaCliente_TextChanged(object sender, EventArgs e) { try { if (keycontainer.Value != "") { DataTable dt = ClientesBLL.ObtenerDatosCliente(Convert.ToInt32(Session["Company"]), Convert.ToInt32(keycontainer.Value)); if (dt.Rows.Count > 0) { lblNombreCliente.Text = dt.Rows[0]["Nombre"].ToString(); lblRFC.Text = dt.Rows[0]["RFC"].ToString(); lblDomicilio.Text = dt.Rows[0]["Domicilio"].ToString(); lblColonia.Text = dt.Rows[0]["Colonia"].ToString(); lblCodigoPostal.Text = dt.Rows[0]["Codigo_Postal"].ToString(); lblDelegacion.Text = dt.Rows[0]["Delegacion_Municipio"].ToString(); lblEstado.Text = dt.Rows[0]["Estado"].ToString(); lblTelefono.Text = dt.Rows[0]["Telefono"].ToString(); hdnListaPrecio.Value = dt.Rows[0]["Lista_Precio"].ToString(); txtBusquedaCliente.Text = ""; } } else { LabelTool.ShowSingleLabel(lblMsgMdlError, "Ocurrió un error al obtener el cliente.", System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle('#mdlError');", true); } } catch (Exception ex) { LabelTool.ShowSingleLabel(lblMsgMdlError, ex.Message, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle('#mdlError');", true); } }
/// <summary> /// 绑定上方功能菜单数据,从子系统开始绑定 /// </summary> /// <param name="toolbar"></param> /// <param name="list"></param> private void BandMainMemu(UltraToolbarsManager toolbar, List <SysFunction> list) { if (toolbar.Tools.Count > 0) { toolbar.Toolbars[0].Tools.Clear(); toolbar.Tools.Clear(); //使菜单栏居右 LabelTool labelTool = new LabelTool("blankTool"); labelTool.SharedProps.Spring = true; toolbar.Tools.Add(labelTool); toolbar.Toolbars[0].Tools.AddTool("blankTool"); //子系统 List <SysFunction> subSystemList = list.FindAll(f => f.FunctionType.Equals("1012")); foreach (SysFunction subSystem in subSystemList) { PopupMenuTool pmt = new PopupMenuTool(subSystem.FunctionId); pmt.SharedProps.Caption = PadPopupMenuToolCaption(subSystem.FunctionName); pmt.DropDownArrowStyle = DropDownArrowStyle.None; pmt.Tag = subSystem; pmt.Settings.IconAreaAppearance.BackColor = Color.FromArgb(171, 206, 228); //pmt.CustomizedDisplayStyle = ToolDisplayStyle.ImageAndText; //pmt.CustomizedImage = Image.FromFile("./resource/image/mainMenu/directory.png"); toolbar.Tools.Add(pmt); toolbar.Toolbars[0].Tools.AddTool(subSystem.FunctionId); BandMainMenuSubNode(toolbar, pmt, list); } } }
public UcQueryResults() { InitializeComponent(); _stopwatch = new Stopwatch(); _isPinned = false; _sql = string.Empty; _isBusy = false; _maxResults = 100; _timingLabelTool = (LabelTool)_utm.Tools["Timing"]; _rowCountLabelTool = (LabelTool)_utm.Tools["Row Counts"]; _flagTool = (StateButtonTool)_utm.Tools["Flag"]; _showFilterTool = (StateButtonTool)_utm.Tools["Show Filter"]; _activityIndicatorTool = (ControlContainerTool)_utm.Tools["Activity Indicator"]; _stopButton = (ButtonTool)_utm.Tools["Stop"]; _exportToExcelTool = (ButtonTool)_utm.Tools["Export to Excel"]; _exportToCsvTool = (ButtonTool)_utm.Tools["Export to CSV"]; _exportToTextTool = (ButtonTool)_utm.Tools["Export to Text"]; _commitTool = (ButtonTool)_utm.Tools["Commit"]; _rollbackTool = (ButtonTool)_utm.Tools["Rollback"]; _fetchAllRowsTool = (ButtonTool)_utm.Tools["Fetch All Rows"]; _fetchMoreRowsTool = (ButtonTool)_utm.Tools["Fetch More Rows"]; _refreshQueryResultsTool = (ButtonTool)_utm.Tools["Refresh"]; _copyTool = (ButtonTool)_utm.Tools["Copy"]; _copyWithHeaders = (ButtonTool)_utm.Tools["Copy w/ Headers"]; _copyForSql = (ButtonTool)_utm.Tools["Copy for SQL IN Clause"]; _visualizedataTool = (ButtonTool)_utm.Tools["Visualize Data"]; _gridMenuTool = (PopupMenuTool)_utm.Tools["GridPopupMenu"]; _gridMenuTool.BeforeToolDropdown += (sender, args) => RefreshUserInterface(); RefreshUserInterface(); }
protected void txtBusquedaProducto_TextChanged(object sender, EventArgs e) { try { if (hdnProducto.Value != "") { if (hdnListaPrecio.Value != "") { txtBusquedaProducto.Text = ""; LabelTool.ShowSingleLabel(lblMsgMdlError, "Bien!", System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle('#mdlError');", true); } else { LabelTool.ShowSingleLabel(lblMsgMdlError, "El cliente no cuenta con una lista de precios. No se pueden agregar productos.", System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle('#mdlError');", true); } } else { LabelTool.ShowSingleLabel(lblMsgMdlError, "Ocurrió un error al obtener el producto.", System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle('#mdlError');", true); } } catch (Exception ex) { LabelTool.ShowSingleLabel(lblMsgMdlError, ex.Message, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle('#mdlError');", true); } }
protected void lnkMdlModificar_Click(object sender, EventArgs e) { try { string sAviso = ""; if (Convert.ToInt32(Session["Tipo"]) == 1) { ClientesBLL.Cliente(2, Convert.ToInt32(keycontainer.Value), Convert.ToInt32(Session["Company"]), txtNombreFisicas2.Text.ToUpper(), txtPaterno2.Text.ToUpper(), txtMaterno2.Text.ToUpper(), txtNombreFisicas2.Text.ToUpper() + " " + txtPaterno2.Text.ToUpper() + " " + txtMaterno2.Text.ToUpper(), txtNombreCortoFisicas2.Text.ToUpper(), txtRFCFisicas2.Text.ToUpper(), txtCURP2.Text.ToUpper(), Convert.ToDateTime(txtFechaNacimiento2.Text), txtCelular2.Text, txtCorreoFisicas2.Text, "F", Convert.ToDateTime(DateTime.Today), 1, Convert.ToInt32(hdnNumero_Domicilio.Value), txtDomicilio2.Text.ToUpper(), txtColonia2.Text.ToUpper(), txtDelMun2.Text.ToUpper(), txtCP2.Text, txtEstado2.Text.ToUpper(), "", txtTelefonoDomicilio2.Text, "", 1, "", Convert.ToInt32(drpListaPrecios2.SelectedValue)); sAviso = txtNombreFisicas2.Text.ToUpper() + " " + txtPaterno2.Text.ToUpper() + " " + txtMaterno2.Text.ToUpper(); } else { ClientesBLL.Cliente(2, Convert.ToInt32(keycontainer.Value), Convert.ToInt32(Session["Company"]), txtNombreMorales2.Text.ToUpper(), "", "", "", txtNombreCortoMorales2.Text.ToUpper(), txtRFCMorales2.Text.ToUpper(), "", Convert.ToDateTime(DateTime.Today), "", txtCorreoMorales2.Text, "M", Convert.ToDateTime(DateTime.Today), 1, Convert.ToInt32(hdnNumero_Domicilio.Value), txtDomicilio2.Text.ToUpper(), txtColonia2.Text.ToUpper(), txtDelMun2.Text.ToUpper(), txtCP2.Text, txtEstado2.Text.ToUpper(), "", txtTelefonoDomicilio2.Text, "", 1, "", Convert.ToInt32(drpListaPrecios2.SelectedValue)); sAviso = txtNombreMorales2.Text.ToUpper(); } LabelTool.ShowSingleLabel(lblMdlAviso, "Se modificaron los datos de " + sAviso, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlAviso');", true); } catch (Exception ex) { LabelTool.ShowSingleLabel(lblMsgMdlError, ex.Message, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlError');", true); } }
protected void lnkAgregar_Click(object sender, EventArgs e) { try { LabelTool.HideLabel(divMensaje2, spnMensaje2, lblMensaje2); if (txtElemento.Text != "") { if (!dtElementos.Columns.Contains("Numero")) { dtElementos.Columns.Add("Numero", typeof(string)); } if (!dtElementos.Columns.Contains("Elemento")) { dtElementos.Columns.Add("Elemento", typeof(string)); } DataRow dr = dtElementos.NewRow(); dr["Numero"] = dtElementos.Rows.Count + 1; dr["Elemento"] = txtElemento.Text.ToString().ToUpper(); dtElementos.Rows.Add(dr); txtElemento.Text = ""; GridViewTool.Bind(dtElementos, grvElementos); SetFocus(txtElemento); lblContadorElemento.Text = dtElementos.Rows.Count.ToString(); } } catch (Exception ex) { LabelTool.ShowLabel(divMensaje2, spnMensaje2, lblMensaje2, ex.Message, 'd'); } }
protected void lnkModificarDatos_Click(object sender, EventArgs e) { try { if (hdnValidacion.Value == "") { if (drpListaPrecios2.Items.Count > 0) { ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlModificarCliente');", true); } else { LabelTool.ShowSingleLabel(lblMdlListaPrecio, "Para modificar un cliente debe tener listas de precios registradas.", System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlListaPrecio');", true); } } else { LabelTool.ShowSingleLabel(lblMsgMdlError, hdnValidacion.Value, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlError');", true); } } catch (Exception ex) { LabelTool.ShowSingleLabel(lblMsgMdlError, ex.Message, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlError');", true); } }
protected void lnkGuardar_Click(object sender, EventArgs e) { try { if (txtNombreLista.Text != "") { if (ValidarDatosGrid()) { DataTable dtLista = LlenaTablaLista(); PreciosBLL.Lista(1, 0, 0, 0, null, 0, 0, 0, 0, dtLista); LabelTool.ShowSingleLabel(lblMsgMdlMensaje, "Se guardaron los datos.", System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlMensaje');", true); } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlError');", true); } } else { SetFocus(txtNombreLista); LabelTool.ShowSingleLabel(lblMsgMdlError, "Asigne un nombre a la lista.", System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlError');", true); } } catch (Exception ex) { LabelTool.ShowSingleLabel(lblMsgMdlError, ex.Message, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlError');", true); } }
protected void lnkAgregar_Click(object sender, EventArgs e) { try { LabelTool.HideLabel(divMensaje2, spnMensaje2, lblMensaje2); if (hdnValidacion.Value == "") { DataRow dr = dtProductos.NewRow(); dr["Producto"] = txtProducto.Text.ToUpper(); dr["Caracteristicas"] = txtCaracteristicas.Text.ToUpper(); dr["Precio"] = txtPrecio.Text; dr["Clave"] = txtClave.Text; dr["Codigo"] = txtCodigoBarras.Text; dtProductos.Rows.Add(dr); GridViewTool.Bind(dtProductos, grvProductos); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "LimpiarDatos();", true); } else { throw new Exception(hdnValidacion.Value); } } catch (Exception ex) { Label lblError = this.Master.FindControl("lblError") as Label; LabelTool.ShowSingleLabel(lblError, ex.Message, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle('#mdlError');", true); } }
private void LlenarGridClientes() { try { dtClientesFisicos = ClientesBLL.ObtenerClientesPorPersonalidad(Convert.ToInt32(Session["Company"]), 1); dtClientesMorales = ClientesBLL.ObtenerClientesPorPersonalidad(Convert.ToInt32(Session["Company"]), 0); if (dtClientesFisicos.Rows.Count > 0) { iNumero_Columnas_Fisicas = dtClientesFisicos.Columns.Count; GridViewTool.Bind(dtClientesFisicos, grvClientesFisicos); } else { LabelTool.ShowLabel(divAlertFisicas, spnDivAlertFisicas, lblDivAlertFisicas, "No hay clientes con personalidad fisica", 'i'); } if (dtClientesMorales.Rows.Count > 0) { iNumero_Columnas_Morales = dtClientesMorales.Columns.Count; GridViewTool.Bind(dtClientesMorales, grvClientesMorales); } else { LabelTool.ShowLabel(divAlertMorales, spnDivAlertMorales, lblDivAlertMorales, "No hay clientes con personalidad moral", 'i'); } } catch (Exception ex) { LabelTool.ShowSingleLabel(lblMsgMdlError, ex.Message, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle('#mdlError');", true); } }
protected void txtPrecioFinalGrv_TextChanged(object sender, EventArgs e) { try { TextBox sndr = sender as TextBox; string name = Convert.ToString(sndr.ClientID); string[] id = name.Split('_'); if (id[2].Equals("txtPrecioFinalGrv")) { TextBox txt = (TextBox)sender; GridViewRow row = (GridViewRow)txt.NamingContainer; TextBox txtPrecioFinal = (TextBox)row.FindControl("txtPrecioFinalGrv"); if (txtPrecioFinal.Text != "") { decimal precio = Convert.ToDecimal(grvProductosLista.DataKeys[row.RowIndex].Values["Precio"].ToString()); decimal preciofinal = Convert.ToDecimal(txtPrecioFinal.Text); decimal utilidad = preciofinal - precio; decimal porcentaje = (utilidad * 100) / precio; TextBox txtPorcentaje = (TextBox)row.FindControl("txtPorcentajeGrv"); txtPorcentaje.Text = porcentaje.ToString("f4"); row.Cells[5].Text = utilidad.ToString("f4"); } else { TextBox txtPorcentaje = (TextBox)row.FindControl("txtPorcentajeGrv"); txtPorcentaje.Text = ""; row.Cells[5].Text = ""; } } else if (id[2].Equals("txtPrecioFinalGrv2")) { TextBox txt = (TextBox)sender; GridViewRow row = (GridViewRow)txt.NamingContainer; TextBox txtPrecioFinal = (TextBox)row.FindControl("txtPrecioFinalGrv2"); if (txtPrecioFinal.Text != "") { decimal precio = Convert.ToDecimal(grvListas.DataKeys[row.RowIndex].Values["Precio"].ToString()); decimal preciofinal = Convert.ToDecimal(txtPrecioFinal.Text); decimal utilidad = preciofinal - precio; decimal porcentaje = (utilidad * 100) / precio; TextBox txtPorcentaje = (TextBox)row.FindControl("txtPorcentajeGrv2"); txtPorcentaje.Text = porcentaje.ToString("f4"); row.Cells[5].Text = utilidad.ToString("f4"); } else { TextBox txtPorcentaje = (TextBox)row.FindControl("txtPorcentajeGrv2"); txtPorcentaje.Text = ""; row.Cells[5].Text = ""; } } } catch (Exception ex) { LabelTool.ShowSingleLabel(lblMsgMdlError, ex.Message, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle('#mdlError');", true); } }
protected void txtBusqueda_TextChanged(object sender, EventArgs e) { try { divAccionesCliente.Visible = false; if (keycontainer.Value != "") { txtBusqueda.Text = ""; DataTable dt = ClientesBLL.ObtenerDatosCliente(Convert.ToInt32(Session["Company"]), Convert.ToInt32(keycontainer.Value)); hdnNumero_Domicilio.Value = dt.Rows[0]["Numero_Domicilio"].ToString(); txtDomicilio2.Text = dt.Rows[0]["Domicilio"].ToString(); txtColonia2.Text = dt.Rows[0]["Colonia"].ToString(); txtCP2.Text = dt.Rows[0]["Codigo_Postal"].ToString(); txtDelMun2.Text = dt.Rows[0]["Delegacion_Municipio"].ToString(); txtEstado2.Text = dt.Rows[0]["Estado"].ToString(); txtTelefonoDomicilio2.Text = dt.Rows[0]["Telefono"].ToString(); DataTable dt2 = ClientesBLL.ObtenerListaPrecios(Convert.ToInt32(Session["Company"])); if (dt2.Rows.Count > 0) { DropTool.FillDrop(drpListaPrecios2, dt2, "Descripcion", "Numero"); drpListaPrecios2.SelectedValue = drpListaPrecios2.Items.FindByValue(dt.Rows[0]["Lista_Precio"].ToString()).Value; } if (Convert.ToInt32(drpTipoPersona2.SelectedValue) == 1) { txtNombreFisicas2.Text = dt.Rows[0]["Nombre"].ToString(); txtPaterno2.Text = dt.Rows[0]["Paterno"].ToString(); txtMaterno2.Text = dt.Rows[0]["Materno"].ToString(); txtNombreCortoFisicas2.Text = dt.Rows[0]["Nombre_Corto"].ToString(); txtCURP2.Text = dt.Rows[0]["CURP"].ToString(); txtRFCFisicas2.Text = dt.Rows[0]["RFC"].ToString(); txtFechaNacimiento2.Text = dt.Rows[0]["Fecha_Nacimiento"].ToString(); txtCelular2.Text = dt.Rows[0]["Celular"].ToString(); txtCorreoFisicas2.Text = dt.Rows[0]["Correo_Electronico"].ToString(); lblMdlEliminarCliente.Text = "El cliente " + dt.Rows[0]["Nombre"].ToString() + " " + dt.Rows[0]["Paterno"].ToString() + " " + dt.Rows[0]["Materno"].ToString() + " se eliminará de forma permanente. ¿Desea continuar?"; lblMdlModificarCliente.Text = "Los datos del cliente " + dt.Rows[0]["Nombre"].ToString() + " " + dt.Rows[0]["Paterno"].ToString() + " " + dt.Rows[0]["Materno"].ToString() + " serán modificados. ¿Desea continuar?"; txtNombreFisicas2.Focus(); } else { txtNombreMorales2.Text = dt.Rows[0]["Nombre"].ToString(); txtNombreCortoMorales2.Text = dt.Rows[0]["Nombre_Corto"].ToString(); txtRFCMorales2.Text = dt.Rows[0]["RFC"].ToString(); txtCorreoMorales2.Text = dt.Rows[0]["Correo_Electronico"].ToString(); lblMdlEliminarCliente.Text = "El cliente " + dt.Rows[0]["Nombre"].ToString() + " se eliminará de forma permanente. ¿Desea continuar?"; lblMdlModificarCliente.Text = "Los datos del cliente " + dt.Rows[0]["Nombre"].ToString() + " serán modificados. ¿Desea continuar?"; txtNombreMorales2.Focus(); } divAccionesCliente.Visible = true; } } catch (Exception ex) { LabelTool.ShowSingleLabel(lblMsgMdlError, ex.Message, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle('#mdlError');", true); } }
private bool ValidarCampos() { if (hdnValidacion.Value != "" && hdnValidacion.Value != null) { LabelTool.ShowLabel(divMensaje2, spnMensaje2, lblMensaje2, hdnValidacion.Value, 'w'); return(false); } return(true); }
protected void lnkEntrar_Click(object sender, EventArgs e) { try { ValidarSesion(); } catch (Exception ex) { LabelTool.ShowLabel(divMensaje, spnMensaje, lblMensaje, ex.Message, 'd'); } }
protected void drpListaPrecio_SelectedIndexChanged(object sender, EventArgs e) { try { LlenarGridListaPrecios(); } catch (Exception ex) { LabelTool.ShowSingleLabel(lblMsgMdlError, ex.Message, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle('#mdlError');", true); } }
protected void grvElementos_SelectedIndexChanged(object sender, EventArgs e) { try { GridViewRow row = grvElementos.SelectedRow; dtElementos.Rows.RemoveAt(row.RowIndex); GridViewTool.Bind(dtElementos, grvElementos); lblContadorElemento.Text = dtElementos.Rows.Count.ToString(); } catch (Exception ex) { LabelTool.ShowLabel(divMensaje2, spnMensaje2, lblMensaje2, ex.Message, 'd'); } }
private void LlenarDropListaPrecios() { DataTable dt = ClientesBLL.ObtenerListaPrecios(Convert.ToInt32(Session["Company"])); if (dt.Rows.Count > 0) { DropTool.FillDrop(drpListaPrecios, dt, "Descripcion", "Numero"); } else { LabelTool.ShowLabel(divMsj, spnMsj, lblMsj, "No tienes listas de precios, no se daran de alta los usuarios sin una lista", 'i'); } }
private void ValidarSesion() { string sUsr = txtUsr.Text.Trim(); string sPswd = txtPswd.Text.Trim(); if (sUsr.Contains('@')) { if (BusquedaUsuario(sUsr, 1)) { if (ValidarPassword(sPswd)) { PermitirAcceso(); } else { LabelTool.ShowLabel(divMensaje, spnMensaje, lblMensaje, "La contraseña que has introducido es incorrecta", 'd'); } } else { LabelTool.ShowLabel(divMensaje, spnMensaje, lblMensaje, "No encontramos una cuenta con ese correo electrónico.", 'd'); } } else { double iNumero_Telefono; bool bandera = double.TryParse(sUsr, out iNumero_Telefono); if (bandera == true) { if (BusquedaUsuario(sUsr, 2)) { if (ValidarPassword(sPswd)) { PermitirAcceso(); } else { LabelTool.ShowLabel(divMensaje, spnMensaje, lblMensaje, "La contraseña que has introducido es incorrecta", 'd'); } } else { LabelTool.ShowLabel(divMensaje, spnMensaje, lblMensaje, "No encontramos una cuenta con ese número de teléfono.", 'd'); } } else { LabelTool.ShowLabel(divMensaje, spnMensaje, lblMensaje, "Introduzca una cuenta de correo o teléfono valido.", 'd'); } } }
private void LlenarDropListaPrecios() { DataTable dt = ClientesBLL.ObtenerListaPrecios(Convert.ToInt32(Session["Company"])); if (dt.Rows.Count > 0) { DropTool.FillDrop(drpListaPrecio, dt, "Descripcion", "Numero"); LlenarGridListaPrecios(); } else { LabelTool.ShowLabel(divMsj, spnMsj, lblMsj, "No se han registrado listas de precios", 'i'); } }
protected void drpTipoPersona_SelectedIndexChanged(object sender, EventArgs e) { try { DropDownList sndr = sender as DropDownList; string name = Convert.ToString(sndr.ClientID); string[] id = name.Split('_'); if (id[1].Equals("drpTipoPersona")) { int i = Convert.ToInt32(drpTipoPersona.SelectedValue); if (i == 1) { Session["Tipo"] = 1; divFisicas.Visible = true; divMorales.Visible = false; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "LimpiarDatos();", true); } else { Session["Tipo"] = 0; divFisicas.Visible = false; divMorales.Visible = true; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "LimpiarDatos();", true); } } else if (id[1].Equals("drpTipoPersona2")) { int i = Convert.ToInt32(drpTipoPersona2.SelectedValue); if (i == 1) { Session["Tipo"] = 1; divFisicas2.Visible = true; divMorales2.Visible = false; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "LimpiarDatos2();", true); } else { Session["Tipo"] = 0; divFisicas2.Visible = false; divMorales2.Visible = true; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "LimpiarDatos2();", true); } } } catch (Exception ex) { LabelTool.ShowSingleLabel(lblMsgMdlError, ex.Message, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle('#mdlError');", true); } }
protected void lnkGuardar_Click(object sender, EventArgs e) { try { if (hdnValidacion.Value == "") { if (drpListaPrecios.Items.Count > 0) { string sAviso = ""; if (Convert.ToInt32(Session["Tipo"]) == 1) { ClientesBLL.Cliente(1, 0, Convert.ToInt32(Session["Company"]), txtNombreFisicas.Text.ToUpper(), txtPaterno.Text.ToUpper(), txtMaterno.Text.ToUpper(), txtNombreFisicas.Text.ToUpper() + " " + txtPaterno.Text.ToUpper() + " " + txtMaterno.Text.ToUpper(), txtNombreCortoFisicas.Text.ToUpper(), txtRFCFisicas.Text.ToUpper(), txtCURP.Text.ToUpper(), Convert.ToDateTime(txtFechaNacimiento.Text), txtCelular.Text, txtCorreoFisicas.Text, "F", Convert.ToDateTime(DateTime.Today), 1, 0, txtDomicilio.Text.ToUpper(), txtColonia.Text.ToUpper(), txtDelMun.Text.ToUpper(), txtCP.Text, txtEstado.Text.ToUpper(), "", txtTelefonoDomicilio.Text, "", 1, "", Convert.ToInt32(drpListaPrecios.SelectedValue)); sAviso = txtNombreFisicas.Text.ToUpper() + " " + txtPaterno.Text.ToUpper() + " " + txtMaterno.Text.ToUpper(); } else { ClientesBLL.Cliente(1, 0, Convert.ToInt32(Session["Company"]), txtNombreMorales.Text.ToUpper(), "", "", "", txtNombreCortoMorales.Text.ToUpper(), txtRFCMorales.Text.ToUpper(), "", Convert.ToDateTime(DateTime.Today), "", txtCorreoMorales.Text, "M", Convert.ToDateTime(DateTime.Today), 1, 0, txtDomicilio.Text.ToUpper(), txtColonia.Text.ToUpper(), txtDelMun.Text.ToUpper(), txtCP.Text, txtEstado.Text.ToUpper(), "", txtTelefonoDomicilio.Text, "", 1, "", Convert.ToInt32(drpListaPrecios.SelectedValue)); sAviso = txtNombreMorales.Text.ToUpper(); } LabelTool.ShowSingleLabel(lblMdlAviso, sAviso + " se registró como cliente.", System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlAviso');", true); } else { LabelTool.ShowSingleLabel(lblMdlListaPrecio, "Para dar de alta un cliente debe tener listas de precios registradas.", System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlListaPrecio');", true); } } else { LabelTool.ShowSingleLabel(lblMsgMdlError, hdnValidacion.Value, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlError');", true); } } catch (Exception ex) { LabelTool.ShowSingleLabel(lblMsgMdlError, ex.Message, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlError');", true); } }
private void LlenarGridProductosAlmacen() { try { dtProductosAlmacen = AlmacenBLL.ObtenerProductosDisponibles(Convert.ToInt32(Session["Company"])); if (dtProductosAlmacen.Rows.Count > 0) { DataTable dtAlmacenes = AlmacenBLL.ObtenerAlmacenes(Convert.ToInt32(Session["Company"])); if (dtAlmacenes.Rows.Count > 0) { DataTable dtMovimientos = AlmacenBLL.ObtenerMovimientosAlmacen(Convert.ToInt32(Session["Company"])); if (dtMovimientos.Rows.Count > 0) { GridViewTool.Bind(dtProductosAlmacen, grvProductosAlmacen); foreach (GridViewRow row in grvProductosAlmacen.Rows) { DropDownList drpAlmacen = (DropDownList)row.FindControl("drpAlmacenGrv"); DropTool.FillDrop(drpAlmacen, dtAlmacenes, "Descripcion", "Numero"); DropDownList drpMovimientos = (DropDownList)row.FindControl("drpMovimientoGrv"); DropTool.FillDrop(drpMovimientos, dtMovimientos, "Descripcion", "Numero"); } DropDownList drpAlmacenGrvTodos = (DropDownList)grvProductosAlmacen.HeaderRow.FindControl("drpAlmacenGrvTodos"); DropDownList drpMovimientoGrvTodos = (DropDownList)grvProductosAlmacen.HeaderRow.FindControl("drpMovimientoGrvTodos"); DropTool.FillDrop(drpAlmacenGrvTodos, dtAlmacenes, "Descripcion", "Numero"); DropTool.FillDrop(drpMovimientoGrvTodos, dtMovimientos, "Descripcion", "Numero"); } else { LabelTool.ShowSingleLabel(lblMsgMdlError, "Sin movimientos disponibles para el almacen", System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle('#mdlError'); ToolTip();", true); } } else { LabelTool.ShowSingleLabel(lblMsgMdlError, "No tienes almacenes disponibles", System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle('#mdlError'); ToolTip();", true); } } else { LabelTool.ShowLabel(divMsj, spnMsj, lblMsj, "No tienes productos disponibles", 'i'); } } catch (Exception ex) { LabelTool.ShowSingleLabel(lblMsgMdlError, ex.Message, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle('#mdlError'); ToolTip();", true); } }
private void PermitirAcceso() { try { DataTable dt = DefaultBLL.GetUserData(iNumero_Usuario); Session["Company"] = dt.Rows[0]["Empresa"].ToString(); Session["Person"] = dt.Rows[0]["Numero"].ToString(); Session["NamePerson"] = dt.Rows[0]["Nombre"].ToString(); Response.Redirect("Productos.aspx"); } catch (Exception ex) { LabelTool.ShowLabel(divMensaje, spnMensaje, lblMensaje, ex.Message, 'd'); } }
protected void grvProductos_SelectedIndexChanged(object sender, EventArgs e) { try { GridViewRow row = grvProductos.SelectedRow; dtProductos.Rows.RemoveAt(row.RowIndex); GridViewTool.Bind(dtProductos, grvProductos); } catch (Exception ex) { Label lblError = this.Master.FindControl("lblError") as Label; LabelTool.ShowSingleLabel(lblError, ex.Message, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle('#mdlError');", true); } }
protected void grvClientesMorales_SelectedIndexChanged(object sender, EventArgs e) { try { GridViewRow row = grvClientesMorales.SelectedRow; int iNumero_Cliente = Convert.ToInt32(grvClientesMorales.DataKeys[row.RowIndex].Values["Numero"]); keycontainer.Value = iNumero_Cliente.ToString(); txtBusquedaCliente_TextChanged(null, null); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "ToolTip();", true); } catch (Exception ex) { LabelTool.ShowSingleLabel(lblMsgMdlError, ex.Message, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle('#mdlError');", true); } }
protected void lnkGuardar_Click(object sender, EventArgs e) { try { LabelTool.HideLabel(divMensaje2, spnMensaje2, lblMensaje2); if (ValidarCampos()) { LabelTool.ShowLabel(divMensaje2, spnMensaje2, lblMensaje2, "Todo bien.", 's'); //DataTable dtClasificacion = LlenarTabla(); //ClasificacionBLL.InsertarClasificacion(1, 1, 0, null, null, null, dtClasificacion); } } catch (Exception ex) { LabelTool.ShowLabel(divMensaje2, spnMensaje2, lblMensaje2, ex.Message, 'd'); } }
protected void lnkMdlEliminar_Click(object sender, EventArgs e) { try { ClientesBLL.Cliente(3, Convert.ToInt32(keycontainer.Value), Convert.ToInt32(Session["Company"]), "", "", "", "", "", "", "", Convert.ToDateTime(DateTime.Today), "", "", "M", Convert.ToDateTime(DateTime.Today), 1, Convert.ToInt32(hdnNumero_Domicilio.Value), "", "", "", "", "", "", "", "", 1, "", Convert.ToInt32(drpListaPrecios2.SelectedValue)); LabelTool.ShowSingleLabel(lblMdlAviso, "El cliente ha sido eliminado.", System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlAviso');", true); } catch (Exception ex) { LabelTool.ShowSingleLabel(lblMsgMdlError, ex.Message, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlError');", true); } }
protected void lnkModificar_Click(object sender, EventArgs e) { try { if (txtNombre.Text != "") { if (ValidarDatosGrid2()) { DataTable dtLista = CrearTablaLista(); int iNumero_Producto, iEmpresa = Convert.ToInt32(Session["Company"]); decimal dPrecio_Compra, dUtilidad, dPorcentaje, dPrecio_Final; string sNombre = txtNombre.Text; foreach (GridViewRow row in grvListas.Rows) { iNumero_Producto = Convert.ToInt32(grvListas.DataKeys[row.RowIndex].Values["Numero"]); dPrecio_Compra = Convert.ToDecimal(grvListas.DataKeys[row.RowIndex].Values["Precio"]); dUtilidad = Convert.ToDecimal(row.Cells[5].Text); TextBox txtPrecioFinal = (TextBox)row.FindControl("txtPrecioFinalGrv2"); TextBox txtPorcentaje = (TextBox)row.FindControl("txtPorcentajeGrv2"); dPorcentaje = Convert.ToDecimal(txtPorcentaje.Text); dPrecio_Final = Convert.ToDecimal(txtPrecioFinal.Text); PreciosBLL.Lista(2, Convert.ToInt32(drpListaPrecio.SelectedValue), iEmpresa, iNumero_Producto, null, dPrecio_Compra, dPorcentaje, dPrecio_Final, dUtilidad, dtLista); } PreciosBLL.Lista(4, Convert.ToInt32(drpListaPrecio.SelectedValue), iEmpresa, 0, sNombre, 0, 0, 0, 0, dtLista); LabelTool.ShowSingleLabel(lblMsgMdlMensaje, "Se modificaron los datos.", System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlMensaje');", true); } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlError');", true); } } else { SetFocus(txtNombre); LabelTool.ShowSingleLabel(lblMsgMdlError, "Asigne un nombre a la lista.", System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlError');", true); } } catch (Exception ex) { LabelTool.ShowSingleLabel(lblMsgMdlError, ex.Message, System.Drawing.Color.Black); ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "mdlToggle2('#mdlProceso','#mdlError');", true); } }