protected void btnAdd_Click(object sender, EventArgs e)
    {
        GCalendarArrangeData model = new GCalendarArrangeData();
        GCalendarArrangeBB calendarArrangeBB = new GCalendarArrangeBB();
        try
        {
            if (this.State == "1")
            {
                this.SetModel(ref model);
                model.isrtDt = DateTime.Now.ToString();
                model.isrtEmpId = this.currentUser.empId;
                model.isDel = false;
                model.isRead = false;
                this.IdValue = calendarArrangeBB.AddRecord(model);
            }
            else if (this.State == "2")
            {
                model = calendarArrangeBB.GetModel(this.IdValue);
                this.SetModel(ref model);
                model.updtDt = DateTime.Now.ToString();
                model.updtEmpId = this.currentUser.empId;
                calendarArrangeBB.ModifyRecord(model);
            }
        }
        catch (Exception ex)
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true);
            return;
        }
        finally
        {
            calendarArrangeBB.Dispose();
        }

        Response.Redirect("GCalendarArrangeList.aspx?itemNo=" + this.itemNo + "&pTypeNo=main", false);
    }
    /// <summary>
    /// ɾ��
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnDel_Click(object sender, EventArgs e)
    {
        bool retChecked = false;
        GCalendarArrangeBB calendarArrangeBB = new GCalendarArrangeBB();
        try
        {
            //��ȡѡ�е�����Id
            foreach (GridViewRow gvrow in this.grid.Rows)
            {
                CheckBox chkId = (CheckBox)gvrow.FindControl("chkId");
                if (chkId.Checked == true)
                {
                    retChecked = true;
                    int id = int.Parse(chkId.ValidationGroup);
                    GCalendarArrangeData calendarArrangeData = new GCalendarArrangeData();
                    calendarArrangeData = calendarArrangeBB.GetModel(id);

                    calendarArrangeData.isDel = true;
                    calendarArrangeBB.ModifyRecord(calendarArrangeData);
                }
            }
        }
        catch (Exception ex)
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true);
            return;
        }
        finally
        {
            calendarArrangeBB.Dispose();
        }

        if (retChecked)
        {
            this.BindGrid();
        }
    }