public bool ModalIsInStack(Modal modal)
 {
     bool ret = false;
     foreach(UIData uid in mModalStack) {
         if(uid.type == modal) {
             ret = true;
             break;
         }
     }
     return ret;
 }
Beispiel #2
0
        private void add_CodigoCiiu()
        {
            String[] valores =
            {
                "" + IdEmpresa,
                ddlClase1.SelectedValue,
                ddlClase2.SelectedValue,
                ddlClase3.SelectedValue
            };

            if (Mgr_CodigoCiiu.Add_CodigoCiiu_Empresa(valores))
            {
                add_Categorias();
            }
            else
            {
                Mgr_Empresa.Delete_Empresa(IdEmpresa);
                Modal.MostrarMsjModal(MensajeError.Error_Add_Default_Ciiu.Value, "ERR", this);
            }
        }
Beispiel #3
0
        protected void GuardarRegistro(object sender, EventArgs e)
        {
            if (validar())
            {
                if (ObjUsuario.isAdm_Grupoli())
                {
                    ObjUsuario.Id_empresa = Convert.ToInt32(ddlEmpresas.SelectedValue);
                }

                /*  ObjUsuario.Error = ObjUsuario.objModeloBD.Add_Consultas(id, chkTipoConsulta.SelectedValue, txtServicioMedico.Text,
                 *    txtFecha.Text, txtMedico.Text, txtDiagnostico.Text, txtSugerencias.Text, ObjUsuario.Id_empresa);*/

                Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtDiagnostico);

                if (ObjUsuario.Error)
                {
                    Response.Redirect("../Hacer/index_AccidenteLaboral.aspx");
                }
            }
        }
        protected void btnSubirArchivo(object sender, EventArgs e)
        {
            int IdEmpresa = ObjUsuario.Id_empresa;

            string _ruta = Utilidades.GuardarArchivo(flpArchivo, IdEmpresa + "_Encuesta_" + IdTrabajadorSub, "~/archivos/encuesta_politicasst/");

            GrupoLiEntities   contexto   = new GrupoLiEntities();
            int               idEncuesta = Convert.ToInt32(hdfIDEsc.Value);
            encuesta_politica Edit       = contexto.encuesta_politica.SingleOrDefault(b => b.id_encuesta == idEncuesta);

            if (Edit != null)
            {
                Edit.ruta = _ruta;
            }

            ObjUsuario.Error = CRUD.Edit_Fila(contexto);

            Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
            LlenarGridView();
        }
        protected void btnSubirArchivo(object sender, EventArgs e)
        {
            int IdEmpresa  = ObjUsuario.Id_empresa;
            int IdSucursal = Mgr_Sucursal.Set_IdSucursalDDl(ObjUsuario, ddlSucursalSubir);

            string _ruta = Utilidades.GuardarArchivo(flpArchivo, IdEmpresa + "_ObjetivosSGSST_" + ddlSucursalSubir.SelectedValue, "~/archivos/objetivos_sgsst/");

            documento nuevo = new documento()
            {
                nombre   = txtNombreSubir.Text,
                id_tabla = IdSucursal,
                ruta     = _ruta,
                tipo     = "ObjetivosSGSST"
            };

            ObjUsuario.Error = CRUD.Add_Fila(nuevo);

            Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
            LlenarGridView();
        }
        private async Task ChangeBots()
        {
            var parameters = new ModalParameters();

            parameters.Add(nameof(BotsSelector.Bots), Job.Bots);

            var modal  = Modal.Show <BotsSelector>(Loc["EditBotsAmount"], parameters);
            var result = await modal.Result;

            if (!result.Cancelled)
            {
                var newAmount = (int)result.Data;
                changingBots = true;

                await Job.ChangeBots(newAmount);

                Job.Bots     = newAmount;
                changingBots = false;
            }
        }
        public async Task TransferTaskItem()
        {
            var modalParameters = new ModalParameters();

            modalParameters.Add("TaskItemId", TaskItem.Id);

            var modal = Modal.Show <TransferTaskItem>("Transfer task", modalParameters);

            var result = await modal.Result;

            if (!result.Cancelled)
            {
                await RefreshTaskList.InvokeAsync();

                var targetTaskListComponent = IndexPage.TaskListComponents.First(tl => tl.id == (int)result.Data).taskList;
                await targetTaskListComponent.GetTaskItems();

                targetTaskListComponent.OpenTaskList();
            }
        }
Beispiel #8
0
        // Muestra el modal de ver una pregunta
        protected void VerRegistroModal(object sender, EventArgs e)
        {
            LinkButton boton = sender as LinkButton;

            int idPregunta = 0;

            if (boton.ClientID.Contains("ContentPlaceHolder1_lk_MP_Pregunta_"))
            {
                idPregunta = Convert.ToInt32(boton.ClientID.Replace("ContentPlaceHolder1_lk_MP_Pregunta_", ""));
            }
            else if (boton.ClientID.Contains("ContentPlaceHolder1_lk_SP_Pregunta_"))
            {
                idPregunta = Convert.ToInt32(boton.ClientID.Replace("ContentPlaceHolder1_lk_SP_Pregunta_", ""));
            }


            List <Pregunta> consulta = new List <Pregunta>();
            GrupoLiEntities contexto = new GrupoLiEntities();

            var consultaLista = (
                from PR in contexto.Pregunta
                where PR.id_pregunta == idPregunta
                select new
            {
                PR.id_pregunta,
                PR.titulo,
                PR.cuerpo_pregunta,
                PR.id_usuario,
                PR.fecha,
                TotalRespuestas = PR.Respuesta.Count
            }).ToList();

            foreach (var item in consultaLista)
            {
                lbTitulo.Text   = item.titulo;
                lbPregunta.Text = item.cuerpo_pregunta;
            }


            Modal.registrarModal("viewModal", "viewModalScript", this);
        }
Beispiel #9
0
        public void Solve_RK(double t_end, double h, double V)
        {
            double      t       = 0;
            int         N       = (int)(t_end / h);
            DenseMatrix y       = Y[0];
            double      V0      = 0;
            double      y_ideal = 1;
            Solve_motor S       = new Solve_motor();
            string      Mode    = "none";

            double[] error  = new double[N];
            double[] derror = new double[N];
            double[] ierror = new double[N];
            double   Kp     = -100;
            double   Ki     = 10;
            double   Kd     = 0.4;

            for (int i = 1; i < N; i++)
            {
                y = S.solve_motor(y, t, V, h);
                t = t + h;
                T.Add(t);
                Y.Add(y);
                if (Mode.Equals("PID"))
                {
                    error[i]  = y_ideal - y.Values[0];
                    derror[i] = (error[i] - error[i - 1]) / h;
                    ierror[i] = error.Sum() * h;
                    V         = V0 - (Kp * error[i] + Ki * ierror[i] + Kd * derror[i]);
                }

                if (Modal.Equals("none"))
                {
                    V = 1000;
                }
            }
            for (int i = 0; i < N; i++)
            {
                chart1.Series["Series2"].Points.AddXY(T[i], Y[i].Values[0]);
            }
        }
Beispiel #10
0
    public void AnswerQuestion()
    {
        Question q = questions[questionPointer];

        buttonAnswer.interactable = false;
        if (!Main.AnswerQuiz((ClassifiedImages response, Dictionary <string, object> customData) => {
            Debug.Log(customData["json"]);
            ClassifyResponse r = JsonUtility.FromJson <ClassifyResponse>(customData["json"].ToString());

            string @class = r.images[0].classifiers[0].classes[0].@class;
            bool correct = false;
            foreach (string a in q.answers)
            {
                Debug.Log(a + " - " + @class + " = " + a.Equals(@class, System.StringComparison.CurrentCultureIgnoreCase));
                if (a.Equals(@class, System.StringComparison.CurrentCultureIgnoreCase))
                {
                    correct = true;
                    break;
                }
            }

            if (correct)
            {
                score += q.score;
                Modal.ShowModal("Right answer!\n\n" + r);
            }
            else
            {
                Modal.ShowModal("Wrong answer!\n\n" + r);
            }
            questionPointer++;
            NextQuestion();
        }, (RESTConnector.Error error, Dictionary <string, object> customData) => {
            Modal.ShowModal("error while querying watson: " + error.ErrorMessage);
            buttonAnswer.interactable = true;
        }))
        {
            Modal.ShowModal("Classify image failed!");
            buttonAnswer.interactable = true;
        }
    }
    void Update()
    {
        if (Time.time >= lastRecordedParticleStatus + secondsToBotherWatcher)
        {
            lastRecordedParticleStatus = Time.time;
            if (particle.isPlaying && lastParticleState == 1)
            {
                BotherWatcher();
            }

            lastParticleState = particle.isPlaying ? 1 : 0;
        }

        remainingWatchers = (int)((float)chairs.Count * sitRatio) - curIndex;
        if (remainingWatchers == 0)
        {
            Modal.MessageBox("Yes!", "Your noise is remarkable!", () => {
                Application.LoadLevel(levelID + 1);
            });
        }
    }
        protected void Guardar(object sender, EventArgs e)
        {
            Tuple <int, int> IdEmpSuc = Mgr_Empresa.Get_IdEmpresa_IdSucursal(ObjUsuario, ddlEmpresa, ddlSucursalAdd);
            int IdEmpresa             = IdEmpSuc.Item1;
            int IdSucursal            = IdEmpSuc.Item2;

            string _ruta = Utilidades.GuardarArchivo(flpArchivo, IdEmpresa + txtNombre.Text, "~/archivos/vigilancia/");

            documento nuevo = new documento()
            {
                nombre   = txtNombre.Text,
                ruta     = _ruta,
                id_tabla = IdSucursal,
                tipo     = "VigilanciaEpidemiologica"
            };

            ObjUsuario.Error = CRUD.Add_Fila(nuevo);

            Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
            LlenarGridView();
        }
Beispiel #13
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals(ComandosGrid.Eliminar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];
                hdfIDEppDel.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);

                Modal.registrarModal("deleteModal", "DeleteModalScript", this);
            }
            else if (e.CommandName.Equals(ComandosGrid.Editar.Value))
            {
                int         RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                GridViewRow gvrow    = GridView1.Rows[RowIndex];

                hdfIdEppEdit.Value = Utilidades_GridView.DevolverIdRow(e, GridView1);
                txtNombreEdit.Text = (gvrow.FindControl("nombre") as Label).Text;

                Modal.registrarModal("editModal", "EditModalScript", this);
            }
        }
Beispiel #14
0
        async Task OnModalOpened(Modal modal)
        {
            Page page = null;

            switch (modal)
            {
            case Modal.Config:
                page = ConfigPage;
                break;

            case Modal.Preview:
                PreviewPage.TranscodeJob = _mainPage.GetTranscodeJob();
                page = PreviewPage;
                break;
            }

            if ((page != null) && !_navigation.ModalStack.Any(p => p == page))
            {
                await _navigation.PushModalAsync(page, false);
            }
        }
        protected void ButtonOK_Click(object sender, EventArgs e)
        {
            date     = txtDate.Text;
            startStr = txtStart.Text;
            endStr   = txtEnd.Text;

            ev.start       = DateTime.ParseExact(date + " " + startStr, "dd/MM/yyyy HH:mm", null);
            ev.end         = DateTime.ParseExact(date + " " + endStr, "dd/MM/yyyy HH:mm", null);
            ev.title       = txtTitle.Text;
            ev.color       = drpColor.SelectedValue;
            ev.description = txtDescription.Text;

            new EventDataManager().updateEvent(ev);

            Hashtable ht = new Hashtable();

            ht["refresh"] = "yes";
            ht["message"] = "Event updated.";

            Modal.Close(this, ht);
        }
Beispiel #16
0
        protected void EliminarRegistro(object sender, EventArgs e)
        {
            area           tabla       = new area();
            int            idArea      = 0;
            List <usuario> usuarioData = Mgr_Area.Get_AreaByUsuario(ObjUsuario.Id_usuario);

            foreach (var user in usuarioData)
            {
                idArea = user.trabajador.puesto_trabajo.area.id_area;
            }

            if (idArea != Convert.ToInt32(hdfAreaIDDel.Value))
            {
                ObjUsuario.Error = CRUD.Delete_Fila(tabla, Convert.ToInt32(hdfAreaIDDel.Value));
            }

            Modal.CerrarModal("deleteModal", "DeleteModalScript", this);
            Modal.MostrarAlertaDelete(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);

            LlenarGridView();
        }
Beispiel #17
0
    /// <summary>
    /// Called when the server returns Login Fail opcode
    /// </summary>
    /// <param name="netMsg"></param>
    protected void OnLoginFail(NetworkMessage netMsg)
    {
        UnityMainThreadDispatcher.Instance().Enqueue(() =>
        {
            var modal = new Modal("Login Fail", netMsg.ReadMessage <ActionError>().message, Modal.Type.Information);
            modal.AddCloseListener(() => {
                var listOfModals = GameObject.FindGameObjectsWithTag("Modal");
                if (listOfModals.Length > 0)
                {
                    for (int i = 0; i < listOfModals.Length; i++)
                    {
                        Destroy(listOfModals[i]);
                    }
                }
                //Destroy(modal.GetReference());
            });
            modal.Render();

            ShowLoginPanel();
        });
    }
        protected async Task HandleDeleteListButton()
        {
            var options = new ModalOptions()
            {
                DisableBackgroundCancel = true,
                HideCloseButton         = true
            };

            var modal  = Modal.Show <DeleteListConfirmation>("Delete List", options);
            var result = await modal.Result;

            if (!result.Cancelled && User != null)
            {
                var succeeded = await ListService.DeleteMovieListAsync(MovieList.Id);

                if (succeeded)
                {
                    NavigationManager.NavigateTo($"/user/profile/{User.Id}");
                }
            }
        }
        private async Task EditHardware(int id)
        {
            var options = new JsonSerializerOptions {
                Converters = { new HardwareConverter() }
            };

            var hardware = await HttpClient.GetFromJsonAsync <HardwareVm>($"api/hardware/{id}", options);

            var parameters = new ModalParameters();

            parameters.Add("Hardware", hardware);

            var modalWindow = Modal.Show <UpdateHardwareModal>("Редактирование оборудования", parameters);

            var result = await modalWindow.Result;

            if (!result.Cancelled)
            {
                Contract = await HttpClient.GetFromJsonAsync <ContractDetailVm>($"api/contract/{Id}");
            }
        }
        protected void btnSubirArchivo(object sender, EventArgs e)
        {
            if (fuComunicado.FileName != string.Empty)
            {
                string ruta = Utilidades.GuardarArchivo(fuComunicado, hdfIDEsc.Value + "ArchivoIncidente", "~/archivos/incidentes/");

                GrupoLiEntities contexto = new GrupoLiEntities();
                int             id_Acc   = Convert.ToInt32(hdfIDEsc.Value);
                at_it_el_pa     Edit     = contexto.at_it_el_pa.SingleOrDefault(b => b.id_at_it_el_pa == id_Acc);

                if (Edit != null)
                {
                    Edit.documento_comunicado = ruta;
                }

                ObjUsuario.Error = CRUD.Edit_Fila(contexto);
            }

            Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
            LlenarGridView();
        }
        protected void Guardar(object sender, EventArgs e)
        {
            int IdEmpresa  = Mgr_Empresa.Set_IdEmpresaDDl(ObjUsuario, ddlEmpresaAdd);
            int IdSucursal = Mgr_Sucursal.Set_IdSucursalDDl(ObjUsuario, ddlSucursalAdd);

            string ruta = Utilidades.GuardarArchivo(flpArchivo, IdEmpresa + txtNombre.Text, "~/archivos/mapas/");

            documento nuevo = new documento()
            {
                nombre   = txtNombre.Text,
                ruta     = ruta,
                id_tabla = IdSucursal,
                tipo     = "MapaRiesgos"
            };

            ObjUsuario.Error = CRUD.Add_Fila(nuevo);


            Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
            LlenarGridView();
        }
Beispiel #22
0
        private void add_Tipo_Documento_Default(int id_sucursal)
        {
            String[] valores =
            {
                "" + id_sucursal
            };

            if (Mgr_Documento.Add_TipoDocumento_Sucursal(valores))
            {
                //Si llega aqui enviar el email.....
                string clave = objUtilidades.descifrarCadena2(Convert.ToString(ViewState["clave"].ToString()));
                Utilidades.enviarEmpresa(txtemailEmpresa.Text, txtNomEmpresa.Text, ViewState["login"].ToString(), clave);

                Modal.MostrarMsjModal(MensajeError.Exito_Add_Empresa.Value, "EXI", this);
            }
            else
            {
                Mgr_Empresa.Delete_Empresa(IdEmpresa);
                Modal.MostrarMsjModal(MensajeError.Error_Add_Default_TipoDocumento.Value, "ERR", this);
            }
        }
Beispiel #23
0
        private void SaveAddGroup(AdGroupModel data)
        {
            this.AdGroupForm_SaveBtn.Click();
            IList <string> Result = Wait.UntilToastMessageShow();

            if (Result.Any(e => e == "Saved successfully"))
            {
                //AdGroupForm_CancelBtn.Click();
                Wait.Second(1);
                Logger.Log(LogingType.TestCasePass, "Ad Group Save Successfully");
            }
            else
            {
                AdGroupForm_CancelBtn.Click();
                Wait.Second(1);
                Modal.DirtyclickYes();
                Wait.MLSeconds(100);
                Logger.Log(LogingType.TextCaseFail, "Ad Group Save Failed - " + Result.ToString());
                throw new Exception(String.Join(",", Result.ToArray()));
            }
        }
Beispiel #24
0
        public async Task CallMod(string callModId, string modSearchId)
        {
            HomeBus homeBus = new HomeBus(moduleService, iConfiguration, distributedCache);
            var     mod     = await homeBus.GetModule(callModId);

            if (mod != null && mod.ModulesInfo.Any())
            {
                if (mod.ModulesInfo.First().UIType == EUITYPE.P.ToString())
                {
                    ModalParameters parameters = new ModalParameters();
                    //{modId}/{modSearchId}
                    parameters.Add("modId", callModId);
                    parameters.Add("modSearchId", modSearchId);
                    Modal.Show <Pages.Edit>(moduleInfoModel.ModulesInfo.ModuleName.GetLanguageTitle(moduleInfoModel.LanguageInfo), parameters);
                }
                else
                {
                    NavManager.NavigateTo(String.Format("/Edit/{0}/{1}", callModId, modSearchId));
                }
            }
        }
        protected void EditarRegistro(object sender, EventArgs e)
        {
            int IdEmpresa = Mgr_Empresa.Set_IdEmpresaDDl(ObjUsuario, ddlEmpresaEdit);

            GrupoLiEntities contexto    = new GrupoLiEntities();
            int             idCategoria = Convert.ToInt32(hdfEditID.Value);
            categoria       Edit        = contexto.categoria.SingleOrDefault(b => b.id_categorias == idCategoria);

            if (Edit != null)
            {
                Edit.nombre      = txtNombreEdit.Text;
                Edit.id_empresa  = IdEmpresa;
                Edit.descripcion = txtDescripcionEdit.Text;
            }

            ObjUsuario.Error = CRUD.Edit_Fila(contexto);
            Modal.CerrarModal("editModal", "EditModalScript", this);

            Modal.MostrarAlertaEdit(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
            LlenarGridView();
        }
        protected override void EndProcessing()
        {
            var modal = new Modal
            {
                BottomSheet     = BottomSheet,
                FixedFooter     = FixedFooter,
                Footer          = Footer?.Invoke().Select(m => m.BaseObject).ToArray(),
                Header          = Header?.Invoke().Select(m => m.BaseObject).ToArray(),
                Content         = Content?.Invoke().Select(m => m.BaseObject).ToArray(),
                BackgroundColor = BackgroundColor?.HtmlColor,
                FontColor       = FontColor?.HtmlColor
            };

            var hub = this.GetVariableValue("DashboardHub") as IHubContext <DashboardHub>;

            if (hub != null)
            {
                var connectionId = this.GetVariableValue("ConnectionId") as string;
                hub.ShowModal(connectionId, modal).Wait();
            }
        }
        protected void EditarRegistro(object sender, EventArgs e)
        {
            int IdEmpresa = Mgr_Empresa.Set_IdEmpresaDDl(ObjUsuario, ddlEmpresaEdit);

            GrupoLiEntities contexto  = new GrupoLiEntities();
            int             idHorario = Convert.ToInt32(hdfHorarioID.Value);
            horario         Edit      = contexto.horario.SingleOrDefault(b => b.id_horario == idHorario);

            if (Edit != null)
            {
                Edit.nombre       = txtNombreEdit.Text;
                Edit.id_empresa   = IdEmpresa;
                Edit.fecha_inicio = txtFechaIniEdit.Text;
                Edit.fecha_fin    = txtFechaFinEdit.Text;
            }

            ObjUsuario.Error = CRUD.Edit_Fila(contexto);
            Modal.CerrarModal("editModal", "EditModalScript", this);
            Modal.MostrarAlertaEdit(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
            LlenarGridView();
        }
Beispiel #28
0
        protected void AgregarRegistro(object sender, EventArgs e)
        {
            bool validacion = ValidarContraseña(txtClave.Text, txtClaveConf.Text, txtLogin.Text);

            if (validacion)
            {
                string clave = objUtilidades.cifrarCadena(Convert.ToString(txtClave.Text));

                usuario nuevo = new usuario()
                {
                    login         = txtLogin.Text,
                    clave         = clave,
                    id_trabajador = Convert.ToInt32(ddlTrabajadorAdd.SelectedValue),
                    id_rol        = Convert.ToInt32(ddlRolAdd.SelectedValue)
                };

                ObjUsuario.Error = Capa_Datos.CRUD.Add_Fila(nuevo);
                List <trabajador> trab    = Mgr_Trabajador.Get_Trabajador(Convert.ToInt32(IdTrabajador));
                string            destino = string.Empty;
                string            empresa = string.Empty;
                foreach (var _trabajador in trab)
                {
                    destino = _trabajador.email;
                    empresa = _trabajador.puesto_trabajo.area.sucursal.empresa.nombre;
                }

                if (destino.Length > 0)
                {
                    clave = objUtilidades.descifrarCadena2(clave);
                    if (Utilidades.EmailValido(destino))
                    {
                        Utilidades.registroUsuario(destino, empresa, ddlTrabajadorAdd.SelectedItem.Text, txtLogin.Text, clave);
                    }
                }
                Modal.CerrarModal("addModal", "AddModalScript", this);
                Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
                LlenarGridView();
                CargarListas();
            }
        }
Beispiel #29
0
        protected void EditarRegistro(object sender, EventArgs e)
        {
            string añoIni = TxtSemanaIniEdit.Text.Substring(0, 4);
            string SemIni = TxtSemanaIniEdit.Text.Substring(6, 2);

            string añoFin = TxtSemanaFinEdit.Text.Substring(0, 4);
            string SemFin = TxtSemanaFinEdit.Text.Substring(6, 2);

            if (añoIni != añoFin)
            {
                Modal.MostrarMsjModal(MensajeError.Validacion_Semanas_Año.Value, "ERR", this);
            }
            else if (Convert.ToInt32(SemIni) > Convert.ToInt32(SemFin))
            {
                Modal.MostrarMsjModal(MensajeError.Validacion_SemanaIni_Menor_SemanaFin.Value, "ERR", this);
            }
            else
            {
                GrupoLiEntities contexto       = new GrupoLiEntities();
                int             idplan_trabajo = Convert.ToInt32(hdfEditID.Value);
                plan_trabajo    Edit           = contexto.plan_trabajo.SingleOrDefault(b => b.id_plan_trabajo == idplan_trabajo);

                if (Edit != null)
                {
                    Edit.nombre             = txtActividadEdit.Text;
                    Edit.objetivos          = txtObjetivosEdit.Text;
                    Edit.semana_ini         = Convert.ToInt32(SemIni);
                    Edit.semana_fin         = Convert.ToInt32(SemFin);
                    Edit.recursos_aprobados = Convert.ToInt32(txtRecursosEdit.Text);
                    Edit.id_responsable     = Convert.ToInt32(ddlResponsableEdit.SelectedValue);
                }

                ObjUsuario.Error = CRUD.Edit_Fila(contexto);

                Modal.CerrarModal("editModal", "EditModalScript", this);

                Modal.MostrarAlertaEdit(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
            }
            LlenarGridView();
        }
        private async Task OnAddProctor()
        {
            var res = await ExamServices.AddProctor(_examId, _proctorIdToAdd);

            if (res != ErrorCodes.Success)
            {
                await Modal.ErrorAsync(new ConfirmOptions()
                {
                    Title   = "Failed to add proctor to exam",
                    Content = ErrorCodes.MessageMap[res]
                });
            }
            else
            {
                await Modal.SuccessAsync(new ConfirmOptions()
                {
                    Title = "Successfully added proctor to exam"
                });

                _proctorIdToAdd = "";
            }
        }
Beispiel #31
0
 public override void activate()
 {
     if (getOwner() == null)
     {
         Modal.instance().showModal("<size=150%><color=" + color + "><b>" + blockName + "</b></color></size>\nBạn có thể mua ô này.", "OK", () => { });
     }
     else
     {
         Player player = GameController.playerInTurn();
         int    rent   = calRent();
         if (owner != player)
         {
             if (player.getFund() < rent)
             {
                 if (player.calNetWorth() < rent)
                 {
                     player.declareBankrupt(owner);
                 }
                 else
                 {
                     player.debit(rent, owner, "Tiền thuê");
                     Modal.instance().showModal("<size=150%><color=" + color + "><b>" + blockName + "</b></color></size>\nBạn đã đi vào ô của <b>" + owner.playerName + "</b>. Bạn không đủ <color=#aa0115><b>" + rent + "Đ</b></color> thuê. Cần bán tài sản và trả nợ để tiếp tục!", "OK", () => { });
                 }
             }
             else
             {
                 Modal.instance().showModal("<size=150%><color=" + color + "><b>" + blockName + "</b></color></size>\nBạn đã đi vào ô của <b>" + owner.playerName + "</b> phải trả <color=#aa0115><b>" + rent + "Đ</b></color>", "OK",
                                            () => {
                     player.pay(owner, rent);
                 }
                                            );
             }
         }
         else
         {
             Modal.instance().showModal("<size=150%><color=" + color + "><b>" + blockName + "</b></color></size>\nĐây là ô của bạn, bạn có thể mua/bán tài sản hoặc KT lượt.", "OK", () => { });
         }
     }
 }
        public void Close(object smartPart)
        {
            if ( _activeWrapper != null )
            {
                Control control = Guard.Cast<Control>(smartPart, "smartPart in windowWorkspace");

                if ( _saveControls )
                    _activeWrapper.Form.Controls.Remove(control);

                _activeWrapper.Dispose();

                _activeWrapper.Form.FormClosing -= FormClose;
                _activeWrapper.Form.Close();

                if ( SmartPartClosing != null )
                    SmartPartClosing(this, new WorkspaceCancelEventArgs(smartPart));

                _activeSmartPart = null;
                _activeWrapper = null;
            }
        }
        private void Show(object smartPart, string title, bool resizable)
        {
            Control control = Guard.Cast<Control>(smartPart, "SmartPart for SimpleWindowSmartPart");
            _activeWrapper = new Modal(control, resizable);

            AddSmartPart(smartPart);
            _activeSmartPart = smartPart;

            if ( SmartPartActivated != null )
                SmartPartActivated(this, new WorkspaceEventArgs(smartPart));

            _activeWrapper.Form.FormClosing += new FormClosingEventHandler(FormClose);

            _activeWrapper.ShowDialog(title);
        }
Beispiel #34
0
    void ModalPushToStack(Modal modal, bool evokeActive)
    {
        if(evokeActive && mModalStack.Count == 0) {
            SceneController sc = Main.instance.sceneController;
            if(sc != null) {
                sc.BroadcastMessage("OnUIModalActive", null, SendMessageOptions.DontRequireReceiver);
            }
        }

        UIData uid = uis[(int)modal];

        if(uid.exclusive && mModalStack.Count > 0) {
            //hide below
            UIData prevUID = mModalStack.Peek();
            UIController prevUI = prevUID.ui;
            prevUI.OnShow(false);
            prevUI.gameObject.SetActiveRecursively(false);
        }

        UIController ui = uid.ui;
        ui.gameObject.SetActiveRecursively(true);
        ui.OnOpen();
        ui.OnShow(true);

        mModalStack.Push(uid);
    }
Beispiel #35
0
 //closes all modal and open this
 public void ModalReplace(Modal modal)
 {
     ModalClearStack(false);
     ModalPushToStack(modal, false);
 }
Beispiel #36
0
 public void ModalOpen(Modal modal)
 {
     ModalPushToStack(modal, true);
 }