public object DeleteNotificationType(NotificationTypeUpdateParam PM) { try { Tbl_NotificationType obj = db.Tbl_NotificationType.Where(r => r.NotificationTypeID == PM.NotificationTypeID).FirstOrDefault(); if (obj.Status == 1) { obj.Status = 0; } else { obj.Status = 1; } db.SaveChanges(); return(new Result() { IsSucess = true, ResultData = "Notification Deactivated Successfully." }); } catch (Exception e) { return(new Error() { IsError = true, Message = e.Message }); } }
public object NotificationTypeUpdate(NotificationTypeUpdateParam b) { if (b.Notification == null) { return(new Error() { IsError = true, Message = "Required Notification" }); } var data = db.Tbl_NotificationType.Where(r => r.NotificationTypeID == b.NotificationTypeID).FirstOrDefault(); try { Tbl_NotificationType obj = new Tbl_NotificationType(); data.Notification = b.Notification; data.ModifiedBy = null; data.ModifiedDate = System.DateTime.Today.Date; db.SaveChanges(); return(new Result() { IsSucess = true, ResultData = "Update Notification" }); } catch (Exception e) { return(new Error() { IsError = true, Message = e.Message }); } }
public object DeleteNotificationType([FromBody] NotificationTypeUpdateParam PM) { try { NotificationBusiness b = new NotificationBusiness(); var Result = b.DeleteNotificationType(PM); return(Result); } catch (Exception e) { return(new Error() { IsError = true, Message = e.Message }); } }
public object UpdateNotificationType(NotificationTypeUpdateParam b) { try { NotificationBusiness type = new NotificationBusiness(); var Result = type.NotificationTypeUpdate(b); return(Result); } catch (Exception e) { return(new Error() { IsError = true, Message = e.Message }); } }
public object GetSingleNotificationType(NotificationTypeUpdateParam b) { try { var Event = db.ViewNotificationTypeLists.Where(r => r.NotificationTypeID == b.NotificationTypeID).FirstOrDefault(); return(new Result() { IsSucess = true, ResultData = Event }); } catch (Exception e) { return(new Error() { IsError = true, Message = e.Message }); } }