Example #1
0
        public ActionResult <object> Delete([FromBody] Model.DeleteID deleteID)
        {
            Init();
            if (!ModelState.IsValid)
            {
                Response.StatusCode = 400;
                return("GradeMark does not exist"
                       );
            }
            else
            {
                if (deleteID.id == null)
                {
                    Response.StatusCode = 400;
                    return("GradeMark does not exist"
                           );
                }
                StringBuilder sbError = new StringBuilder("");

                var isDeleted = _gradeMarkService.Delete(deleteID.id, ref sbError);

                if (!isDeleted)
                {
                    Response.StatusCode = 400;
                    return("GradeMark Delete failed"
                           );
                }
                else
                {
                    Response.StatusCode = 200;
                    return((string)"GradeMark Deleted Successfully");
                }
            }
        }
        public ActionResult <object> DeleteTeacherDepartment([FromBody] Model.DeleteID delClass)
        {
            try
            {
                Init();
                if (!ModelState.IsValid)
                {
                    Response.StatusCode = 400;
                    return("Teacher Department does not exist");
                }
                else
                {
                    StringBuilder sbError = new StringBuilder("");

                    var isDeleted = _teacherDepartmentService.Delete(delClass.id, ref sbError);

                    if (!isDeleted)
                    {
                        Response.StatusCode = 400;
                        return("Teacher Department Delete failed");
                    }
                    else
                    {
                        Response.StatusCode = 200;
                        return((string)"Teacher Department Deleted Successfully");
                    }
                }
            }
            catch (Exception er)
            {
                return(Error(er));
            }
        }
        public ActionResult <object> Delete([FromBody] Model.DeleteID deleteID)
        {
            try
            {
                Init();
                if (!ModelState.IsValid)
                {
                    Response.StatusCode = 400;
                    return("Absent does not exist"
                           );
                }
                else
                {
                    if (deleteID == null)
                    {
                        Response.StatusCode = 400;
                        return("Absent does not exist"
                               );
                    }
                    StringBuilder sbError = new StringBuilder("");

                    var isDeleted = _absentFromSchoolService.Delete(deleteID.id, ref sbError);

                    if (!isDeleted)
                    {
                        Response.StatusCode = 400;
                        return("Absent Delete failed"
                               );
                    }
                    else
                    {
                        Response.StatusCode = 200;
                        return((string)"Absent Deleted Successfully");
                    }
                }
            }
            catch (Exception er)
            {
                return(Error(er));
            }
        }
        public ActionResult <object> Delete([FromBody] Model.DeleteID deleteID)
        {
            try
            {
                Init();
                if (!ModelState.IsValid)
                {
                    Response.StatusCode = 400;
                    return("id does not exist");
                }
                else
                {
                    if (deleteID.id == null)
                    {
                        Response.StatusCode = 400;
                        return("id  does not exist");
                    }
                    StringBuilder sbError = new StringBuilder("");

                    var isDeleted = _teacherClassSubjectService.Delete(deleteID.id, ref sbError);

                    if (!isDeleted)
                    {
                        Response.StatusCode = 400;
                        return("id Delete failed / " + sbError.ToString());
                    }
                    else
                    {
                        Response.StatusCode = 200;
                        return((string)"id Deleted Successfully");
                    }
                }
            }
            catch (Exception er)
            {
                return(Error(er));
            }
        }
Example #5
0
        public ActionResult <object> Delete([FromBody] Model.DeleteID deleteID)
        {
            try
            {
                Init();
                if (!ModelState.IsValid)
                {
                    Response.StatusCode = 400;
                    return("review request is wrong ");
                }
                else
                {
                    if (deleteID.id == null)
                    {
                        Response.StatusCode = 400;
                        return("review does not exist");
                    }
                    StringBuilder sbError = new StringBuilder("");

                    var isDeleted = _studentTermReviewService.Delete(deleteID.id);

                    if (!isDeleted)
                    {
                        Response.StatusCode = 400;
                        return("review Delete failed");
                    }
                    else
                    {
                        Response.StatusCode = 200;
                        return((string)"review Deleted Successfully");
                    }
                }
            }
            catch (Exception er)
            {
                return(Error(er));
            }
        }