public IHttpActionResult Edit(Nullable <Int64> Id, Search_MoM objS) { if (Id == 0) { Id = null; } MomBusinessService obj = new MomBusinessService(); return(Ok(obj.EditMoM(Id, objS))); }
// GET: MoM/Details/5 public ActionResult Add(Search_MoM objS) { if (Convert.ToString(Session["UserId"]).Trim().Length > 0) { MomBusinessService obj = new MomBusinessService(); return(View(obj.GetNotificationList_Mom(objS))); } else { return(RedirectToAction("Index", "Login")); } }
public DataSet EditMeeting(Nullable <Int64> Id, Search_MoM obj) { using (SqlCommand sqlCommand = new SqlCommand()) { sqlCommand.CommandType = CommandType.StoredProcedure; sqlCommand.CommandText = Procedures.EditMeeting; sqlCommand.Parameters.AddWithValue("@MoMId", Id); sqlCommand.Parameters.AddWithValue("@CallFor", obj.callFor); sqlCommand.Parameters.AddWithValue("@SearchText", obj.SearchText); sqlCommand.Parameters.AddWithValue("@ActionId", obj.ActionId); return(DAL.GetDataSet(ConfigurationHelper.connectionString, sqlCommand)); } }
public DataSet GetNotificationListForMom(Search_MoM obj) { using (SqlCommand sqlCommand = new SqlCommand()) { sqlCommand.CommandType = CommandType.StoredProcedure; sqlCommand.CommandText = Procedures.GetNotificationListForMom; sqlCommand.Parameters.AddWithValue("@CallFor", obj.callFor); sqlCommand.Parameters.AddWithValue("@CountryId", obj.CountryId); sqlCommand.Parameters.AddWithValue("@NotificationNumber", obj.NotificationNumber); sqlCommand.Parameters.AddWithValue("@SelectedNotifications", obj.SelectedNotifications); sqlCommand.Parameters.AddWithValue("@ExistingNotifications", obj.ExistingNotifications); sqlCommand.Parameters.AddWithValue("@SearchText", obj.SearchText); return(DAL.GetDataSet(ConfigurationHelper.connectionString, sqlCommand)); } }
// POST: MoM/Edit/5 public ActionResult Edit(Nullable <Int64> Id, Search_MoM objS) { if (Convert.ToString(Session["UserId"]).Trim().Length > 0) { ViewBag.Id = Id; if (Id == 0) { Id = null; } MomBusinessService obj = new MomBusinessService(); return(View(obj.EditMoM(Id, objS))); } else { return(RedirectToAction("Index", "Login")); } }
public IHttpActionResult getNotifications(Search_MoM obj) { MomBusinessService objAM = new MomBusinessService(); return(Ok(objAM.GetNotificationList_Mom(obj))); }
public EditMeeting EditMoM(Nullable <Int64> Id, Search_MoM obj) { EditMeeting objE = new EditMeeting(); MOMDataManager objDM = new MOMDataManager(); DataSet ds = objDM.EditMeeting(Id, obj); if (ds != null && ds.Tables[0].Rows.Count > 0) { int tblIndex = -1; #region "Master Actions List" tblIndex++; if (ds.Tables.Count > tblIndex && ds.Tables[tblIndex].Rows.Count > 0) { List <BusinessObjects.MOM.Action> ActionList = new List <BusinessObjects.MOM.Action>(); foreach (DataRow dr in ds.Tables[tblIndex].Rows) { BusinessObjects.MOM.Action objAction = new BusinessObjects.MOM.Action(); objAction.ActionId = Convert.ToInt32(dr["ActionId"]); objAction.ActionName = Convert.ToString(dr["Action"]); ActionList.Add(objAction); } objE.Actions = ActionList; } #endregion #region "MoM Details" tblIndex++; if (ds.Tables.Count > tblIndex) { foreach (DataRow dr in ds.Tables[tblIndex].Rows) { objE.MoMId = Convert.ToInt64(dr["MomId"]); objE.MeetingDate = Convert.ToString(dr["MeetingDate"]); objE.IsActive = Convert.ToBoolean(dr["IsActive"]); } } #endregion #region "Notifications List" tblIndex++; if (ds.Tables.Count > tblIndex) { List <Notification_Mom> NotificationList = new List <Notification_Mom>(); int i = 1; foreach (DataRow dr in ds.Tables[tblIndex].Rows) { Notification_Mom objNotification = new Notification_Mom(); objNotification.ItemNumber = i; objNotification.NotificationId = Convert.ToInt64(dr["NotificationId"]); objNotification.Title = Convert.ToString(dr["Title"]); objNotification.NotificationNumber = Convert.ToString(dr["NotificationNumber"]); objNotification.Country = Convert.ToString(dr["Country"]); objNotification.MeetingNote = Convert.ToString(dr["MeetingNote"]); objNotification.IsUpdate = Convert.ToBoolean(dr["IsUpdate"]); objNotification.Description = Convert.ToString(dr["Description"]); objNotification.RowNum = Convert.ToInt64(dr["ROWNum"]); objNotification.TotalRow = Convert.ToInt64(dr["TotalRow"]); objNotification.NotificationGroup = Convert.ToString(dr["NotificationGroup"]); i++; NotificationList.Add(objNotification); } objE.Notifications = NotificationList; } #endregion #region "Notification Actions List" tblIndex++; if (ds.Tables.Count > tblIndex && ds.Tables[tblIndex].Rows.Count > 0) { List <NotificationAction> NotificationActionList = new List <NotificationAction>(); foreach (DataRow dr in ds.Tables[tblIndex].Rows) { NotificationAction objAction = new NotificationAction(); objAction.NotificationId = Convert.ToInt64(dr["NotificationId"]); objAction.ActionId = Convert.ToInt32(dr["ActionId"]); objAction.MailId = Convert.ToInt64(dr["MailId"]); NotificationActionList.Add(objAction); } objE.NotificationActions = NotificationActionList; } #endregion } return(objE); }
public NotificationMOM GetNotificationList_Mom(Search_MoM obj) { NotificationMOM NotificationMoMList = new NotificationMOM(); MOMDataManager objDM = new MOMDataManager(); DataSet ds = objDM.GetNotificationListForMom(obj); if (ds != null) { int tblIndex = -1; #region "Notifications List" tblIndex++; if (ds.Tables.Count > tblIndex && ds.Tables[tblIndex] != null && ds.Tables[tblIndex].Rows.Count > 0) { List <Notification_Mom> NotificationList = new List <Notification_Mom>(); int i = 1; foreach (DataRow dr in ds.Tables[tblIndex].Rows) { Notification_Mom objNotification = new Notification_Mom(); objNotification.ItemNumber = i; objNotification.NotificationId = Convert.ToInt64(dr["NotificationId"]); objNotification.Title = Convert.ToString(dr["Title"]); objNotification.NotificationNumber = Convert.ToString(dr["NotificationNumber"]); objNotification.Country = Convert.ToString(dr["Country"]); objNotification.SendResponseBy = Convert.ToString(dr["SendResponseBy"]); objNotification.FinalDateofComments = Convert.ToString(dr["FinalDateOfComment"]); objNotification.Description = Convert.ToString(dr["Description"]); objNotification.MeetingNote = Convert.ToString(dr["MeetingNote"]); objNotification.NotificationGroup = Convert.ToString(dr["NotificationGroup"]); i++; NotificationList.Add(objNotification); } NotificationMoMList.Notification_MomList = NotificationList; } #endregion #region "Country List" tblIndex++; if (ds.Tables.Count > tblIndex && ds.Tables[tblIndex] != null && ds.Tables[tblIndex].Rows.Count > 0) { int i = 1; List <GetCountry> CountryList = new List <GetCountry>(); foreach (DataRow dr in ds.Tables[tblIndex].Rows) { GetCountry objCountry = new GetCountry(); objCountry.CountryId = Convert.ToInt32(dr["CountryId"]); objCountry.Country = Convert.ToString(dr["Country"]); i++; CountryList.Add(objCountry); } NotificationMoMList.CountryList = CountryList; } #endregion #region "Notification Process Dots Color & Tooltip Text" tblIndex++; if (ds.Tables.Count > tblIndex && ds.Tables[tblIndex] != null && ds.Tables[tblIndex].Rows.Count > 0) { List <BusinessObjects.Notification.NotificationProcessDot> NPSList = new List <BusinessObjects.Notification.NotificationProcessDot>(); foreach (DataRow dr in ds.Tables[tblIndex].Rows) { BusinessObjects.Notification.NotificationProcessDot objNPS = new BusinessObjects.Notification.NotificationProcessDot(); objNPS.NotificationId = Convert.ToInt64(dr["NotificationId"]); objNPS.ColorCode = Convert.ToString(dr["ColorCode"]); objNPS.TooltipText = Convert.ToString(dr["TooltipText"]); objNPS.Sequence = Convert.ToInt32(dr["Sequence"]); NPSList.Add(objNPS); } NotificationMoMList.NotificationProcessDots = NPSList; } #endregion } return(NotificationMoMList); }