Пример #1
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            DataTable dt2 = new DataTable();

            dt2 = ViewState["Mydt"] as DataTable;
            int    rowIndex = Convert.ToInt32(e.CommandArgument);
            string CatName  = dt2.Rows[rowIndex][0].ToString();

            CategoryBL.Delete(CatName);
            FillGridView();
        }
        public ActionResult Delete(string id)
        {
            List <string> lstMsg = new List <string>();

            int returnCode = _categoryBL.Delete(id, out lstMsg);

            if (((int)Common.ReturnCode.Succeed == returnCode))
            {
                return(Json(new { Message = true }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { Message = false }, JsonRequestBehavior.AllowGet));
            }
        }
        public ActionResult Delete(string id)
        {
            var categories = objBS.GetAll();

            try
            {
                objBS.Delete(id);
                PrepareData(null, null, null, "A törlés sikeres");

                return(Json(new { ok = true, newurl = Url.Action("Index") }));
            }
            catch
            {
                PrepareData(null, null, null, "A törlés sikertelen");
                return(Json(new { ok = true, newurl = Url.Action("Index") }));
            }
        }
Пример #4
0
        // DELETE: api/Categorias/5
        public HttpResponseMessage Delete(string id)
        {
            var category = categoryBL.Find(id);

            if (category != null)
            {
                var response = categoryBL.Delete(category);
                if (response)
                {
                    return(Request.CreateResponse(HttpStatusCode.OK));
                }
                return(Request.CreateResponse(HttpStatusCode.Conflict, "Algunos productos dependen de esta categoría"));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
        }
Пример #5
0
 public void Delete()
 {
     var category = categoryBL.Delete(cacheKey, 10);
 }
Пример #6
0
 public void Delete([FromBody] CategoryDTO category)
 {
     CategoryBL.Delete(category);
 }