如何过滤基于登录名的Empid [英] How to filter the based on login empid

查看:63
本文介绍了如何过滤基于登录名的Empid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

public ActionResult Create(ded_table ded_table, login_user luser)
       {

           if (ModelState.IsValid)
           {
               var str = (from li in db.login_user

                          where li.EmpId == luser.EmpId
                          select new
                          {
                              id = li.EmpId,
                          }).ToArray();

               return Json(str);

               db.ded_table.AddObject(ded_table);
               db.SaveChanges();
               return RedirectToAction("Index");
           }


我没有得到luser.Empid


i am not geting the luser.Empid

推荐答案



请从调用此方法的位置检查Iuser值.并且请不要在您的下面的方法中永远不会执行代码.

Hi,

Please check the Iuser value from where you calling this method. and please not that in you method below code will never execute.

return Json(str);//After this line no code will be executed.
db.ded_table.AddObject(ded_table);
db.SaveChanges();
return RedirectToAction("Index");



这可能会对您有所帮助.



This may help you.


这篇关于如何过滤基于登录名的Empid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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