protected void btnSave_ServerClick(object sender, System.EventArgs e) { if (String.IsNullOrEmpty(fckEditor.Text)) { return; } switch (sType) { case "Project": Project.AddDiscussion(ProjID, fckEditor.Text); break; case "Task": Task.AddDiscussion(TaskID, fckEditor.Text); break; case "ToDo": ToDo.AddDiscussion(ToDoID, fckEditor.Text); break; case "Event": CalendarEntry.AddDiscussion(EventID, fckEditor.Text); break; case "Incident": Incident.AddDiscussion(IncidentID, fckEditor.Text); break; case "Document": Document.AddDiscussion(DocumentID, fckEditor.Text); break; } if (DiscussionId > 0) { Project.UpdateDiscussion(DiscussionId, fckEditor.Text); } Mediachase.UI.Web.Util.CommonHelper.CloseItAndRefresh(Response); }
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; }