private void Validar_Tiempo() { int idUser = 1;//Convert.ToInt32(Session["userID"].ToString()); CLS_MASTER master = new CLS_MASTER(); int result = master.FS_01_GUI_CHECK_TIEMPO(idUser); if (result != -1) { //btn_Iniciar.Visible = false; //btn_finalizar.Visible = true; DataTable dataTiempo = new DataTable(); dataTiempo = master.SP_27_GET_TIEMPO(idUser); if (dataTiempo != null && dataTiempo.Rows.Count > 0) { string fecha = $"{dataTiempo.Rows[0]["FECHA_HORA_INICIO"].ToString()}"; //lbl_FechaIngreso.Text = $"In: {fecha}"; //lbl_FechaIngreso.CssClass = "badge badge-success col-12"; } } else { btn_Iniciar.Visible = true; btn_finalizar.Visible = false; lbl_FechaIngreso.Text = $"In: {Convert.ToString(DateTime.Now)}"; lbl_FechaIngreso.CssClass = "badge badge-danger col-12"; } }
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) { } }