public JObject AssignSubject(Class objClass) { var jo = new JObject(); try { Admin admin = new Admin(); if (objClass != null) { var status = admin.AssignSubjects(objClass); if (status) { jo["status"] = 1; } } else { jo["status"] = 0; } } catch (Exception ex) { ExceptionHandle e = new ExceptionHandle(); e.SendExcepToDB(ex); jo["status"] = -1; } return(jo); }
public JObject CRUDClassTimetable(JObject objClassTimetable) { var jo = new JObject(); try { Class _class = null; if (objClassTimetable != null) { var classJson = objClassTimetable["objClassTimetable"].ToString(); _class = JsonConvert.DeserializeObject <Class>(classJson); } Admin admin = new Admin(); if (_class != null) { bool?status = admin.CRUDClassTimetable(_class); if (status == null) { jo["status"] = 0; } else if (status.HasValue && status.Value) { jo["status"] = 1; } else { jo["status"] = -1; } } else { jo["message"] = "Please enter Class name"; jo["status"] = 0; } } catch (Exception ex) { ExceptionHandle e = new ExceptionHandle(); e.SendExcepToDB(ex); jo["status"] = -1; } return(jo); }
public JObject CRUDSection(JObject objSection) { Section sec = null; if (objSection != null) { var secJson = objSection["objSection"].ToString(); sec = JsonConvert.DeserializeObject <Section>(secJson); } var jo = new JObject(); try { Admin admin = new Admin(); if (sec != null) { var status = admin.CRUDSection(sec); if (status) { jo["status"] = 1; } else { jo["status"] = -1; } } else { jo["message"] = "Please enter Section name"; jo["status"] = 0; } } catch (Exception ex) { ExceptionHandle e = new ExceptionHandle(); e.SendExcepToDB(ex); jo["status"] = -1; } return(jo); }
public List <Subjects> GetSubjectList() { var subjects = new List <Subjects>(); try { Admin admin = new Admin(); subjects = admin.GetSubjectList(); } catch (Exception ex) { e.SendExcepToDB(ex); } return(subjects); }
public JObject CRUDSubject(JObject objSubject) { Subjects sub = null; if (objSubject != null) { var subJson = objSubject["objSubject"].ToString(); sub = JsonConvert.DeserializeObject <Subjects>(subJson); } var jo = new JObject(); try { Admin admin = new Admin(); if (sub != null) { var status = admin.CRUDSubject(sub); if (status) { jo["status"] = 1; } else { jo["status"] = -1; } } else { jo["status"] = 0; } } catch (Exception ex) { ExceptionHandle e = new ExceptionHandle(); e.SendExcepToDB(ex); jo["status"] = -1; } return(jo); }