Пример #1
0
        private void lbApproveChecked_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.ApprovePending(alIds);
            Response.Redirect("~/Incidents/EMailPendingMessages.aspx");
        }
Пример #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");
     }
 }
Пример #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.ApprovePending(id);
                }

                CHelper.RequireBindGrid();
            }
        }
Пример #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.ApprovePending(alIds);

                CHelper.RequireBindGrid();
            }
        }