protected void Cargar_Datos_Perfil() { I_Base_DatosClient cliente = new I_Base_DatosClient(); if (Session["UsuarioPerfil"].ToString().Equals("1")) { foreach (var item in cliente.View_Email_Admins(txt_Correo.Text.Trim())) { try { CargarCamposTrabajo(item.SNombre.ToString(), item.SIdentificacion.ToString(), item.SDireccion.ToString(), item.STelefono.ToString()); } catch (Exception) { lbl_Error.Text = "Error de formato de busqueda, seleccione la opcion Correcta "; } } } else if (Session["UsuarioPerfil"].ToString().Equals("2")) { foreach (var item in cliente.View_Email_Users(txt_Correo.Text.Trim())) { try { CargarCamposTrabajo(item.SNombre.ToString(), item.SIdentificacion.ToString(), item.SDireccion.ToString(), item.STelefono.ToString()); } catch (Exception) { lbl_Error.Text = "Error de formato de busqueda, seleccione la opcion Correcta "; } } } }
protected void btn_eliminar_Click(object sender, EventArgs e) { I_Base_DatosClient cliente = new I_Base_DatosClient(); lblErrorBorrado.Text = cliente.Eliminar_Producto(Text_eliminar.Text); CargarListaProductos(); LimpiarCampos(); }
protected void btn_Eliminar_Click(object sender, EventArgs e) { I_Base_DatosClient cliente = new I_Base_DatosClient(); lbl_Error.Text = cliente.Delete_User_Account_Por_Admin(TextCorreo.Text); CargarListaEmpleados(); LimpiarCampos(); }
protected void txt_Buscar_TextChanged(object sender, EventArgs e) { I_Base_DatosClient cliente = new I_Base_DatosClient(); DataTable myDataTable = new DataTable(); string SMsError = string.Empty; //DataTable myDataTable = cliente.ListarDatos("SP_Filtrar", ref SMsError); if (txt_Buscar.Text.Trim() != string.Empty) { myDataTable = cliente.FiltrarDatos("SP_View_Name_Users", "@Nombre", SqlDbType.NVarChar, txt_Buscar.Text.Trim(), ref SMsError); } else { myDataTable = cliente.ListarDatos("SP_View_All_Users", ref SMsError); } if (SMsError != string.Empty) { lbl_Error.Text = "Hay un error " + SMsError.ToString(); GV_ALL_CLIENT.DataSource = null; } else { GV_ALL_CLIENT.DataSource = myDataTable; } }
protected void btn_ActualizarDatos_Cliente_Click(object sender, EventArgs e) { I_Base_DatosClient cliente = new I_Base_DatosClient(); lbl_Error.Text = cliente.Update_Account(txt_Correo.Text, txt_Nombre.Text, txt_Identificacion.Text, txt_Direccion.Text, txt_Telefono.Text); Cargar_Datos_Perfil(); }
protected void btn_Actualizar_Click(object sender, EventArgs e) { I_Base_DatosClient cliente = new I_Base_DatosClient(); lbl_Error.Text = cliente.Update_Account(TextCorreo.Text, TextNombre.Text, TextIdentificacion.Text, TextDireccion.Text, TextTelefono.Text); CargarListaEmpleados(); LimpiarCampos(); }
protected void btn_CrearCuentaEmpleado_Click(object sender, EventArgs e) { I_Base_DatosClient cliente = new I_Base_DatosClient(); lbl_Resultados.Text = cliente.Create_Employee_Account(Text_Email.Text, Text_Nom.Text, Text_Id.Text, Text_Dir.Text, Text_Tel.Text, Text_Pass.Text); CargarListaEmpleados(); LimpiarCampos(); }
protected void Validar_Estatus() { I_Base_DatosClient cliente = new I_Base_DatosClient(); if (cliente.View_User_Status(TextCorreo.Text)) { TextStatus.Text = "Activo"; } else { TextStatus.Text = "Inactivo"; } }
protected void btn_ChangeStatus_Click(object sender, EventArgs e) { I_Base_DatosClient cliente = new I_Base_DatosClient(); if (ChangeStatus.SelectedValue.Equals("Activo")) { cliente.Lock_User_Account(TextCorreo.Text, true); } else if (ChangeStatus.SelectedValue.Equals("Inactivo")) { cliente.Lock_User_Account(TextCorreo.Text, false); } LimpiarCampos(); }
protected void CargarListaDetalleVentas() { I_Base_DatosClient cliente = new I_Base_DatosClient(); string SMsError = string.Empty; DataTable myDataTable = cliente.ListarDatos("SP_View_Detalle_Ventas", ref SMsError); if (SMsError != string.Empty) { lbl_Error.Text = "Hay un error " + SMsError.ToString(); GV_ALL_Detalle_Ventas.DataSource = null; } else { GV_ALL_Detalle_Ventas.DataSource = myDataTable; GV_ALL_Detalle_Ventas.DataBind(); } }
protected void btn_Agregar_Articulo_Click(object sender, EventArgs e) { if ((Text_CodProducto.Text != string.Empty) & (Text_NomProducto.Text != string.Empty) & (Text_CodCategoria.Text != string.Empty) & (Text_PrecioProduc.Text != string.Empty) & (Text_CantidadStock.Text != string.Empty) & (Text_ImagenProducto.Text != string.Empty)) { I_Base_DatosClient cliente = new I_Base_DatosClient(); lbl_Resultados.Text = cliente.Insertar_Producto(Text_CodProducto.Text, Text_NomProducto.Text, Text_CodCategoria.Text, Text_PrecioProduc.Text, Text_CantidadStock.Text, Text_ImagenProducto.Text); CargarListaProductos(); LimpiarCampos(); } else { lbl_Resultados.Text = "Debe llenar todos los campos con informacion valida"; LimpiarCampos(); } }
protected void btn_CargarEmpleados_Click(object sender, EventArgs e) { I_Base_DatosClient cliente = new I_Base_DatosClient(); DataTable myDataTable = new DataTable(); myDataTable.Columns.Add("Correo Electronico"); myDataTable.Columns.Add("Nombre del Empleado"); myDataTable.Columns.Add("Numero de Identificacion"); myDataTable.Columns.Add("Direccion"); myDataTable.Columns.Add("Telefono"); myDataTable.Columns.Add("Tipo de Perfil"); if (this.SeleccionBusqueda.SelectedValue == "1") { foreach (var item in cliente.View_Email_Admins(txt_Buscar.Text.Trim())) { DataRow Fila = myDataTable.NewRow(); Fila["Correo Electronico"] = item.SCorreo; Fila["Nombre del Empleado"] = item.SNombre; Fila["Numero de Identificacion"] = item.SIdentificacion; Fila["Direccion"] = item.SDireccion; Fila["Telefono"] = item.STelefono; Fila["Tipo de Perfil"] = item.SNombrePerfil; myDataTable.Rows.Add(Fila); try { CargarCamposTrabajo(item.SCorreo.ToString(), item.SNombre.ToString(), item.SIdentificacion.ToString(), item.SDireccion.ToString(), item.STelefono.ToString(), item.SNombrePerfil.ToString()); lbl_Error.Text = string.Empty; } catch (Exception) { lbl_Error.Text = "Error de formato de busqueda, seleccione la opcion Correcta "; } } } else if (this.SeleccionBusqueda.SelectedValue == "2") { foreach (var item in cliente.View_Name_Admins(txt_Buscar.Text)) { DataRow Fila = myDataTable.NewRow(); Fila["Correo Electronico"] = item.SCorreo; Fila["Nombre del Empleado"] = item.SNombre; Fila["Numero de Identificacion"] = item.SIdentificacion; Fila["Direccion"] = item.SDireccion; Fila["Telefono"] = item.STelefono; Fila["Tipo de Perfil"] = item.SNombrePerfil; myDataTable.Rows.Add(Fila); try { CargarCamposTrabajo(item.SCorreo.ToString(), item.SNombre.ToString(), item.SIdentificacion.ToString(), item.SDireccion.ToString(), item.STelefono.ToString(), item.SNombrePerfil.ToString()); lbl_Error.Text = string.Empty; } catch (Exception) { lbl_Error.Text = "Error de formato de busqueda, seleccione la opcion Correcta "; } } } else if (this.SeleccionBusqueda.SelectedValue == "3") { foreach (var item in cliente.View_ID_Admins(txt_Buscar.Text.Trim())) { DataRow Fila = myDataTable.NewRow(); Fila["Correo Electronico"] = item.SCorreo; Fila["Nombre del Empleado"] = item.SNombre; Fila["Numero de Identificacion"] = item.SIdentificacion; Fila["Direccion"] = item.SDireccion; Fila["Telefono"] = item.STelefono; Fila["Tipo de Perfil"] = item.SNombrePerfil; myDataTable.Rows.Add(Fila); try { CargarCamposTrabajo(item.SCorreo.ToString(), item.SNombre.ToString(), item.SIdentificacion.ToString(), item.SDireccion.ToString(), item.STelefono.ToString(), item.SNombrePerfil.ToString()); lbl_Error.Text = string.Empty; } catch (Exception) { lbl_Error.Text = "Error de formato de busqueda, seleccione la opcion Correcta "; } } } Validar_Estatus(); this.GV_ALL_USER.DataSource = myDataTable; this.GV_ALL_USER.DataBind(); }