Ejemplo n.º 1
0
        public ActionResult Managers_Pendings()
        {
            LeaveBusinessLayer lb = new LeaveBusinessLayer();
            Employee           e1 = new Employee();

            return(Json(lb.ManagersPendings()));
        }
Ejemplo n.º 2
0
 public ActionResult UploadImage(string fname, HttpPostedFileBase img)
 {
     if (Request.HttpMethod == "POST")
     {
         Validation_Classes.Validation v1 = new Validation();
         if (img != null)
         {
             if (v1.IsImageFormat(fname))
             {
                 LeaveBusinessLayer lb = new LeaveBusinessLayer();
                 Employee           e1 = (LeaveApplication.Models.Employee)Session["Employee"];
                 e1.ImageBytes = lb.GetFileBytes(img);
                 ProfilePicture p1 = new ProfilePicture()
                 {
                     Image = e1.ImageBytes
                 };
                 p1.Update(int.Parse(Session["EmpId"].ToString()));
                 return(Content("Successfully Uploaded"));
             }
             else
             {
                 return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, "Invalid image format"));
             }
         }
     }
     return(View());
 }
Ejemplo n.º 3
0
        // GET: Dashboard
        public ActionResult ViewDashboard()
        {
            Employee e1 = (Employee)Session["Employee"];

            if (Session["EmpID"] != null)
            {
                LeaveBusinessLayer  lb = new LeaveBusinessLayer();
                System.Data.DataSet ds = eb.GetAbsents(e1.EmployeeID);
                ds.Tables[0].TableName       = "asd";
                ViewBag.TotalPendingRequests = lb.GetTotalPendings(e1.EmployeeID);

                if (e1.IsManager)
                {
                    ViewBag.PendingCount = lb.FacultyPendingApplications_Count(e1.EmployeeID);
                }

                return(View("ViewDashboard", ds));
            }
            else
            {
                return(RedirectToAction("Index", "LogIn"));
            }
        }