主管与所选圈子的关联 [英] assocaition of supervisor to the selected circle

查看:84
本文介绍了主管与所选圈子的关联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我选择一个圈子时,我在O& M Cluster的员工母版页面担任员工角色主管,然后主管应该只显示那些角色是特定圈子下的主管的员工ID。对于管理程序绑定,我使用了mysql中的视图来获取数据。这里的绑定代码可以帮助我吗?

I ve employee role supervisor in employee master page in O&M Cluster when i select a circle and then supervisor should display only those employee ids whose role is supervisor under tat particular circle. for supervisor binding i ve used view in mysql for fetching data. here s the code for binding can anyone help me with this?

private void _bindClusterSupervisor()
{
    try
    {
        int _errorCode = (int)ErrorCodes.NoError;
        string _tblNM = DBStructure.VIEW_GET_ACTIVE_EMPLOYEES;
        FieldNames[] _selFlds = new FieldNames[2];
        _selFlds[0].FieldName = DBStructure.EMPLOYEE_MASTER_ID;
        _selFlds[1].FieldName = DBStructure.EMPLOYEE_MASTER_CODE;

        cndCheck[] _whClause = new cndCheck[2];
        _whClause[0].FieldName = DBStructure.EMPLOYEE_MASTER_ACCOUNT_ID;
        _whClause[0].FieldType = Fieldtypes.Integer;
        _whClause[0].FirstFieldValue = UserGroupID.ToString();
        _whClause[0].ArithmeticOp = ArithmeticOperator.EQUALS;
        _whClause[0].LogicOp = LogicalOperator.AND;

        _whClause[1].FieldName = DBStructure.EMPLOYEE_MASTER_ROLE_ID;
        _whClause[1].FieldType = Fieldtypes.Integer;
        _whClause[1].FirstFieldValue =((int)BasicEmployeeRoles.Supervisor).ToString();
        _whClause[1].ArithmeticOp = ArithmeticOperator.EQUALS;

        sortColumn[] _sortClause = new sortColumn[1];
        _sortClause[0].FieldName = DBStructure.EMPLOYEE_MASTER_CODE;
        _sortClause[0].SortOrder = ColSortOrder.ASCENDING;

            DataSet _dsCircle = _dalAccess.Select(false, _tblNM, true, _selFlds, _whClause, _sortClause, out _errorCode);
            if (_errorCode == (int)ErrorCodes.NoError)
            {
                DataTable _dtUpdated = AddSelectRow(_dsCircle.Tables[0], DBStructure.EMPLOYEE_MASTER_ID, DBStructure.EMPLOYEE_MASTER_CODE);

                this.cmbClusterSupervisor.DataSource = _dtUpdated;
                this.cmbClusterSupervisor.DataTextField = _dtUpdated.Columns[DBStructure.EMPLOYEE_MASTER_CODE].ColumnName.ToString();
                this.cmbClusterSupervisor.DataValueField = _dtUpdated.Columns[DBStructure.EMPLOYEE_MASTER_ID].ColumnName.ToString();
                this.cmbClusterSupervisor.DataBind();

            }
         }
    catch (Exception ex)
    {
        _errorLogger.PrintUnknownError(ex.Message.ToString() + ex.StackTrace, GetModuleName(), GetPageName(), "_bindClusterSupervisor");
    }
}

推荐答案

这篇关于主管与所选圈子的关联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆