public object SaveNotificationAll(ParamAllNotification objnote) { try { SchoolMainContext db = new ConcreateContext().GetContext(objnote.userid, objnote.password); if (db == null) { return(new Results() { IsSuccess = false, Message = "Invalid User" }); } var AcadamicYear = db.View_GETACADEMICYEAR.FirstOrDefault(); if (AcadamicYear == null) { return(new Results { IsSuccess = false, Message = "Not Found Academic Year" }); } TBLNOTIFICATION objmaster = new TBLNOTIFICATION(); TBLNOTIFICATIONDETAIL objdetail = new TBLNOTIFICATIONDETAIL(); objmaster.TITLE = objnote.Title; objmaster.NOTIFICATIONDATE = objnote.NotificationDate; objmaster.NOTIFICATIONTIME = objnote.Time; objmaster.ACADEMICYEAR = AcadamicYear.ACADEMICYEAR; objmaster.NOTIFICATIONTYPE = objnote.NotificationType; db.TBLNOTIFICATIONs.Add(objmaster); db.SaveChanges(); return(new DivisionListResult() { IsSuccess = true, Notification = "Notification Saved successfully" }); } catch (Exception E) { return(new Results { IsSuccess = false, Message = E.Message }); } }
public object SaveAllNotification([FromBody] ParamAllNotification obj) { NotificationBusiness objnote = new NotificationBusiness(); return(objnote.SaveNotificationAll(obj)); }