Esempio n. 1
0
        public void Invoke(object Sender, object Element)
        {
            if (Element is CommandParameters)
            {
                CommandParameters cp = (CommandParameters)Element;

                int issueId = int.Parse(cp.CommandArguments["SelectedValue"]);

                if (cp.CommandArguments.ContainsKey("GridId"))
                {
                    string[] checkedElems = MCGrid.GetCheckedCollection(((CommandManager)Sender).Page, cp.CommandArguments["GridId"]);

                    ArrayList alIds = new ArrayList();
                    foreach (string elem in checkedElems)
                    {
                        int id = Convert.ToInt32(elem.Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries)[0], CultureInfo.InvariantCulture);
                        if (id > 0)
                        {
                            alIds.Add(id);
                        }
                    }

                    EMailMessage.CopyToIncident(alIds, issueId);
                }
                else if (cp.CommandArguments.ContainsKey("ObjectId"))
                {
                    int emailMessageId = int.Parse(cp.CommandArguments["ObjectId"]);

                    EMailMessage.CopyToIncident(emailMessageId, issueId);
                }

                CHelper.RequireBindGrid();
            }
        }
        protected void btnAddToExIss_Click(object sender, EventArgs e)
        {
            string param = Request["__EVENTARGUMENT"];

            if (!String.IsNullOrEmpty(param))
            {
                string[] mas = param.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                if (mas.Length < 3 || !mas[1].Equals("7"))
                {
                    return;
                }

                string[]  selIds = mas[0].Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                ArrayList aList  = new ArrayList();
                for (int i = 0; i < selIds.Length; i++)
                {
                    aList.Add(int.Parse(selIds[i]));
                }
                int iToincId = int.Parse(mas[2]);
                EMailMessage.CopyToIncident(aList, iToincId);
                Response.Redirect("~/Incidents/EMailPendingMessages.aspx");
            }
        }