public JsonResult GetBranchsByOrganizationId(int?organizationId)
        {
            var branches = branchManager.GetBranchsByOrganizationId(organizationId).Select(c => new
            {
                c.Id,
                c.Name,
                c.ShortName
            });

            return(Json(branches, JsonRequestBehavior.AllowGet));
        }
        //public ActionResult RegisteredAssets(int? id)
        //{
        //    if (Session["username"] == null)
        //    {
        //        return RedirectToAction("HomePage", "Home");
        //    }

        //    var data = assetRegistrationManager.GetAll();
        //    if (id == 0 || id == null)
        //    {
        //        return View(data);
        //    }
        //    else
        //    {
        //        AssetRegistration assetRegistration = assetRegistrationManager.GetById(id);
        //        if (assetRegistration != null)
        //        {
        //            AssetRegistrationDetails assetregDetails = assetRegDetailsManager.GetById(assetRegistration.Id);
        //            if (assetRegistration != null || assetregDetails != null)
        //            {
        //                assetRegDetailsManager.Delete(assetregDetails);
        //                assetRegistrationManager.Delete(assetRegistration);
        //                data = assetRegistrationManager.GetAll();
        //            }
        //        }

        //    }
        //    return View(data);
        //}

        public ActionResult RegisteredAsset(int?id)
        {
            var newasset = newAssetManager.GetAll();

            if (Session["username"] == null)
            {
                return(RedirectToAction("HomePage", "Home"));
            }

            var userlist = userManager.GetAll().Where(c => c.UserName == Session["username"].ToString()).ToList();
            int orgid    = 0;

            foreach (var t in userlist)
            {
                orgid = t.OrganizationId;
            }

            ViewBag.branchlist = branchManager.GetBranchsByOrganizationId(orgid).ToList();

            return(View());
        }