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

        this.ClientScript.RegisterStartupScript(this.GetType(), "CloseSubmit", "CloseSubmit()", true);
    }
    ///// <summary>
    ///// �󶨲���
    ///// </summary>
    //private void BindDept()
    //{
    //    //treeview set
    //    this.deptTree.Nodes.Clear();
    //    this.deptTree.Font.Name = "����";
    //    this.deptTree.Font.Size = FontUnit.Parse("9");
    //    DataSet ds = new DataSet();
    //    HOrgnizationBB orgnizationBB = new HOrgnizationBB();
    //    try
    //    {
    //        //��ȡһ������
    //        ds = orgnizationBB.GetList("");
    //        DataRow[] drs = ds.Tables[0].Select("uppDepartId=0", "departId");//��ѡ�����и��ڵ�
    //        foreach (DataRow row in drs)
    //        {
    //            string departId = row["departId"].ToString();
    //            string departNm = row["departNm"].ToString();
    //            TreeNode rootNode = new TreeNode();
    //            rootNode.Text = departNm;
    //            rootNode.Value = departId;
    //            //rootNode.NavigateUrl = "#";
    //            rootNode.Expanded = true;
    //            //rootNode.ImageUrl = imageurl;
    //            rootNode.SelectAction = TreeNodeSelectAction.Expand;
    //            this.deptTree.Nodes.Add(rootNode);
    //            this.CreateDeptNode(int.Parse(departId), rootNode, ds.Tables[0]);
    //        }
    //    }
    //    finally
    //    {
    //        orgnizationBB.Dispose();
    //    }
    //}
    ////�����ڵ�
    //private void CreateDeptNode(int uppDepartId, TreeNode parentNode, DataTable dt)
    //{
    //    DataRow[] drs = dt.Select("uppDepartId=" + uppDepartId, "departId");//ѡ�������ӽڵ�
    //    foreach (DataRow row in drs)
    //    {
    //        string departId = row["departId"].ToString();
    //        string departNm = row["departNm"].ToString();
    //        TreeNode node = new TreeNode();
    //        node.Text = departNm;
    //        node.Value = departId;
    //        //node.NavigateUrl = "#";
    //        //node.ImageUrl = imageurl;
    //        node.Expanded = true;
    //        node.SelectAction = TreeNodeSelectAction.Expand;
    //        if (parentNode == null)
    //        {
    //            this.deptTree.Nodes.Clear();
    //            parentNode = new TreeNode();
    //            this.deptTree.Nodes.Add(parentNode);
    //        }
    //        parentNode.ChildNodes.Add(node);
    //        this.CreateDeptNode(int.Parse(departId), node, dt);
    //    }
    //}
    ///// <summary>
    ///// ����Ա
    ///// </summary>
    //private void BindEmp()
    //{
    //    //treeview set
    //    this.empTree.Nodes.Clear();
    //    this.empTree.Font.Name = "����";
    //    this.empTree.Font.Size = FontUnit.Parse("9");
    //    DataSet ds = new DataSet();
    //    HEemployeeBB eemployeeBB = new HEemployeeBB();
    //    try
    //    {
    //        string deptId = this.deptTree.SelectedValue;
    //        if (deptId == "")
    //        {
    //            deptId = this.deptTree.Nodes[0].Value;
    //        }
    //        ds = eemployeeBB.GetList(" nowDepartId='" + deptId + "'");
    //        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
    //        {
    //            DataRow row = ds.Tables[0].Rows[i];
    //            string empId = row["empId"].ToString();
    //            string empNm = row["empNm"].ToString();
    //            TreeNode rootNode = new TreeNode();
    //            rootNode.Text = empNm;
    //            rootNode.Value = empId;
    //            rootNode.NavigateUrl = "#";
    //            rootNode.Expanded = true;
    //            //rootNode.ImageUrl = imageurl;
    //            rootNode.SelectAction = TreeNodeSelectAction.Expand;
    //            this.empTree.Nodes.Add(rootNode);
    //            //this.CreateNode(framename, int.Parse(nodeId), rootNode, dt);
    //        }
    //    }
    //    finally
    //    {
    //        eemployeeBB.Dispose();
    //    }
    //}
    ///// <summary>
    ///// �󶨽�ɫ
    ///// </summary>
    //private void BindRole()
    //{
    //    //treeview set
    //    this.roleTree.Nodes.Clear();
    //    this.roleTree.Font.Name = "����";
    //    this.roleTree.Font.Size = FontUnit.Parse("9");
    //    DataSet ds = new DataSet();
    //    PRoleBB roleBB = new PRoleBB();
    //    try
    //    {
    //        ds = roleBB.GetList("");
    //        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
    //        {
    //            DataRow row = ds.Tables[0].Rows[i];
    //            string roleId = row["id"].ToString();
    //            string roleNm = row["roleName"].ToString();
    //            TreeNode rootNode = new TreeNode();
    //            rootNode.Text = roleNm;
    //            rootNode.Value = roleId;
    //            //rootNode.NavigateUrl = "#";
    //            //rootNode.Expanded = true;
    //            //rootNode.ImageUrl = imageurl;
    //            //rootNode.SelectAction = TreeNodeSelectAction.Expand;
    //            this.roleTree.Nodes.Add(rootNode);
    //        }
    //    }
    //    finally
    //    {
    //        roleBB.Dispose();
    //    }
    //}
    protected void btnSave_Click(object sender, EventArgs e)
    {
        WFunctionStepData functionStepData = new WFunctionStepData();
        WFunctionStepBB functionStepBB = new WFunctionStepBB();
        try
        {
            functionStepData = functionStepBB.GetModel(this.IdValue);
            functionStepData.doEmp = this.hidAuditEmp.Value;
            functionStepBB.ModifyRecord(functionStepData);
        }
        finally
        {
            functionStepBB.Dispose();
        }

        this.ClientScript.RegisterStartupScript(this.GetType(), "close", "close()", true);
    }