Beispiel #1
0
        private void verifyParameters()
        {
            bool doRedirect = false;

            try
            {
                int ID = Convert.ToInt32(Request.Params.Get("id"));
                if (Project.projectExists(ID))
                {
                    if (ProjectInfo.getProject(ID).Name == "Workshop")
                    {
                        doRedirect = true;
                    }
                }
                else
                {
                    Response.Clear();
                    Response.StatusCode = 400;
                    Response.End();
                }
            }
            catch (Exception e)
            {
                Response.Clear();
                Response.StatusCode = 400;
                Response.End();
            }

            if (doRedirect)
            {
                Response.Redirect("tasks?id=" + WorkTypeInfo.getProjectWorkTypes(Convert.ToInt32(Request.Params.Get("id")))[0].WorkTypeID);
            }
        }
Beispiel #2
0
        private void fillData()
        {
            int taskID = 0;

            foreach (TaskInfo info in BusinessLogicLayer.TaskInfo.getTasks())
            {
                if (info.TaskName == taskDrpList.SelectedItem.ToString())
                {
                    taskID = info.TaskID;
                    break;
                }
            }

            BusinessLogicLayer.TaskInfo     task         = TaskInfo.getAssignedTask(taskID);
            BusinessLogicLayer.WorkTypeInfo workTypeInfo = WorkTypeInfo.getWorkType(task.WorkTypeID);

            workTypeDrpList.SelectedValue = workTypeInfo.Name == workTypeInfo.Project.Name ? workTypeInfo.Name : workTypeInfo.Project.Name + " - " + workTypeInfo.Name;

            taskNameTxtBx.Text            = task.TaskName;
            taskDescTxtBx.Text            = task.TaskDescription;
            takeFiveChkBx.Checked         = task.TakeFiveNeeded;
            reasonTxtBx.Text              = task.TaskIncompleteReason;
            taskStatDrpList.SelectedValue = task.TaskStatus;

            submitTask.Visible = false;
        }
Beispiel #3
0
        static Utilities()
        {
            Text.Font          = GameFont.Tiny;
            TinyTextLineHeight = Text.LineHeight;
            Text.Font          = GameFont.Small;    //Reset

            //Modify vanilla translations for better tooltip building
            DingoUtils.CachedStrings["ClickToSortByThisColumn"] = "\n\n" + "ClickToSortByThisColumn".Translate();
            DingoUtils.CachedStrings["RelevantSkills"]          = "\n\n" + "RelevantSkills".Translate();
            DingoUtils.CachedStrings["ClickToJumpTo"]           = "ClickToJumpTo".Translate() + "\n\n";

            DraggableOutlineTexture = DingoUtils.GetHQTexture("DraggableOutline");
            WorkButtonTexture       = DingoUtils.GetHQTexture("Cog");
            SortingDescendingIcon   = DingoUtils.GetHQTexture("SortingDescending");
            SortingAscendingIcon    = DingoUtils.GetHQTexture("Sorting");
            PassionMinorIcon        = DingoUtils.GetHQTexture("PassionMinor");
            PassionMajorIcon        = DingoUtils.GetHQTexture("PassionMajor");
            IncapableWorkerX        = DingoUtils.GetHQTexture("IncapableWorkerX");

            foreach (WorkTypeDef def in WorkTypeDefsUtility.WorkTypeDefsInPriorityOrder)
            {
                HashSet <PawnCapacityDef> allRequiredCapacities = new HashSet <PawnCapacityDef>();

                for (int i = 0; i < def.workGiversByPriority.Count; i++)
                {
                    WorkGiverDef workGiver = def.workGiversByPriority[i];

                    for (int j = 0; j < workGiver.requiredCapacities.Count; j++)
                    {
                        allRequiredCapacities.Add(workGiver.requiredCapacities[j]);
                    }
                }

                Texture2D enabledTex   = DingoUtils.GetHQTexture(def.defName, "Work");
                Texture2D disabledTex  = DingoUtils.GetHQTexture(def.defName, "Work_Disabled");
                Texture2D greyscaleTex = DingoUtils.GetHQTexture(def.defName, "Work_Greyscale");

                WorkDefAttributes[def] = new WorkTypeInfo(enabledTex, disabledTex, greyscaleTex, allRequiredCapacities);

                //Cache "relevant skills:" string
                if (def.relevantSkills.Count > 0)
                {
                    string relevantSkills = "";

                    for (int k = 0; k < def.relevantSkills.Count; k++)
                    {
                        relevantSkills += def.relevantSkills[k].skillLabel + ", ";
                    }

                    DingoUtils.CachedStrings[def] = relevantSkills.Substring(0, relevantSkills.Length - 2);
                }
            }

            Controller.GetPrimaries = new PrimarySurface();
        }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            verifyParameters();

            string UserRole = Role.GetUserRole(Membership.GetUser().UserName);

            if (UserRole != "Team Leader" && UserRole != "Staff" && UserRole != "Administrator")
            {
                createProjBtn.Visible = false;
            }

            List <WorkTypeInfo> sections = WorkTypeInfo.getProjectWorkTypes(Convert.ToInt32(Request.QueryString["id"]));

            TableRow row  = new TableRow();
            Label    cell = new Label();

            cell.Text = "<div class = \"tblProjects\">";

            int i = 0;

            foreach (WorkTypeInfo info in sections)
            {
                if (i != 2)
                {
                    cell.Text = "<img src=\"images\\tools_white.png\"/><a href =\"tasks.aspx?id=" + info.WorkTypeID + "\"><div class = projName>" + info.Name + "</div></a>"
                                + "<div class = projDesc>" + info.Status + "</div>";
                    TableCell cell1 = new TableCell();
                    cell1.Text = cell.Text.ToString();
                    row.Cells.Add(cell1);
                    i++;
                }
                else
                {
                    cell.Text = "<img src=\"images\\tools_white.png\"/><a href =\"tasks.aspx?id=" + info.WorkTypeID + "\"><div class = projName>" + info.Name + "</div></a>"
                                + "<div class = projDesc>" + info.Status + "</div></tr><tr>";
                    TableCell cell1 = new TableCell();
                    cell1.Text = cell.Text.ToString();
                    row.Cells.Add(cell1);
                    i = 0;
                }
            }

            tblProjects.Rows.Add(row);
            cell.Text += "</div>";
        }
Beispiel #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Params.Get("id") == null)
            {
                Response.Redirect("todo.aspx");
            }

            BusinessLogicLayer.TaskInfo     info         = TaskInfo.getAssignedTask(Convert.ToInt32(Request.QueryString["id"]));
            BusinessLogicLayer.WorkTypeInfo workTypeInfo = WorkTypeInfo.getWorkType(info.WorkTypeID);

            HtmlGenericControl NewControl = new HtmlGenericControl("span");

            taskTitleLbl.Text      = info.TaskName;
            dueDateLbl.Text        = "DUE: " + info.TaskDueDate.ToShortDateString();
            taskDescTxtBx.TextMode = TextBoxMode.MultiLine;
            taskDescTxtBx.Text     = info.TaskDescription;
            sectionProjLbl.Text    = workTypeInfo.Project.Name == workTypeInfo.Name ? workTypeInfo.Name : workTypeInfo.Project.Name + " - " + workTypeInfo.Name;
        }
Beispiel #6
0
        protected void createTaskBtn_Click(object sender, EventArgs e)
        {
            if (assignDrpList.Items.Count == 0)
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ALERT", "<script>alert('There are currently no valid users to add to the project. Returning you to the homepage.')</script>");
                Response.AddHeader("REFRESH", "5;URL=/index.aspx");
            }
            else
            {
                submitTask.Visible     = false;
                taskSub.Visible        = false;
                lblTaskDrpList.Visible = false;
                taskDrpList.Visible    = false;
                clearForm();
                taskFrm.Visible             = true;
                createSubmitTaskBtn.Visible = true;
                updateSubmitBtn.Visible     = false;

                WorkTypeInfo workTypeInfo = WorkTypeInfo.getWorkType(Convert.ToInt32(Request.Params.Get("id")));
                workTypeDrpList.SelectedValue = workTypeInfo.Project.Name == workTypeInfo.Name ? workTypeInfo.Name : workTypeInfo.Project.Name + " - " + workTypeInfo.Name;
            }
        }
Beispiel #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            verifyParameters();
            if (TaskInfo.getWorkTypeTasks(Convert.ToInt32(Request.QueryString["id"])).Count != 0)
            {
                this.fillData();
            }
            else
            {
                instructTasks.InnerText = "No tasks scheduled. Create some to begin.";
            }

            WorkTypeInfo workTypeInfo = WorkTypeInfo.getWorkType(Convert.ToInt32(Request.QueryString["id"]));

            if (workTypeInfo.Project.Name == workTypeInfo.Name)
            {
                lblSectionTitle.Text = workTypeInfo.Project.Name;
            }
            else
            {
                lblSectionTitle.Text = workTypeInfo.Project.Name + " " + workTypeInfo.Name;
            }
        }
Beispiel #8
0
        public DataTable fillData()
        {
            DataTable dataTable = new DataTable();

            dataTable.Columns.Add("Section_Name");
            dataTable.Columns.Add("Task_Name");
            dataTable.Columns.Add("Task_Description");
            dataTable.Columns.Add("duedate");
            dataTable.Columns.Add("Task_ID");

            List <TaskInfo> tasks = TaskInfo.getUserTasks(Membership.GetUser().ToString());

            foreach (TaskInfo task in tasks)
            {
                if (task.TaskStatus != "Completed")
                {
                    WorkTypeInfo workTypeInfo = WorkTypeInfo.getWorkType(task.WorkTypeID);

                    DataRow newRow = dataTable.NewRow();

                    newRow["Section_Name"]     = workTypeInfo.Project.Name == workTypeInfo.Name ? workTypeInfo.Name : workTypeInfo.Project.Name + " - " + workTypeInfo.Name;
                    newRow["Task_Name"]        = task.TaskName;
                    newRow["Task_Description"] = task.TaskDescription;
                    newRow["duedate"]          = task.TaskDueDate.ToShortDateString();
                    newRow["Task_ID"]          = task.TaskID;

                    dataTable.Rows.Add(newRow);
                }
            }

            dataTable.DefaultView.Sort = "duedate DESC";

            todoTable.DataSource = dataTable;
            todoTable.DataBind();

            return(dataTable);
        }
Beispiel #9
0
        public PrimaryWork(WorkTypeDef def)
        {
            this.def = def;

            this.workInfo = Utilities.WorkDefAttributes[this.def];
        }