Esempio n. 1
0
    void doNewSprintWindow(int windowID)
    {
        inicio = 30;
        height = 20;
        offset = 0;

        offset= 10; inicio = inicio + height;
        titulo = GUIComponents.labelTextField(new Rect(20,inicio+offset,maxWidth-40,height),titulo,"Titulo",220);
        inicio = inicio + height + offset;
        descripcion = GUIComponents.labelTextArea(new Rect(20,inicio+offset ,maxWidth-40,height*4),descripcion,"Descripcion");
        inicio = inicio + height*4 + offset;
        responsable =GUIComponents.labelTextField(new Rect(20,inicio+offset ,maxWidth-40,height),responsable,"Responsable",220);
        inicio = inicio + height + offset;
        t_Estimado = GUIComponents.labelTextField(new Rect(20,inicio+offset,maxWidth-200,height),t_Estimado,"Tiempo estimado",60);
        inicio = inicio + height + offset;
        t_Total = GUIComponents.labelTextField(new Rect(20,inicio+offset,maxWidth-200,height),t_Total,"Tiempo total",60);
        inicio = inicio + height + offset;
        estado = GUIComponents.labelTextField(new Rect(20,inicio+offset,maxWidth-200,height),estado,"Estado",60);
        inicio = inicio + height + offset;
        prioridad = GUIComponents.labelTextField(new Rect(20,inicio+offset,maxWidth-200,height),prioridad,"Prioridad",60);
        inicio = inicio + height + offset;

        if(GUI.Button(new Rect (maxWidth/3-100,maxHeight-35,140,20), "Cargar Tarea")){
            if (titulo.Equals("") || descripcion.Equals("") || responsable.Equals("")||t_Estimado.Equals("") || t_Total.Equals("") || estado.Equals("")||prioridad.Equals("")){
                desactivarVentana();
                incVentana();
                setTitulo("ERROR");
                setMensaje("Debe completar todos los campos");
                setLlamador("GUI_CargarTask");
                ejecutar("GUI_Error");
                }
            else{
                Task t = new Task();
                t.setId_Task(this.getIdTask()+1);
                t.setTitulo(titulo);
                t.setDescripcion(descripcion);
                t.setResponsable(responsable);
                t.setT_Estimado(Convert.ToInt32(t_Estimado));
                t.setT_Total(Convert.ToInt32(t_Total));
                t.setEstado(estado);
                t.setPrioridad(Convert.ToInt32(prioridad));

                t.setId_Story(ant.getUserStory().getId_UserStory());
                MultiPlayer.Instance.getSmartFox().Send(new ExtensionRequest("crearTask",t.toSFSObject()));
                //NextStories button = (NextStories)GameObject.Find("ButtonNextStories").GetComponent("NextStories");
                //button.addTarea(t);
                desactivarVentana();
                incVentana();
                GameObject g = new GameObject();
                UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(g, "Assets/Game/Scripts/GUInterface/GUI_CargarTask.cs (135,5)", "GUI_Mensaje");
                g.SendMessage("setTitulo","Nueva Tarea");
                g.SendMessage("setMensaje","La Tarea fue cargada exitosamente.");
                g.SendMessage("Mostrar");
                limpiarFormulario();
            }
        }
        if (GUI.Button(new Rect(2*maxWidth/3-50,maxHeight-35,140,20),"Cancelar")){
            sprintWindow = false;
            ant.Mostrar();
            Destroy(this);
        }
    }