public JsonResult Reserve(ReservationOffline app)
        {
            string   dateTime = app.date + "T" + app.time;
            DateTime dt       = Convert.ToDateTime(dateTime);

            if (dt < DateTime.Now)
            {
                return(Json(new { result = 0 }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                var zaft      = int.Parse(Session["userid"].ToString());
                var reqs      = db.Emp_Org_Services.Where(c => c.emp_id == zaft).ToList();
                var branch_id = reqs[0].branch_id;
                var user      = new user {
                    name = app.name, phone = app.phone
                };
                db.user.Add(user);
                db.SaveChanges();

                var appointment = new Appointments_
                {
                    time       = dt,
                    user_id    = user.id,
                    service_id = app.service_id,
                    branch_id  = branch_id
                };
                db.Appointments_.Add(appointment);
                db.SaveChanges();
                return(Json(new { result = 1 }, JsonRequestBehavior.AllowGet));
            }
        }
        public ActionResult Reserve()
        {
            ViewBag.fullname = Session["username"];
            ViewBag.userid   = Session["userid"];
            ViewBag.user_id  = new SelectList(db.user, "id");
            var zaft = int.Parse(Session["userid"].ToString());

            /////////////////
            List <Notification> allNotis = Get_Notification();

            ViewBag.allNotis = allNotis;
            var countUnseenNotis = Get_UnSeen_Notification().Count();

            ViewBag.countUnseenNotis = countUnseenNotis;
            /////////////////

            //var reqs = db.Request.Where(c => c.empoyee_id == zaft).ToList();
            var v      = db.Emp_Org_Services.Where(c => c.emp_id == zaft).ToList();
            var org_id = v[0].org_id;

            ReservationOffline app = new ReservationOffline();

            app.services = db.Services_.Where(c => c.org_id == org_id).ToList();
            return(View(app));
        }