Beispiel #1
0
        protected void PriorityList_ItemCommand(object source, DataListCommandEventArgs e)
        {
            int priorityId = int.Parse(e.CommandArgument.ToString());

            if (ObjectTypeId == (int)ObjectTypes.Task)
            {
                Task2.UpdatePriority(ObjectId, priorityId);
            }
            else if (ObjectTypeId == (int)ObjectTypes.ToDo)
            {
                ToDo2.UpdatePriority(ObjectId, priorityId);
            }
            else if (ObjectTypeId == (int)ObjectTypes.Issue)
            {
                Issue2.UpdatePriority(ObjectId, priorityId);
            }
            else if (ObjectTypeId == (int)ObjectTypes.Document)
            {
                if (AssignmentId.HasValue)
                {
                    AssignmentEntity assignment = (AssignmentEntity)BusinessManager.Load(AssignmentEntity.ClassName, (PrimaryKeyId)AssignmentId.Value);
                    if (priorityId == (int)Priority.Low)
                    {
                        assignment.Priority = (int)AssignmentPriority.Low;
                    }
                    else if (priorityId == (int)Priority.Normal)
                    {
                        assignment.Priority = (int)AssignmentPriority.Normal;
                    }
                    else if (priorityId == (int)Priority.High)
                    {
                        assignment.Priority = (int)AssignmentPriority.High;
                    }
                    else if (priorityId == (int)Priority.VeryHigh)
                    {
                        assignment.Priority = (int)AssignmentPriority.VeryHigh;
                    }
                    else
                    {
                        assignment.Priority = (int)AssignmentPriority.Urgent;
                    }

                    BusinessManager.Update(assignment);
                }
            }

            CommandParameters cp = new CommandParameters(CommandName);

            Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString(), true);
        }
Beispiel #2
0
        private void ShowStep(int step)
        {
            HtmlButton btn      = null;
            object     template = this.Parent.Parent.Parent;

            if (template is WizardTemplate)
            {
                btn = ((WizardTemplate)template).GetbtnNext();
            }

            basic.Visible      = false;
            upload.Visible     = false;
            categories.Visible = false;
            comments.Visible   = false;

            if (step == 2 && rbActions.SelectedIndex == 0 && btn != null)
            {
                btn.Attributes.Add("onclick", "DisableButtons(this);ShowProgress();");
            }

            #region Save
            if (step == _stepCount + 1)
            {
                string sItem = "";
                if (ObjectType == 7)
                {
                    if (rbActions.SelectedIndex == 0)
                    {
                        sItem = "0";
                        if ((ffileUp.PostedFile != null && ffileUp.PostedFile.ContentLength > 0))
                        {
                            Incident.UploadFile(ObjectID, ffileUp.PostedFile.FileName, ffileUp.PostedFile.InputStream);
                        }
                    }
                    if (rbActions.SelectedIndex == 1)
                    {
                        sItem = "1";
                        ArrayList alCategories = new ArrayList();
                        for (int i = 0; i < lbCategories.Items.Count; i++)
                        {
                            if (lbCategories.Items[i].Selected)
                            {
                                alCategories.Add(int.Parse(lbCategories.Items[i].Value));
                            }
                        }
                        Issue2.AddIssueCategories(ObjectID, alCategories);
                    }
                    if (rbActions.SelectedIndex == 2)
                    {
                        sItem = "2";
                        Incident.AddDiscussion(ObjectID, txtComments.Text);
                    }
                    string sPath = "../Wizards/CommonWizard.aspx?ObjectType=7&ObjectID=" + ObjectID.ToString();
                    if (sItem != "")
                    {
                        sPath = sPath + "&item=" + sItem;
                    }
                    Response.Redirect(sPath);
                }
                if (ObjectType == 6)
                {
                    if (rbActions.SelectedIndex == 0)
                    {
                        sItem = "0";
                        if ((ffileUp.PostedFile != null && ffileUp.PostedFile.ContentLength > 0))
                        {
                            ToDo.UploadFile(ObjectID, ffileUp.PostedFile.FileName, ffileUp.PostedFile.InputStream);
                        }
                    }
                    if (rbActions.SelectedIndex == 1)
                    {
                        sItem = "1";
                        ArrayList alCategories = new ArrayList();
                        for (int i = 0; i < lbCategories.Items.Count; i++)
                        {
                            if (lbCategories.Items[i].Selected)
                            {
                                alCategories.Add(int.Parse(lbCategories.Items[i].Value));
                            }
                        }
                        ToDo2.SetGeneralCategories(ObjectID, alCategories);
                    }
                    if (rbActions.SelectedIndex == 2)
                    {
                        sItem = "2";
                        ToDo.AddDiscussion(ObjectID, txtComments.Text);
                    }
                    string sPath = "../Wizards/CommonWizard.aspx?ObjectType=6&ObjectID=" + ObjectID.ToString();
                    if (sItem != "")
                    {
                        sPath = sPath + "&item=" + sItem;
                    }
                    Response.Redirect(sPath);
                }
                if (ObjectType == 4)
                {
                    if (rbActions.SelectedIndex == 0)
                    {
                        sItem = "0";
                        if ((ffileUp.PostedFile != null && ffileUp.PostedFile.ContentLength > 0))
                        {
                            CalendarEntry.UploadFile(ObjectID, ffileUp.PostedFile.FileName, ffileUp.PostedFile.InputStream);
                        }
                    }
                    if (rbActions.SelectedIndex == 1)
                    {
                        sItem = "1";
                        ArrayList alCategories = new ArrayList();
                        for (int i = 0; i < lbCategories.Items.Count; i++)
                        {
                            if (lbCategories.Items[i].Selected)
                            {
                                alCategories.Add(int.Parse(lbCategories.Items[i].Value));
                            }
                        }
                        CalendarEntry2.SetGeneralCategories(ObjectID, alCategories);
                    }
                    if (rbActions.SelectedIndex == 2)
                    {
                        sItem = "2";
                        CalendarEntry.AddDiscussion(ObjectID, txtComments.Text);
                    }
                    string sPath = "../Wizards/CommonWizard.aspx?ObjectType=4&ObjectID=" + ObjectID.ToString();
                    if (sItem != "")
                    {
                        sPath = sPath + "&item=" + sItem;
                    }
                    Response.Redirect(sPath);
                }
                return;
            }
            #endregion

            ((Panel)steps[step - 1]).Visible = true;
        }
Beispiel #3
0
 protected void btnDecline_ServerClick(object sender, System.EventArgs e)
 {
     ToDo2.DeclineResource(ToDoID);
     CheckCompleted();
     Util.CommonHelper.ReloadTopFrame("ActiveWork.ascx", "../Workspace/default.aspx?BTab=Workspace", Response);
 }
Beispiel #4
0
 protected void btnAccept_ServerClick(object sender, System.EventArgs e)
 {
     ToDo2.AcceptResource(ToDoID);
     Util.CommonHelper.ReloadTopFrame("ActiveWork.ascx", GetLink(), Response);
 }