Beispiel #1
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;
        }