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

        this.ClientScript.RegisterStartupScript(this.GetType(), "CloseSubmit", "CloseSubmit()", true);
    }
예제 #2
0
    /// <summary>
    /// ��Grid
    /// </summary>
    protected void BindGrid(string messageNo)
    {
        MBusinessFunctionBB businessFunctionBB = new MBusinessFunctionBB();
        DataSet ds = new DataSet();

        try
        {
            ds = businessFunctionBB.GetVList("messageNo='" + messageNo + "'");

            // ��������
            StringBuilder sBuilder = new StringBuilder();
            sBuilder.Append("ҵ�������|@functionNo|@|@left");
            sBuilder.Append("|!ҵ��������|@functionNm|@|@left");
            sBuilder.Append("|!ִ���ļ�Ŀ¼|@functionUrl|@|@left");
            sBuilder.Append("|!���ڸ߶�|@windowheight|@|@left");
            sBuilder.Append("|!���ڿ��|@windowwidth|@|@left");

            //��������
            this.dataGrid.TitleDescription = sBuilder.ToString();
            this.dataGrid.DataSource = ds.Tables[0];
        }
        finally
        {
            businessFunctionBB.Dispose();
        }
    }
 private void ShowInfo(string functionNo)
 {
     MBusinessFunctionData businessFunctionData = new MBusinessFunctionData();
     MBusinessFunctionBB businessFunctionBB = new MBusinessFunctionBB();
     try
     {
         businessFunctionData = businessFunctionBB.GetModel(functionNo);
         this.acceptEmp.Text = businessFunctionData.acceptEmp;
     }
     finally
     {
         businessFunctionBB.Dispose();
     }
 }
 private void ShowInfo(string id)
 {
     MBusinessFunctionBB businessFunctionBB = new MBusinessFunctionBB();
     vMBusinessFunctionData model = new vMBusinessFunctionData();
     try
     {
         model = businessFunctionBB.GetVModel(id);
         this.functionNo.Text = model.functionNo;
         this.functionNm.Text = model.functionNm;
         //this.functionUrl.Text = model.functionUrl;
         this.acceptEmp.Text = model.acceptEmp;
         this.isUseEmpAccept.Text = model.isUseEmpAccept.ToString();
         this.isUseEmpLeaderAccept.Text = model.isUseEmpLeaderAccept.ToString();
         this.useEmpField.Text = model.useEmpField;
         this.windowheight.Text = model.windowheight.ToString();
         this.windowwidth.Text = model.windowwidth.ToString();
         this.isDraw.Text = model.isDraw.ToString();
         this.remark.Text = model.remark;
     }
     finally
     {
         businessFunctionBB.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
                     //���ؿؼ�
                     MBusinessFunctionBB businessFunctionBB = new MBusinessFunctionBB();
                     MBusinessFunctionData businessFunctionData = new MBusinessFunctionData();
                     try
                     {
                         businessFunctionData = businessFunctionBB.GetModel(this.IdValue);
                         //����й��������˴�Ҫ��֤�Ƿ������޸�
                         this.ShowInfo(this.IdValue);
                     }
                     finally
                     {
                         businessFunctionBB.Dispose();
                     }
                     break;
                 default:
                     break;
             }
         }
     }
 }