Exemplo n.º 1
0
        protected void btnDeleteLink_Click(Object Sender, ImageClickEventArgs e)
        {
            ImageButton oButton = (ImageButton)Sender;

            oIncident.Delete(Int32.Parse(oButton.CommandArgument));
            Response.Redirect(Request.Path);
        }
Exemplo n.º 2
0
        protected void lbIncidentDeleteAll_Click(object sender, System.EventArgs e)
        {
            int IncidentId = int.Parse(hdnIncidentId.Value);

            Incident.Delete(IncidentId);
            BindDGIncident();
        }
Exemplo n.º 3
0
        private void dgIncidents_DeleteCommand(object source, DataGridCommandEventArgs e)
        {
            int sid = int.Parse(e.Item.Cells[0].Text);

            Incident.Delete(sid);
            Response.Redirect("~/Apps/HelpDeskManagement/Pages/IncidentListNew.aspx");
        }
Exemplo 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"]);

                int error = 0;
                using (DbTransaction tran = DbTransaction.Begin())
                {
                    foreach (string elem in elemsToDelete)
                    {
                        int id = Convert.ToInt32(elem.Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries)[0], CultureInfo.InvariantCulture);
                        if (id > 0)
                        {
                            Incident.Delete(id);
                        }
                    }
                    tran.Commit();
                }
                if (error > 0)
                {
                    ClientScript.RegisterStartupScript(((Control)Sender).Page, ((Control)Sender).Page.GetType(), Guid.NewGuid().ToString("N"),
                                                       String.Format("alert('{0}');", CHelper.GetResFileString("{IbnFramework.ListInfo:RefItemException}")), true);
                }

                CHelper.RequireBindGrid();
            }
        }
Exemplo n.º 5
0
        protected void lbDeleteIncidentAll_Click(object sender, System.EventArgs e)
        {
            string link = GetLink();

            Incident.Delete(IncidentId);

            Response.Redirect(link, true);
        }
Exemplo n.º 6
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)
                {
                    Incident.Delete(id);
                }

                CHelper.RequireBindGrid();
            }
        }
Exemplo n.º 7
0
 public ActionResult Delete(long incidentId, int userId, int companyId)
 {
     return(Incident.Delete(incidentId, userId, companyId));
 }