Пример #1
0
        public ActionResult ChangeIsCompletedStatus()
        {
            try
            {
                int id = Convert.ToInt32(Request.Form["id"]);
                int IsCompletedStatus = Convert.ToInt32(Request.Form["Status"]);

                tblExposing exposing = db.tblExposings.SingleOrDefault(c => c.ExposeID == id);

                if (IsCompletedStatus == 1)
                {
                    exposing.IsCompleted = true;
                }

                if (IsCompletedStatus == 0)
                {
                    exposing.IsCompleted = false;
                }

                db.Entry(exposing).State = EntityState.Modified;
                db.SaveChanges();
                return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new { Error = false, message = "Error!" + ex.Message }, JsonRequestBehavior.AllowGet));
            }
        }
Пример #2
0
        public ActionResult DeleteExpose(int id)
        {
            if (Session["StudioID"] == null && Session["StudioName"] == null && Session["StudioPhoneNo"] == null)
            {
                return(RedirectToAction("Login", "Login"));
            }
            try
            {
                tblExposing exposing = db.tblExposings.Find(id);
                tblBooking  booking  = db.tblBookings.SingleOrDefault(b => b.BookingID == exposing.BookingID);
                booking.IsExposed       = false;
                booking.UpdatedDate     = DateTime.Now;
                db.Entry(booking).State = EntityState.Modified;

                db.tblExposings.Remove(exposing);
                db.SaveChanges();
                return(Json(new { success = true, message = "Record deleted successfully" }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new { success = false, message = "Record not deleted" + ex.Message }, JsonRequestBehavior.AllowGet));
            }
        }
Пример #3
0
        public ActionResult Exposing()
        {
            try
            {
                int    BookingID          = Convert.ToInt32(Request.Form["BookingID"]);
                int    PhotographerID     = Convert.ToInt32(Request.Form["PhotographerID"]);
                string BookingDescription = Request.Form["BookingDescription"];
                string Address            = Request.Form["Address"];

                tblExposing exposing = new tblExposing();
                tblBooking  booking  = db.tblBookings.SingleOrDefault(b => b.BookingID == BookingID);

                exposing.BookingID      = BookingID;
                exposing.PhotographerID = PhotographerID;
                if (BookingDescription.Trim().Equals("1"))
                {
                    exposing.Description = booking.BookingDescription;
                    booking.IsExposed    = true;
                }
                else
                {
                    exposing.Description = BookingDescription;
                }

                exposing.Location    = Address;
                exposing.CreatedDate = DateTime.Now;

                db.tblExposings.Add(exposing);
                db.Entry(booking).State = EntityState.Modified;
                db.SaveChanges();
                return(Json(new { success = true, message = "Event exposed successfully." }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new { success = false, message = "Error!" + ex.Message }, JsonRequestBehavior.AllowGet));
            }
        }