Ejemplo n.º 1
0
        private void lbDeleteChecked_Click(object sender, EventArgs e)
        {
            string    sIds  = hidForDelete.Value;
            ArrayList alIds = new ArrayList();

            while (sIds.Length > 0)
            {
                alIds.Add(int.Parse(sIds.Substring(0, sIds.IndexOf(","))));
                sIds = sIds.Remove(0, sIds.IndexOf(",") + 1);
            }
            EMailMessage.Delete(alIds);
            Response.Redirect("~/Incidents/EMailPendingMessages.aspx");
        }
Ejemplo n.º 2
0
 private void dgPendMess_ItemCommand(object source, DataGridCommandEventArgs e)
 {
     if (e.CommandName == "Delete")
     {
         int Id = int.Parse(e.CommandArgument.ToString());
         EMailMessage.Delete(Id);
         Response.Redirect("~/Incidents/EMailPendingMessages.aspx");
     }
     else if (e.CommandName == "Approve")
     {
         int Id = int.Parse(e.CommandArgument.ToString());
         EMailMessage.ApprovePending(Id);
         Response.Redirect("~/Incidents/EMailPendingMessages.aspx");
     }
 }
Ejemplo n.º 3
0
        public void Invoke(object Sender, object Element)
        {
            if (Element is CommandParameters)
            {
                CommandParameters cp  = (CommandParameters)Element;
                string            sid = cp.CommandArguments["primaryKeyId"];

                int id = -1;
                int.TryParse(sid, out id);
                if (id > 0)
                {
                    EMailMessage.Delete(id);
                }

                CHelper.RequireBindGrid();
            }
        }
Ejemplo n.º 4
0
        public void Invoke(object Sender, object Element)
        {
            if (Element is CommandParameters)
            {
                CommandParameters cp            = (CommandParameters)Element;
                string[]          elemsToDelete = MCGrid.GetCheckedCollection(((CommandManager)Sender).Page, cp.CommandArguments["GridId"]);

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

                CHelper.RequireBindGrid();
            }
        }