Beispiel #1
0
    protected void gvData_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string commandName = e.CommandName;
        int    id          = e.CommandArgument.ToArrowInt();

        if (e.CommandName == "UpdateData")
        {
            Response.Redirect("GroupEdit.aspx?LineID=" + MyLine.ID + "&id=" + id + CreateReturnUrl("&"));
        }
        else if (e.CommandName == "DelData")
        {
            //删除
            GroupBLL.SetGroupIsDel(id, 1);
            BindData();
            MessageBox.Show("删除成功!");
        }
        else if (e.CommandName == "AddData")
        {
            var model = GroupBLL.SelectGroup(id);
            if (model != null)
            {
                model.GoDate          = model.GoDate.AddDays(1);
                model.BackDate        = model.BackDate.AddDays(1);
                model.JoinNum         = 0;
                model.AddTime         = DateTime.Now;
                model.AddUserName     = CurrentAdmin.UserName;
                model.AddUserRealName = CurrentAdmin.RealName;

                GroupBLL.AddGroup(model);
                BindData();
            }
        }
    }