mvc+EF+EASYUI问题,求大神解决

鲜蛋网 2014-04-27 02:37:40





上面两张图,我想实现在发放记录里,根据当前用户的职位名称,获取薪资标准的基本工资。


比如:高莉 是 经理,薪资标准里,经理的基本工资是5000,我想在发放记录里多一个列获取经理的基本工资,然后把当前的金额进行一个结算,显示在总金额列里,大神帮忙,小弟十分感谢!
...全文
138 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
david_88888 2015-04-30
  • 打赏
  • 举报
回复
建个视图,在后数据库里把数据处理好再返回给"发放记录"
zijiang001 2014-04-27
  • 打赏
  • 举报
回复
对呀 连接到基本工资表直接取基本工资就好了呀
鲜蛋网 2014-04-27
  • 打赏
  • 举报
回复
多表查询是吧?
zijiang001 2014-04-27
  • 打赏
  • 举报
回复
不能直接用SQL语句取的基本工资后绑定到前台吗?
鲜蛋网 2014-04-27
  • 打赏
  • 举报
回复
大神,怎么写哈,给个示例什么的
走着看世界 2014-04-27
  • 打赏
  • 举报
回复
1:修改返回数据集,查询经理的基本工资。
鲜蛋网 2014-04-27
  • 打赏
  • 举报
回复
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_HrmsMaster.cshtml";
}

<div style="padding-left: 250px;">
    <table >
        <tr>
            <td>
               查询条件:

            </td>
            <td>
                <input type="text" id="Search" class="easyui-validatebox" />

            </td>
            <td>
            <input id="ToName" name="Searchs" class="easyui-validatebox" type="radio" checked="checked" />按姓名
            </td>
        <td>
            <input id="ToPosition" name="Searchs" class="easyui-validatebox" type="radio" />按职位
        </td>
            <td>
                <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-search" plain="true">搜索</a>
            </td>
            <td>
                <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-reload" plain="true">刷新</a></td>
        </tr>
    </table>
</div>

<div id="mian" style="width: 100%;">
    <div title="薪资标准" style="padding: 5px">

        <table id="trainItem-dg" title="薪资标准" class="easyui-datagrid" style="width: 1150px;" url="/Payment/LoadPayment" toolbar="#toolbar" pagination="true" rownumbers="true" fitcolumns="true" singleselect="true">
            <thead>
                <tr>
                    <th data-options="field:'ck',checkbox:true"></th>
                    <th field="Position" formatter="formatterPosition" width="20">职位名称</th>
                    <th field="BasicWage" width="20">基本工资</th>
                    <th field="TraficSubsidy" width="20">交通补贴</th>
                    <th field="CommunicationSubsidy" width="20">通讯补贴</th>
                    <th field="LunchSubsidy" width="20">午餐补贴</th>
                    <th field="FloatingWage" width="50">浮动工资</th>
                    <th field="CustomTime" width="50">制定时间</th>
                </tr>
            </thead>
        </table>

        <div id="toolbar">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-add" plain="true" onclick="newUser()">添加</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-edit" plain="true" onclick="editUser()">修改</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-cancel" plain="true" onclick="destroyUser()">删除</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-search" plain="true" onclick="visitUser()">浏览</a>
        </div>
    </div>
</div>

<script>
    function formatterPosition(value)
    {
        return value.PositionName
    }

    function newUser() {
        $('#DivAddUser').dialog('open').dialog('setTitle', '添加用户');
        $('#fm').form('clear');
        url = '/Home/RegistUser';
    }

</script>
鲜蛋网 2014-04-27
  • 打赏
  • 举报
回复
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_HrmsMaster.cshtml";
}

<div style="padding-left: 250px;">
    <table >
        <tr>
            <td>
               查询条件:

            </td>
            <td>
                <input type="text" id="Search" class="easyui-validatebox" />

            </td>
            <td>
            <input id="ToName" name="Searchs" class="easyui-validatebox" type="radio" checked="checked" />按姓名
            </td>
        <td>
            <input id="ToPosition" name="Searchs" class="easyui-validatebox" type="radio" />按职位
        </td>
            <td>
                <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-search" plain="true">搜索</a>
            </td>
            <td>
                <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-reload" plain="true">刷新</a></td>
        </tr>
    </table>
</div>

<div id="mian" style="width: 100%;">
    <div title="发放记录" style="padding: 5px">

        <table id="trainItem-dg" title="发放记录" class="easyui-datagrid" style="width: 1150px;" url="/PaymentGrant/LoadGrant" toolbar="#toolbar" pagination="true" rownumbers="true" fitcolumns="true" singleselect="true">
            <thead>
                <tr>
                    <th data-options="field:'ck',checkbox:true"></th>
                    <th field="Employee" formatter="formatterEmployee" width="20">员工姓名</th>
                    <th field="DutyName" width="20">职位名称</th>
                   <!-- <th field="Payment" formatter="formatterPayment" width="20">基本工资</th>-->
                    <th field="TraficSubsidy" width="20">交通补贴</th>
                    <th field="CommunicationSubsidy" width="20">通讯补贴</th>
                    <th field="LunchSubsidy" width="20">午餐补贴</th>
                    <th field="FloatingWage" width="50">浮动工资</th>
                    <th field="Deduction" width="50">扣除工资</th>
                     <th field="Reward" width="50">奖金</th>
                    <th field="Grant" width="50">发放时间</th>
                    <th field="EmployeeName" width="50">发放人</th>

                </tr>
            </thead>
        </table>

        <div id="toolbar">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-add" plain="true" onclick="newUser()">添加</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-edit" plain="true" onclick="editUser()">修改</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-cancel" plain="true" onclick="destroyUser()">删除</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-search" plain="true" onclick="visitUser()">浏览</a>
        </div>
    </div>
</div>
<script>
    function formatterEmployee(value)
    {
        return value.RealName
    }

</script>

62,072

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧