コード例 #1
0
    /// <summary>
    /// 查詢邏輯
    /// </summary>
    private void DoQuery()
    {
        var isSuccess = false;
        var msg       = "";
        var datas     = new List <QueryListBean>();
        var viewData  = new EmpWorkTimeModel();

        if (_IsBoss)
        {
            if (ddlCompID.SelectedValue == "")
            {
                gvMain.DataSource = null;
                gvMain.DataBind();
                return;
            }

            viewData.CompID      = ddlCompID.SelectedValue;
            viewData.OrganID     = GetOrganWhere();
            viewData.FlowOrganID = GetFlowOrganWhere();
            viewData.EmpID       = txtEmpID.Text.Trim();
            viewData.EmpName     = txtEmpName.Text.Trim();
            //viewData.AllSearch = (ddlOrgType.SelectedValue == "" && ddlDeptID.SelectedValue == "" && ddlOrganID.SelectedValue == "" && ddlRoleCode40.SelectedValue == "" && ddlRoleCode30.SelectedValue == "" && ddlRoleCode20.SelectedValue == "" && ddlRoleCode10.SelectedValue == "");
        }
        else
        {
            viewData.CompID = UserInfo.getUserInfo().CompID;
            viewData.EmpID  = UserInfo.getUserInfo().UserID;
        }

        isSuccess = WorkTime.LoadEmpWorkTimeGridData(viewData, out datas, out msg);
        if (msg != "")
        {
            Util.MsgBox(msg);
            gvMain.DataSource = null;
            gvMain.DataBind();
            return;
        }
        if (isSuccess && datas != null)
        {
            gvMain.DataSource = datas;
            gvMain.DataBind();
        }
    }