예제 #1
0
        protected void gridWorkLine_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Edit")
            {
                //Response.Redirect("Category.aspx?Id=" + e.CommandArgument);
            }
            else
            if (e.CommandName == "Delete")
            {
                var data = new ConfirmData();

                data.Command     = "Delete";
                data.Id          = e.CommandArgument.ToSafeInt();
                data.Msg         = "آیا از حذف اطمینان دارید؟";
                data.Table       = "Worklines";
                data.RedirectAdr = "Workline.aspx";

                Session["ConfirmData"] = data;
                Response.RedirectToRoute("Confirmation");
                Response.End();
            }
        }
예제 #2
0
        protected void gridList_OnRowCommand(object sender, GridViewCommandEventArgs e)
        {
            var routeValues = new RouteValueDictionary();
            routeValues.Add("Id", e.CommandArgument);

            if (e.CommandName == "Edit")
            {
                Response.RedirectToRoute("Process", routeValues);
                Response.End();
            }
            else if (e.CommandName == "Delete")
            {
                if (e.CommandArgument.ToSafeInt() == 99 || e.CommandArgument.ToSafeInt() == 999)
                {
                    Session["PostProcessMessage"] = new PostProcessMessage()
                    {
                        Message = "این فرآیند سیستمی است و قابل حذف نیست",
                        MessageType = MessageType.Error
                    };

                    Response.RedirectToRoute("ProcessList");
                }
                else
                {
                    var data = new ConfirmData();

                    data.Command = "Delete";
                    data.Id = e.CommandArgument.ToSafeInt();
                    data.Msg = "آیا از حذف اطمینان دارید؟";
                    data.Table = "Processes";
                    data.RedirectAdr = "ProcessList";

                    Session["ConfirmData"] = data;
                    Response.RedirectToRoute("Confirmation");
                    Response.End();
                }
               
            }
        }
예제 #3
0
        protected void gridList_OnRowCommand(object sender, GridViewCommandEventArgs e)
        {
            var routeValues = new RouteValueDictionary();

            routeValues.Add("Id", e.CommandArgument);

            if (e.CommandName == "Edit")
            {
                Response.RedirectToRoute("Order", routeValues);
                Response.End();
            }
            else if (e.CommandName == "Delete")
            {
                //var msg = Utility.AesEncrypt("آیا از حذف سفارش اطمینان دارید؟");
                //var table = Utility.AesEncrypt("Orders");
                //routeValues.Add("Msg", msg);
                //routeValues.Add("Table", table);
                //Response.RedirectToRoute("Confirmation", routeValues);
                //Response.End();

                var data = new ConfirmData();

                data.Command       = "Delete";
                data.Id            = e.CommandArgument.ToSafeInt();
                data.Msg           = "آیا از حذف سفارش اطمینان دارید؟";
                data.Table         = "Orders";
                data.RedirectRoute = "OrderList";

                Session["ConfirmData"] = data;
                Response.RedirectToRoute("Confirmation");
                Response.End();
            }
            else if (e.CommandName == "Print")
            {
                Response.RedirectToRoute("OrderPrint", routeValues);
                Response.End();
            }
        }