public ActionResult GetEmpsAvaible(string datetime, string servname)
        {
            if (!Authentication.IsValid())
            {
                return(Json(new { Error = "Not Authenticated" }));
            }
            Service         s    = ServiceDAO.GetByName(servname);
            List <Employee> emps = EmployeeDAO.GetEmployeesAvaible(datetime, s.Id);

            return(Json(new { CarouselItems = CustomHtmlHelper.CustomHtmlHelper.RenderPartialToString("Profile/_EmployeeCarousel", emps, ControllerContext) }));
        }
        public ActionResult Insert(string name, string price, string minified_desc, string desc, uint category_id, string time, System.Web.HttpPostedFileWrapper image, string clothing)
        {
            if (!Authentication.IsValid())
            {
                return(Json(new { Error = "Not Authenticated" }));
            }
            string base64Image = null;

            if (image != null)
            {
                BinaryReader br    = new BinaryReader(image.InputStream);
                byte[]       bytes = br.ReadBytes((Int32)image.InputStream.Length);
                base64Image = Convert.ToBase64String(bytes);
            }
            db.ExecuteProcedure("sp_InsertService", name, price, minified_desc, desc, category_id, time, base64Image, clothing);
            Service s = ServiceDAO.GetByName(name);

            return(Json(new { s.Id, Service = CustomHtmlHelper.CustomHtmlHelper.RenderPartialToString("Profile/TableItem/_Service", s, ControllerContext) }));
        }
 public Service GetByName(string name)
 {
     return(ServiceDAO.GetByName(name));
 }
        public ActionResult Insert(uint employee_id, string servname, string date, uint itemsaleid, string time)
        {
            if (!Authentication.IsValid())
            {
                return(Json(new { Error = "Not Authenticated" }));
            }
            string datetime = $"{Global.FormatDateString(date)} {time}";

            db.ExecuteProcedure("sp_InsertSched", Authentication.GetUser().Account.Id, employee_id, ServiceDAO.GetByName(servname).Id, itemsaleid, datetime);
            return(Json(new { Success = "Success" }));
        }