protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { mAccionG = cAcciones.Obtner_AccionGenerada(int.Parse(Session["noAccion"].ToString())); lblFuente.InnerText = cFuente.nombreFuenteA(Session["noAccion"].ToString()); //txtanio.Text = mAccionG.anio_informe_ei.ToString(); cAcciones.dropUnidad(ddlunidad); ddlunidad.SelectedValue = mAccionG.id_unidad.ToString(); cAcciones.dllDependencia(ddldependencia, mAccionG.id_unidad); ddldependencia.SelectedValue = mAccionG.id_dependencia.ToString(); txtDescripcion.Text = mAccionG.descripcion.ToString(); txtEvaluacion.Text = Session["noAccion"].ToString(); txtHallazgo.Text = mAccionG.correlativo_hallazgo.ToString(); txtanio.Text = "2018"; cAcciones.dropUnidad(ddlunidad); cInfoCorrec = new cInformeCO(); //cInfoCorrec.ddlEstadoInforme(ddlEstado); cAcciones.dropTipoAccion(ddlTipoAccionInforme); ddlTipoAccionInforme.SelectedValue = mAccionG.id_tipo_accion.ToString(); cGen = new cGeneral(); } }
internal static void Load() { TomletMain.RegisterMapper(WriteColor, ReadColor); FilePath = Path.Combine(Core.FolderPath, "Config.cfg"); General = CreateCat <cGeneral>(FilePath, nameof(General)); bool UseDefault = true; if (!string.IsNullOrEmpty(General.Theme) && !General.Theme.Equals("Default") && !General.Theme.Equals("Random")) { try { // To-Do: Sanatize themeName General.Theme = General.Theme .Replace("\\", "") .Replace("/", ""); ThemePath = Path.Combine(Core.ThemesFolderPath, General.Theme); if (Directory.Exists(ThemePath)) { UseDefault = false; } else { throw new DirectoryNotFoundException(ThemePath); } } catch (Exception ex) { MelonLogger.Error($"Failed to find Start Screen Theme: {ex}"); } } if (General.Theme.Equals("Random")) { ThemePath = UIUtils.RandomFolder(Core.ThemesFolderPath); UseDefault = false; } if (UseDefault) { General.Theme = "Default"; ThemePath = Path.Combine(Core.ThemesFolderPath, General.Theme); if (!Directory.Exists(ThemePath)) { Directory.CreateDirectory(ThemePath); } } MelonLogger.Msg($"Using Start Screen Theme: \"{General.Theme}\""); Background = CreateCat <cBackground>(nameof(Background), true); LogoImage = CreateCat <LogoImageSettings>(nameof(LogoImage), true); LoadingImage = CreateCat <LoadingImageSettings>(nameof(LoadingImage), true); VersionText = CreateCat <VersionTextSettings>(nameof(VersionText), true); ProgressText = CreateCat <ProgressTextSettings>(nameof(ProgressText), true); ProgressBar = CreateCat <cProgressBar>(nameof(ProgressBar), true); MelonPreferences.SaveCategory <cGeneral>(nameof(General), false); }
internal static void Load() { FilePath = Path.Combine(Core.FolderPath, "Config.cfg"); TomletMain.RegisterMapper(WriteColor, ReadColor); General = CreateCat <cGeneral>(nameof(General)); Background = CreateCat <cBackground>(nameof(Background)); LogoImage = CreateCat <cLogoImage>(nameof(LogoImage)); LoadingImage = CreateCat <cLoadingImage>(nameof(LoadingImage)); VersionText = CreateCat <cVersionText>(nameof(VersionText)); ProgressText = CreateCat <cProgressText>(nameof(ProgressText)); ProgressBar = CreateCat <cProgressBar>(nameof(ProgressBar)); }
protected void btnEditar_Click(object sender, EventArgs e) { cGeneral cGeneral = new cGeneral(); mActividad.id_accion_realizar = int.Parse(Session["Actividad"].ToString()); mActividad.accion = txtAccionRealizar.Text; mActividad.responsable = txtResponsable.Text; mActividad.fecha_inicio = txtFechaInicio.Text; mActividad.fecha_fin = txtFechaFin.Text; mPlanAccion = cPlanAccion.Obtner_PlanAccion(int.Parse(Session["noAccion"].ToString())); DateTime fecha = Convert.ToDateTime(mPlanAccion.final_actividades); if (cGeneral.rangoFechas(mPlanAccion.final_actividades, txtFechaFin.Text, false) >= 60) { ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('Fecha inválida!','No puede exceder 60 días a partir del " + fecha.ToString("d 'de' MMMM 'de' yyyy") + "', 'error');", true); } else { if (mActividad.id_status == 2) { ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('No es posible editar la actividad!', 'La actividad ya ha sido revisada y validad', 'warning');", true); } else { cActividades.actualizarActividad(mActividad); cPlanAccion.actualizar_statusPlan(int.Parse(Session["noPlanAccion"].ToString()), 6); btnGuardar.Visible = true; limpiarActividad(); visibleActividad(false); enabledActividad(true); gvListado.DataSource = cPlanAccion.ListadoAccionesRealizar(int.Parse(Session["noPlanAccion"].ToString())); gvListado.DataBind(); btnFinalizar.Enabled = true; ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('Actividad actualizada exitosamente!', '', 'success');", true); } } }