public DataTable ExportNotificationList(Search_Notification obj)
        {
            NotificationList            objR  = new NotificationList();
            NotificationListDataManager objDM = new NotificationListDataManager();
            DataSet   ds = objDM.ExportNotificationList(obj);
            DataTable dt = new DataTable();

            if (ds != null && ds.Tables.Count > 0)
            {
                int tblIndx = -1;
                #region "Notification List"
                tblIndx++;
                if (ds.Tables.Count > tblIndx && ds.Tables[tblIndx] != null && ds.Tables[tblIndx].Rows.Count > 0)
                {
                    dt = ds.Tables[tblIndx];
                    //dt.Columns.Remove("ItemNumber");
                    //dt.Columns.Remove("NotificationId");
                    //dt.Columns.Remove("Actions");
                    //dt.Columns.Remove("StatusFlag");
                    //dt.Columns.Remove("StatusName");
                }
                #endregion
            }
            return(dt);
        }
        public ActionResult NotificationExport(string NotificationNumber, int CountryId, DateTime?FinalDateOfComments_From, DateTime?FinalDateOfComments_To, int NotificationType, int StatusId, int ActionId, string ActionStatus, DateTime?MeetingDate, string PendingFrom)
        {
            Search_Notification obj = new Search_Notification();

            obj.NotificationNumber       = NotificationNumber;
            obj.CountryId                = CountryId;
            obj.FinalDateOfComments_From = FinalDateOfComments_From;
            obj.FinalDateOfComments_To   = FinalDateOfComments_To;
            obj.NotificationType         = NotificationType;
            obj.StatusId     = StatusId;
            obj.ActionId     = ActionId;
            obj.ActionStatus = ActionStatus;
            obj.MeetingDate  = MeetingDate;
            obj.PendingFrom  = PendingFrom;
            NotificationListBusinessService objBS = new NotificationListBusinessService();

            using (DataTable dt = objBS.ExportNotificationList(obj))
            {
                try
                {
                    ExportToExcel(dt, "Notification-List", "Notification-List", "Notification-List");
                }
                catch (Exception ex)
                {
                    string str = ex.Message;
                }
            }
            return(View());
        }
 // GET: NotificationList
 public ActionResult Index(Search_Notification obj)
 {
     if (Convert.ToString(Session["UserId"]).Trim().Length > 0)
     {
         NotificationListBusinessService objBS = new NotificationListBusinessService();
         return(View("~/Views/WTO/NotificationList.cshtml", objBS.PageLoad_NotificationsList(obj)));
     }
     else
     {
         return(RedirectToAction("Index", "Login"));
     }
 }
Exemplo n.º 4
0
        public IHttpActionResult GetNotificationsList(Search_Notification obj)
        {
            if (obj.PageIndex == 0)
            {
                obj.PageIndex = 1;
            }
            if (obj.PageSize == 0)
            {
                obj.PageSize = 10;
            }
            NotificationListBusinessService objBS = new NotificationListBusinessService();

            return(Ok(objBS.GetNotifications(obj)));
        }
Exemplo n.º 5
0
 public DataSet ExportNotificationList(Search_Notification obj)
 {
     using (SqlCommand sqlCommand = new SqlCommand())
     {
         sqlCommand.CommandType = CommandType.StoredProcedure;
         sqlCommand.CommandText = Procedures.ExportNotificationList;
         // sqlCommand.Parameters.AddWithValue("@PageIndex", obj.PageIndex);
         // sqlCommand.Parameters.AddWithValue("@PageSize", obj.PageSize);
         sqlCommand.Parameters.AddWithValue("@NotificationNumber", obj.NotificationNumber);
         sqlCommand.Parameters.AddWithValue("@CountryId", obj.CountryId);
         sqlCommand.Parameters.AddWithValue("@FinalDateOfComment_From", obj.FinalDateOfComments_From);
         sqlCommand.Parameters.AddWithValue("@FinalDateOfComment_To", obj.FinalDateOfComments_To);
         sqlCommand.Parameters.AddWithValue("@NotificationType", obj.NotificationType);
         sqlCommand.Parameters.AddWithValue("@Status", obj.StatusId);
         sqlCommand.Parameters.AddWithValue("@Action", obj.ActionId);
         sqlCommand.Parameters.AddWithValue("@ActionStatus", obj.ActionStatus);
         sqlCommand.Parameters.AddWithValue("@MeetingDate", obj.MeetingDate);
         sqlCommand.Parameters.AddWithValue("@PendingStatusFrom", obj.PendingFrom);
         return(DAL.GetDataSet(ConfigurationHelper.connectionString, sqlCommand));
     }
 }
        public Notifications GetNotifications(Search_Notification obj)
        {
            Notifications objR = new Notifications();
            NotificationListDataManager objDM = new NotificationListDataManager();
            DataSet ds = objDM.Notifications(obj);

            if (ds != null && ds.Tables.Count > 0)
            {
                int tblIndx = -1;
                tblIndx++;
                if (ds.Tables.Count > tblIndx && ds.Tables[tblIndx] != null && ds.Tables[tblIndx].Rows.Count > 0)
                {
                    List <BusinessObjects.Notification.Notification> ItemsList = new List <BusinessObjects.Notification.Notification>();
                    foreach (DataRow dr in ds.Tables[tblIndx].Rows)
                    {
                        BusinessObjects.Notification.Notification objItems = new BusinessObjects.Notification.Notification();
                        objItems.NotificationId      = Convert.ToInt64(dr["NotificationId"]);
                        objItems.ItemNumber          = Convert.ToInt64(dr["ItemNumber"]);
                        objItems.NotificationNumber  = Convert.ToString(dr["NotificationNumber"]);
                        objItems.NotificationDate    = Convert.ToString(dr["DateOfNotification"]);
                        objItems.FinalDateOfComments = Convert.ToString(dr["FinalDateOfComment"]);
                        objItems.Country             = Convert.ToString(dr["Country"]);
                        objItems.Title         = Convert.ToString(dr["Title"]);
                        objItems.MailCount     = Convert.ToInt32(dr["MailCount"]);
                        objItems.ResponseCount = Convert.ToInt32(dr["ResponseCount"]);
                        objItems.Actions       = Convert.ToString(dr["Actions"]);
                        objItems.MeetingDate   = Convert.ToString(dr["MeetingDate"]);
                        objItems.IsInMeeting   = Convert.ToBoolean(dr["IsInMeeting"]);
                        ItemsList.Add(objItems);
                    }
                    objR.ItemsList = ItemsList;
                }

                #region "Paging"
                tblIndx++;
                if (ds.Tables.Count > tblIndx && ds.Tables[tblIndx] != null && ds.Tables[tblIndx].Rows.Count > 0)
                {
                    objR.TotalCount = Convert.ToString(ds.Tables[tblIndx].Rows[0]["TotalCount"]);
                    objR.Pager      = new Pager(Convert.ToInt32(objR.TotalCount), Convert.ToInt16(obj.PageIndex));
                }
                #endregion

                #region "Notification Process Dots Color & Tooltip Text"
                tblIndx++;
                if (ds.Tables.Count > tblIndx && ds.Tables[tblIndx] != null && ds.Tables[tblIndx].Rows.Count > 0)
                {
                    List <NotificationProcessDot> NPSList = new List <NotificationProcessDot>();
                    foreach (DataRow dr in ds.Tables[tblIndx].Rows)
                    {
                        NotificationProcessDot objNPS = new 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);
                    }
                    objR.NotificationProcessDots = NPSList;
                }
                #endregion

                #region "Notification Action Dots Color & Tooltip Text"
                tblIndx++;
                if (ds.Tables.Count > tblIndx && ds.Tables[tblIndx] != null && ds.Tables[tblIndx].Rows.Count > 0)
                {
                    List <NotificationActionDot> NASList = new List <NotificationActionDot>();
                    foreach (DataRow dr in ds.Tables[tblIndx].Rows)
                    {
                        NotificationActionDot objNAS = new NotificationActionDot();
                        objNAS.NotificationId = Convert.ToInt64(dr["NotificationId"]);
                        objNAS.ColorCode      = Convert.ToString(dr["ColorCode"]);
                        objNAS.TooltipText    = Convert.ToString(dr["TooltipText"]);
                        objNAS.Sequence       = Convert.ToInt32(dr["Sequence"]);
                        NASList.Add(objNAS);
                    }
                    objR.NotificationActionDots = NASList;
                }
                #endregion
            }
            return(objR);
        }
        public NotificationList PageLoad_NotificationsList(Search_Notification obj)
        {
            NotificationList            objR  = new NotificationList();
            NotificationListDataManager objDM = new NotificationListDataManager();
            DataSet ds = objDM.GetPageLoad_NotificationsList(obj);

            if (ds != null && ds.Tables.Count > 0)
            {
                int tblIndx = -1;

                #region "Country List"
                tblIndx++;
                if (ds.Tables.Count > tblIndx && ds.Tables[tblIndx] != null && ds.Tables[tblIndx].Rows.Count > 0)
                {
                    List <Country> CountryList = new List <Country>();
                    foreach (DataRow dr in ds.Tables[tblIndx].Rows)
                    {
                        Country objCountry = new Country();
                        objCountry.CountryId   = Convert.ToInt64(dr["CountryId"]);
                        objCountry.CountryCode = Convert.ToString(dr["CountryCode"]);
                        objCountry.Name        = Convert.ToString(dr["Country"]);
                        CountryList.Add(objCountry);
                    }
                    objR.CountryList = CountryList;
                }
                #endregion

                #region "Status List"
                tblIndx++;
                if (ds.Tables.Count > tblIndx && ds.Tables[tblIndx] != null && ds.Tables[tblIndx].Rows.Count > 0)
                {
                    List <StatusMaster> StatusList = new List <StatusMaster>();
                    foreach (DataRow dr in ds.Tables[tblIndx].Rows)
                    {
                        StatusMaster objStatus = new StatusMaster();
                        objStatus.StatusId = Convert.ToInt32(dr["StatusId"]);
                        objStatus.Status   = Convert.ToString(dr["Status"]);
                        StatusList.Add(objStatus);
                    }
                    objR.StatusList = StatusList;
                }
                #endregion

                #region "Action List"
                tblIndx++;
                if (ds.Tables.Count > tblIndx && ds.Tables[tblIndx] != null && ds.Tables[tblIndx].Rows.Count > 0)
                {
                    List <ActionMaster> ActionList = new List <ActionMaster>();
                    foreach (DataRow dr in ds.Tables[tblIndx].Rows)
                    {
                        ActionMaster objAction = new ActionMaster();
                        objAction.ActionId = Convert.ToInt32(dr["ActionId"]);
                        objAction.Action   = Convert.ToString(dr["Action"]);
                        ActionList.Add(objAction);
                    }
                    objR.ActionList = ActionList;
                }
                #endregion

                #region "Action Status List"
                tblIndx++;
                if (ds.Tables.Count > tblIndx && ds.Tables[tblIndx] != null && ds.Tables[tblIndx].Rows.Count > 0)
                {
                    List <Status> StatusList = new List <Status>();
                    foreach (DataRow dr in ds.Tables[tblIndx].Rows)
                    {
                        Status objStatus = new Status();
                        objStatus.StatusId   = Convert.ToInt32(dr["StatusId"]);
                        objStatus.StatusName = Convert.ToString(dr["Status"]);
                        StatusList.Add(objStatus);
                    }

                    objR.ActionStatusList = StatusList;
                }
                #endregion

                #region "Notification List"
                tblIndx++;
                if (ds.Tables.Count > tblIndx && ds.Tables[tblIndx] != null && ds.Tables[tblIndx].Rows.Count > 0)
                {
                    List <BusinessObjects.Notification.Notification> ItemsList = new List <BusinessObjects.Notification.Notification>();
                    foreach (DataRow dr in ds.Tables[tblIndx].Rows)
                    {
                        BusinessObjects.Notification.Notification objItems = new BusinessObjects.Notification.Notification();
                        objItems.NotificationId      = Convert.ToInt64(dr["NotificationId"]);
                        objItems.ItemNumber          = Convert.ToInt64(dr["ItemNumber"]);
                        objItems.NotificationNumber  = Convert.ToString(dr["NotificationNumber"]);
                        objItems.NotificationDate    = Convert.ToString(dr["DateOfNotification"]);
                        objItems.FinalDateOfComments = Convert.ToString(dr["FinalDateOfComment"]);
                        objItems.Country             = Convert.ToString(dr["Country"]);
                        objItems.Title         = Convert.ToString(dr["Title"]);
                        objItems.MailCount     = Convert.ToInt32(dr["MailCount"]);
                        objItems.ResponseCount = Convert.ToInt32(dr["ResponseCount"]);
                        objItems.Actions       = Convert.ToString(dr["Actions"]);
                        objItems.MeetingDate   = Convert.ToString(dr["MeetingDate"]);
                        objItems.IsInMeeting   = Convert.ToBoolean(dr["IsInMeeting"]);
                        ItemsList.Add(objItems);
                    }
                    objR.Notifications = ItemsList;
                }
                #endregion

                #region "Notification Count"
                tblIndx++;
                if (ds.Tables.Count > tblIndx && ds.Tables[tblIndx] != null && ds.Tables[tblIndx].Rows.Count > 0)
                {
                    objR.TotalCount = Convert.ToInt64(ds.Tables[tblIndx].Rows[0]["TotalCount"]);
                }
                #endregion

                #region "Notification Process Dots Color & Tooltip Text"
                tblIndx++;
                if (ds.Tables.Count > tblIndx && ds.Tables[tblIndx] != null && ds.Tables[tblIndx].Rows.Count > 0)
                {
                    List <NotificationProcessDot> NPSList = new List <NotificationProcessDot>();
                    foreach (DataRow dr in ds.Tables[tblIndx].Rows)
                    {
                        NotificationProcessDot objNPS = new 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);
                    }
                    objR.NotificationProcessDots = NPSList;
                }
                #endregion

                #region "Notification Action Dots Color & Tooltip Text"
                tblIndx++;
                if (ds.Tables.Count > tblIndx && ds.Tables[tblIndx] != null && ds.Tables[tblIndx].Rows.Count > 0)
                {
                    List <NotificationActionDot> NASList = new List <NotificationActionDot>();
                    foreach (DataRow dr in ds.Tables[tblIndx].Rows)
                    {
                        NotificationActionDot objNAS = new NotificationActionDot();
                        objNAS.NotificationId = Convert.ToInt64(dr["NotificationId"]);
                        objNAS.ColorCode      = Convert.ToString(dr["ColorCode"]);
                        objNAS.TooltipText    = Convert.ToString(dr["TooltipText"]);
                        objNAS.Sequence       = Convert.ToInt32(dr["Sequence"]);
                        NASList.Add(objNAS);
                    }
                    objR.NotificationActionDots = NASList;
                }
                #endregion
            }

            return(objR);
        }