/// <summary>
        /// Get Category details By ID -Vinod
        /// </summary>
        /// <param name="CategoryID"></param>
        /// <returns></returns>
        public PartialViewResult GetCategoryById(string CategoryID)
        {
            CategoryModel CM = new CategoryModel();
            tbl_Category  category;

            category = CategoryBL.GetByID(CategoryID.Trim());

            if (category == null)
            {
                category = new tbl_Category();
            }
            CM.CategoryID   = category.CategoryID;
            CM.CategoryDesc = category.CategoryDesc;

            return(PartialView("~/Views/Category/Partial/_CategoryDetailsPartial.cshtml", CM));
        }
Example #2
0
        /// <summary>
        /// I use this method when a user wants to create a new appointment.
        /// </summary>
        /// <param name="appointment"></param>
        /// <returns></returns>
        public static SchedulerReservations DataConverter(SchedulerReservations appointment)
        {
            CategoryBL categBL = new CategoryBL();
            CATEGORIES categ   = categBL.GetByID(appointment.CategoryName);

            appointment.CurrentPrice    = (int)categ.Price;
            appointment.End             = appointment.Start.AddMinutes((int)categ.ProcessLengthInMunites);
            appointment.TaskID          = CalculateAppointmentID();
            appointment.ReservationDate = DateTime.Now;

            UserBL userBL = new UserBL();

            appointment.Title       = userBL.GetByID(appointment.NickName).FullName + ", " + categ.CategoryName;
            appointment.Description = appointment.Title + ", " + appointment.CurrentPrice + ", " + appointment.ReservationDate;

            return(appointment);
        }
        public ActionResult Edit(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                TempData["Error"] = "Data has already been deleted by other user!";
                return(RedirectToAction("Index"));
            }

            CategoryModel Model      = new CategoryModel();
            int           returnCode = _categoryBL.GetByID(long.Parse(id), out Model);

            if (Model == null)
            {
                TempData["Error"] = "Data has already been deleted by other user!";
                return(RedirectToAction("Index"));
            }
            if (!((int)Common.ReturnCode.Succeed == returnCode))
            {
                Model = new CategoryModel();
            }
            ViewBag.Parent = new SelectList(_categoryBL.GetListParent(), "id", "name");
            return(View(Model));
        }
 public ActionResult Edit(string id)
 {
     ViewBag.Category = objBS.GetByID(id);
     return(View("Edit"));
 }
Example #5
0
        /// <summary>
        /// I check the new appointments end date here. (An appointment end date cant be later then 17 hour.)
        /// </summary>
        /// <param name="appointment"></param>
        /// <returns></returns>
        private static bool ValidateAppointmentEnd(SchedulerReservations appointment)
        {
            CategoryBL categBL = new CategoryBL();

            return(appointment.Start.AddMinutes((int)categBL.GetByID(appointment.CategoryName).ProcessLengthInMunites).Hour <= 17);
        }