コード例 #1
0
        // GET: Environment
        public ActionResult Index()
        {
            //Domain.Users.DTOs.External.Users user = (Domain.Users.DTOs.External.Users)Session["KullaniciBilgileri"];
            int UserId = 0;
            List <Domain.Environment.DTOs.External.Environment> Environment = new List <Domain.Environment.DTOs.External.Environment>();

            if (this.ControllerContext.HttpContext.Request.Cookies.AllKeys.Contains("UserCookie"))
            {
                HttpCookie cookie = this.ControllerContext.HttpContext.Request.Cookies["UserCookie"];
                UserId = Convert.ToInt32(cookie.Values["Id"]);
                Domain.Environment.EnvironmentDomain ed = new Domain.Environment.EnvironmentDomain();
                Environment = ed.GetAll(UserId).ToList();
            }
            return(View(Environment));
        }
コード例 #2
0
        public ActionResult Create()
        {
            Domain.Profile.ProfileDomain         pd = new Domain.Profile.ProfileDomain();
            Domain.Environment.EnvironmentDomain ed = new Domain.Environment.EnvironmentDomain();
            int UserId = 0;

            if (this.ControllerContext.HttpContext.Request.Cookies.AllKeys.Contains("UserCookie"))
            {
                HttpCookie cookie = this.ControllerContext.HttpContext.Request.Cookies["UserCookie"];
                UserId = Convert.ToInt32(cookie.Values["Id"]);
            }

            ViewBag.Profiller   = pd.GetProfileList();
            ViewBag.Environment = ed.GetAll(UserId);

            return(View());
        }
コード例 #3
0
        public ActionResult Edit(Guid Id)
        {
            Domain.Profile.ProfileDomain         pd = new Domain.Profile.ProfileDomain();
            Domain.Environment.EnvironmentDomain ed = new Domain.Environment.EnvironmentDomain();
            int UserId = 0;

            if (this.ControllerContext.HttpContext.Request.Cookies.AllKeys.Contains("UserCookie"))
            {
                HttpCookie cookie = this.ControllerContext.HttpContext.Request.Cookies["UserCookie"];
                UserId = Convert.ToInt32(cookie.Values["Id"]);
            }

            ViewBag.Profiller   = pd.GetProfileList();
            ViewBag.Environment = ed.GetAll(UserId);

            Domain.Device.DeviceDomain    dd         = new Domain.Device.DeviceDomain();
            Domain.Device.DTOs.DeviceRead DeviceRead = dd.GetDeviceById(Id);

            return(View(DeviceRead));
        }