Ejemplo n.º 1
0
        protected void OrderGridView_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string strID   = e.CommandArgument.ToString();
            string strName = e.CommandName.ToLower();

            switch (strName)
            {
            case "_edit":
                divAddEdit.Visible      = true;
                txtOrderId.Visible      = false;
                divGridView.Visible     = false;
                HiddenField_value.Value = strID;
                LoadDataToEdit();
                break;

            case "_delete":
                try
                {
                    logicData.DeleteOrderByID(strID);
                    IbIDisplay.Visible = false;
                    BindingOrderData();
                }
                catch (Exception)
                {
                    IbIDisplay.Visible = true;
                    IbIDisplay.Text    = "You can not delete this order!";
                }
                break;
            }
        }
Ejemplo n.º 2
0
        public ActionResult Delete(string ID)
        {
            ResponseMsg response = new ResponseMsg();

            if (Convert.ToInt32(ID) > 0)
            {
                OrderLogic.DeleteOrderByID(ID);
                response.IsSuccess     = true;
                response.ResponseValue = "";
            }
            return(Json(response, JsonRequestBehavior.AllowGet));
        }