protected void btnAdd_Click(object sender, EventArgs e)
    {
        SFileSaveTypeData model = new SFileSaveTypeData();
        SFileSaveTypeBB fileSaveTypeBB = new SFileSaveTypeBB();
        try
        {
            if (this.State == "1")
            {
                this.SetModel(ref model);
                fileSaveTypeBB.AddRecord(model);
            }
            else if (this.State == "2")
            {
                model = fileSaveTypeBB.GetModel(this.IdValue);
                this.SetModel(ref model);
                fileSaveTypeBB.ModifyRecord(model);
            }
        }
        catch (Exception ex)
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true);
            return;
        }
        finally
        {
            fileSaveTypeBB.Dispose();
        }

        Response.Redirect("SFileSaveTypeList.aspx?itemNo=" + this.itemNo + "&pTypeNo=main", false);
    }
 private void ShowInfo(string id)
 {
     SFileSaveTypeBB fileSaveTypeBB = new SFileSaveTypeBB();
     vSFileSaveTypeData model = new vSFileSaveTypeData();
     try
     {
         model = fileSaveTypeBB.GetVModel(id);
         this.typeNo.Text = model.typeNo;
         this.typeDesc.Text = model.typeDesc;
         this.urlPath.Text = model.urlPath;
         this.absolutePath.Text = model.absolutePath;
         this.mark.Text = model.mark;
     }
     finally
     {
         fileSaveTypeBB.Dispose();
     }
 }
    /// <summary>
    /// ��Grid
    /// </summary>
    protected void BindGrid()
    {
        SFileSaveTypeBB fileSaveTypeBB = new SFileSaveTypeBB();
        DataSet ds = new DataSet();

        try
        {
            ds = fileSaveTypeBB.GetVList(this.StrWhere);
            this.grid.DataSource = ds.Tables[0];
            this.grid.DataBind();
            //��ֵ��¼������ҳ������
            this.Label3.Text = ds.Tables[0].Rows.Count.ToString();
            this.Label2.Text = this.grid.PageCount.ToString();
            this.currPage.Text = (this.grid.PageIndex + 1).ToString();
        }
        finally
        {
            fileSaveTypeBB.Dispose();
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
         {
             this.IdValue = Request.Params["id"];
         }
         if (Request.Params["state"] != null && Request.Params["state"].Trim() != string.Empty)
         {
             this.State = Request.Params["state"].ToString();
             switch (this.State)
             {
                 case "1":   //add
                     break;
                 case "2":   //update
                     //���ؿؼ�
                     SFileSaveTypeBB fileSaveTypeBB = new SFileSaveTypeBB();
                     SFileSaveTypeData fileSaveTypeData = new SFileSaveTypeData();
                     try
                     {
                         fileSaveTypeData = fileSaveTypeBB.GetModel(this.IdValue);
                         //����й��������˴�Ҫ��֤�Ƿ������޸�
                         this.ShowInfo(this.IdValue);
                     }
                     finally
                     {
                         fileSaveTypeBB.Dispose();
                     }
                     break;
                 default:
                     break;
             }
         }
     }
 }