protected void btn_finalizar_Click(object sender, EventArgs e) { CLS_MASTER master = new CLS_MASTER(); int resul = master.SP_26_FINALIZAR_TIEMPO(Convert.ToInt32(Session["userID"].ToString())); if (resul > 0) { CLS_AUDITORIA audi = new CLS_AUDITORIA(); string IP = Request.UserHostAddress; audi.SP_02_INSERTAR_AUDITORIA("FINALIZAR TIEMPO", $"El usuario {Session["nombre_usuario"]} finalizi su tiempo de acceso en la plataforma", "MASTER", IP, Convert.ToInt32(Session["userID"].ToString())); } else { //Message_danger.Text = "Error al crear nota, por favor revise los datos"; //Message_danger.Visible = true; } Validar_Tiempo(); }
protected void btn_crearGasto_Click(object sender, EventArgs e) { CLS_MASTER master = new CLS_MASTER(); try { int resul = master.SP_20_INSERTAR_GASTO( bl_TipoProducto.SelectedValue, bl_CatProduc.SelectedValue, Convert.ToDecimal(txt_valor.Text), txt_descripcion.Value, null, Convert.ToDateTime(txt_FecPagoGasto.Text), Convert.ToDateTime(txt_fechRegistroGasto.Text), txt_observacion.Value, Convert.ToInt32(Session["userID"].ToString())); if (resul > 0) { CLS_AUDITORIA audi = new CLS_AUDITORIA(); string IP = Request.UserHostAddress; audi.SP_02_INSERTAR_AUDITORIA("CREAR NOTA", $"El usuario {Session["nombre_usuario"]} creo un nuevo gasto", "MASTER", IP, Convert.ToInt32(Session["userID"].ToString())); //NotasCliente(idCliente); //Message_Succes.Text = "Nota creada correctamente"; //Message_Succes.Visible = true; } else { //Message_danger.Text = "Error al crear nota, por favor revise los datos"; //Message_danger.Visible = true; } } catch (Exception) { } }
protected void btn_crearNota_Click(object sender, EventArgs e) { //string tes = test.Text; if (string.IsNullOrEmpty(txt_nota.Value) || string.IsNullOrWhiteSpace(txt_nota.Value)) { txt_nota.Focus(); Message_danger.Text = "la descripción de la nota es un campo obligatorio."; Message_danger.Visible = true; mpe_NuevaNota.Show(); return; } string idCliente = ""; try { idCliente = Id_Cliente.Value; } catch (Exception) { } string resllamada = ""; if (cbx_llamada.Checked) { resllamada = "SI_CONTESTO"; } else { resllamada = "NO_CONTESTO"; } //hf_tipoProducto.Value = "CUOTA"; //hf_Producto.Value = varName2; CLS_NOTAS cls_Cli = new CLS_NOTAS(); int resul = cls_Cli.SP_31_NUEVA_NOTA_LLAMADA(txt_nota.Value, Convert.ToInt32(1), "VISIBLE", "LLAMADAS", Convert.ToInt32(idCliente), hf_Producto.Value, hf_tipoProducto.Value, resllamada); if (resul > 0) { txt_nota.Value = ""; CLS_AUDITORIA audi = new CLS_AUDITORIA(); string IP = Request.UserHostAddress; string nombreCliente = "JUAN MARTINEZ";// $"{txt_PrimerNombre.Text} {txt_SegundoNombre.Text} {txt_Apellidos.Text}"; audi.SP_02_INSERTAR_AUDITORIA("CREAR NOTA", $"El usuario {Session["nombre_usuario"]} creo una nota al cliente {nombreCliente}", "LLAMADAS", IP, Convert.ToInt32(Session["userID"].ToString())); NotasCliente(idCliente); Message_Succes.Text = "Nota creada correctamente"; Message_Succes.Visible = true; } else { Message_danger.Text = "Error al crear nota, por favor revise los datos"; Message_danger.Visible = true; } btn_MostrarInfo_Click(null, null); }
protected void btn_AceptarCuotas_Click(object sender, EventArgs e) { //string tes = test.Text; if (string.IsNullOrEmpty(txt_ValorPagarTarjeta.Text) || string.IsNullOrWhiteSpace(txt_ValorPagarTarjeta.Text)) { if (string.IsNullOrEmpty(txt_ValorPagarEfectivo.Text) || string.IsNullOrWhiteSpace(txt_ValorPagarEfectivo.Text)) { txt_ValorPagarTarjeta.Focus(); Message_danger.Text = "El valor de la cuota es un campo obligatorio."; Message_danger.Visible = true; mpe_Cuotas.Show(); return; } } decimal total = Convert.ToDecimal(txt_ValorPagarTarjeta.Text) + Convert.ToDecimal(txt_ValorPagarEfectivo.Text); if (total < 1) { Message_danger.Text = "El valor pagado no puede ser menor a 0"; Message_danger.Visible = true; mpe_Cuotas.Show(); return; } string idCliente = ""; try { idCliente = Page.Request.QueryString["CLIENT_ID"].ToString(); } catch (Exception) { } string idProducto = hf_ID_PRODUCTO_CUOTA.Value; string idCuota = hf_IDCUOTA.Value; string estado = "PAGADO"; decimal valorCuota = Convert.ToDecimal(txt_valorCuota.Text); decimal valorTarjeta = Convert.ToDecimal(txt_ValorPagarTarjeta.Text); decimal valorEfectivo = Convert.ToDecimal(txt_ValorPagarEfectivo.Text); decimal valorRecargo = Convert.ToDecimal(txt_ValorPagarRecargo.Text); string observacion = txt_ObservacionCuota.Value; int idUser = Convert.ToInt32(Session["userID"].ToString()); decimal totalV = valorTarjeta + valorEfectivo - valorRecargo; CLS_PRODUCTOS cls_produ = new CLS_PRODUCTOS(); string idArchivo = ""; if (file_Cuotas.HasFile == true) { if (file_Cuotas.PostedFile.ContentLength > 100000) { Message_warning.Text = "El tamaño no puede ser mayo a 10 MB"; Message_warning.Visible = true; mpe_Produc.Show(); return; } idArchivo = GuardarArchivos(file_Cuotas); } int p_inf = 0; if (cbx_PagoInferior.Checked) { p_inf = 1; } else { p_inf = 0; } if (totalV > valorCuota) { p_inf = 1; } int resul = cls_produ.SP_23_ACTUALIZAR_CUOTAS(idProducto, idCuota, estado, valorCuota, valorTarjeta, valorEfectivo, valorRecargo, observacion, idUser, p_inf, 0, "False", 0, 0, 0); if (resul > 0) { txt_nota.Value = ""; if (!string.IsNullOrEmpty(idArchivo) && !string.IsNullOrWhiteSpace(idArchivo)) { cls_produ.SP_30_GUARDAR_FORMULARIO_ARCHIVOS(idArchivo, idCliente, idCuota, "CUOTAS"); } CLS_AUDITORIA audi = new CLS_AUDITORIA(); string IP = Request.UserHostAddress; string nombreCliente = "JUAN CAMILO"; //$"{txt_PrimerNombre.Text} {txt_SegundoNombre.Text} {txt_Apellidos.Text}"; audi.SP_02_INSERTAR_AUDITORIA("ACTUALIZAR CUOTA", $"El usuario {Session["nombre_usuario"]} actualizo el valor de una cuota {nombreCliente}", "VENTAS", IP, Convert.ToInt32(Session["userID"].ToString())); //ProductosCliente(idCliente); Message_Succes.Text = "Cuota actulizada correctamente correctamente"; Message_Succes.Visible = true; } else { Message_danger.Text = "Error al actulizar cuota, por favor revise los datos"; Message_danger.Visible = true; mpe_Cuotas.Show(); } btn_MostrarInfo_Click(null, null); }
protected void btn_login_Click(object sender, EventArgs e) { string usuario = txt_Usuario.Text; string contraseña = txt_Contraseña.Text; if (string.IsNullOrEmpty(usuario) || string.IsNullOrWhiteSpace(usuario)) { lbl_Mensaje.Text = "Username is required"; lbl_Mensaje.Visible = true; txt_Usuario.Focus(); } if (string.IsNullOrEmpty(contraseña) || string.IsNullOrWhiteSpace(contraseña)) { lbl_Mensaje.Text = "user password is required"; lbl_Mensaje.Visible = true; txt_Contraseña.Focus(); } string clave = Datos.CORE.CLS_CORE.Encrypt(txt_Contraseña.Text); Datos.LOGIN.DBA_LOGIN dba = new Datos.LOGIN.DBA_LOGIN(); int result = dba.FS_00_GUI_CHECK_LOGIN(usuario, clave); if (result != -1) { Session.Remove("userID"); string nombre = ""; //string foto = ""; DataSet dataUsuario = new DataSet(); dataUsuario = dba.SP_04_GET_DATOS_USUARIO(usuario); if (dataUsuario != null && dataUsuario.Tables.Count > 0) { int estado = dataUsuario.Tables[0].Rows[0].Field <int>("ID_ESTADO"); if ((int)(ESTADOS_USUARIO.Inactivo) == estado) { lbl_Mensaje.Text = "Usuario inactivo"; lbl_Mensaje.Visible = true; txt_Contraseña.Focus(); return; } nombre = dataUsuario.Tables[0].Rows[0]["NOMBRES"].ToString(); Session["usuario"] = usuario; Session["userID"] = dataUsuario.Tables[0].Rows[0]["ID_USUARIO"].ToString(); Session["roles"] = dataUsuario.Tables[0].Rows[0]["ROLES"].ToString(); Session["nombre_usuario"] = nombre; bool forzar = dataUsuario.Tables[0].Rows[0].Field <bool>("FORZAR_CAMBIO"); Session["forzar_contraseña"] = forzar; } //Registrar auditoria CLS_AUDITORIA audi = new CLS_AUDITORIA(); string IP = Request.UserHostAddress; audi.SP_02_INSERTAR_AUDITORIA("INICIO SESION", $"El usuario {nombre} inicio sesión", "LOGIN", IP, result); Session.Remove("Retries"); Session["Auth"] = "OK"; Session["userID"] = result; Response.Redirect("~/MODULOS/frm_Ventas.aspx?CLIENT_ID=0"); } else { lbl_Mensaje.Visible = true; string configCaptcha = System.Web.Configuration.WebConfigurationManager.AppSettings["enableCaptcha"]; string enableCaptcha = configCaptcha != null ? configCaptcha : "false"; //Ext.Net.X.AddScript("error('" + enableCaptcha + "');"); } }