Beispiel #1
0
        public JsonResult DeleteAttendance(int ID)
        {
            AttendanceController obj = new AttendanceController();
            var response             = obj.Delete(ID);

            return(Json(response, JsonRequestBehavior.AllowGet));;
        }
Beispiel #2
0
        public JsonResult UpdateAttendance(int ID, StAttendance Attendance)
        {
            AttendanceController obj = new AttendanceController();
            var response             = obj.Put(ID, Attendance);

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Beispiel #3
0
        public JsonResult GetMonthlyAttendance(string Class)
        {
            AttendanceController obj = new AttendanceController();
            var requestModel         = obj.GetMonthlyAttendance(Class);
            var jsonResult           = Json(requestModel, JsonRequestBehavior.AllowGet);

            jsonResult.MaxJsonLength = int.MaxValue;
            return(jsonResult);
        }
Beispiel #4
0
        public JsonResult GetAttendance()
        {
            AttendanceController obj           = new AttendanceController();
            List <StAttendance>  objAttendance = obj.GetAttendanceCharge();
            var jsonResult = Json(objAttendance, JsonRequestBehavior.AllowGet);

            jsonResult.MaxJsonLength = int.MaxValue;
            return(jsonResult);
        }
Beispiel #5
0
        public ActionResult AddAttendance(List <StAttendance> Attendance)
        {
            AttendanceController obj = new AttendanceController();

            if (obj.IsAttendanceMarked(Attendance))
            {
                return(Content("Attendance Already Marked"));
            }
            else
            {
                var response = obj.Post(Attendance);

                foreach (var item in Attendance)
                {
                    if (item.Attendance == "Absent" || item.Attendance == "Leave")
                    {
                        string text = "Your ward " + item.StName + " is " + (item.Attendance == "Absent" ? "Absent" : "on Leave") + " today i.e. " + DateTime.Now.ToString("MM/dd/yyyy");
                        SMS.SendSMSApi(text, item.StNumber);
                    }
                }

                return(Json(((List <SchoolApi.StAttendance>)(((System.Net.Http.ObjectContent)(response.Content)).Value)), JsonRequestBehavior.AllowGet));
            }
        }