Пример #1
0
        public ActionResult DeviceList(double?id, string ed)
        {
            if (((tbl_UserDetail)Session["User"]).GroupPages.Contains("DeviceList"))
            {
                if (Session["User"] == null)
                {
                    return(RedirectToAction("LogIn", "LogIn"));
                }
                try
                {
                    if (id != null)
                    {
                        var x = MvcHelper.GetMasterDevice(Convert.ToInt64(id));
                        if (!string.IsNullOrEmpty(ed) && ed.Equals("2"))
                        {
                            x.ApproveStat = string.Empty;
                        }
                        ViewBag.obj = x;
                        ViewBag.hid = id;
                    }

                    ViewBag.list = MvcHelper.GetMasterDeviceList();
                }
                catch (Exception ex)
                {
                    TempData["Error"] = "Something went wrong.";
                }
                return(View());
            }
            else
            {
                return(RedirectToAction("Error", "ErrorPage"));
            }
        }