public virtual JobOfferContainer JobOfferSelectAll()
 {
     TraceCallEnterEvent.Raise();
       try
       {
     JobOfferContainer result;
     DataSet entitySet = m_DataContext.ndihdJobOfferSelectAll();
     result = new JobOfferContainer(entitySet.Tables[0]);
     TraceCallReturnEvent.Raise();
     return result;
       }
       catch (Exception ex)
       {
     ExceptionManager.Publish(ex);
     TraceCallReturnEvent.Raise(false);
     throw;
       }
 }
Esempio n. 2
0
        public JobOfferContainer JobOfferSelectFiltered(JobOffer filter)
        {
            PrincipalPermission permReg = new PrincipalPermission(Thread.CurrentPrincipal.Identity.Name, "Registered");
              PrincipalPermission permAdmin = new PrincipalPermission(Thread.CurrentPrincipal.Identity.Name, "Administrator");
              permReg.Union(permAdmin).Demand();

              TraceCallEnterEvent.Raise();
              try
              {
            JobOfferContainer result = new JobOfferContainer();
            DataSet entitySet = m_DataContext.ndihdJobOfferSelectFiltered(filter.FilterOnRefId, filter.ID, filter.Sender, filter.Description, filter.Message,
              filter.Requirements,
              filter.City,
                                                                     filter.RegionRef, filter.QualificationMinRef, filter.Status,
                                                                     filter.FilterOnActivityPrevention,
                                                                     filter.FilterOnActivityResearch,
                                                                     filter.FilterOnActivityRehabilitation,
                                                                     filter.FilterOnActivityOther,
                                                                     filter.FilterOnNotificationsent, filter.Expiredate, filter.NotificationDate, filter.ExpireDatexpired);
            result = new JobOfferContainer(entitySet.Tables[0]);
            TraceCallReturnEvent.Raise();
            return result;
              }
              catch (Exception ex)
              {
            ExceptionManager.Publish(ex);
            TraceCallReturnEvent.Raise(false);
            throw;
              }
        }
        /// <summary>
        /// Shows the grid.
        /// </summary>
        /// <param name="dataGrid">The data grid.</param>
        /// <param name="index">The index.</param>
        /// <param name="sort">The sort.</param>
        /// <param name="order">The order.</param>
        protected void ShowGrid(DataGrid dataGrid,
                            int index, string sort, string order)
        {
            dataGrid.PageSize = Helpers.GetPageSize("PageSize.JobOfferList");

              // Get query result from database
              JobOffer filter = new JobOffer(Guid.Empty);
              filter.Sender = Context.User.Identity.Name;
              filter.Status = JobStatusEnum.ACT;

              JobOfferContainer jobSelectedAll = m_JobSrv.JobOfferSelectFiltered(filter);
              JobOfferContainer jobSelected = new JobOfferContainer();

              if (cmbAll.SelectedValue != "" && cmbAll.SelectedValue != "0")
              {
            foreach (JobOffer job in jobSelectedAll.All)
            {
              int answerCount = 0;
              foreach (JobAnswer answer in m_answers.All)
              {
            if (answer.JobRef == job.ID)
            {
              answerCount++;
            }
              }
              if (cmbAll.SelectedValue == "1" && answerCount == 0) // nincs jelentkező
              {
            jobSelected.Add(job);
              }
              if (cmbAll.SelectedValue == "2" && answerCount > 0) //van
              {
            jobSelected.Add(job);
              }
            }
              }
              else
              {
            jobSelected = jobSelectedAll;
              }
              if (jobSelected.AllCount > 0)
              {
            gridJob.Visible = true;
            lblNotFound.Visible = false;
              }
              else
              {
            gridJob.Visible = false;
            lblNotFound.Visible = true;
              }
              ArrayList sortableList;
              // Sort if necessary
              if (sort == null)
              {
            sortableList = jobSelected.All.Items;
              }
              else
              {
            if (String.Compare(order, "Ascending", true) == 0)
            {
              sortableList = jobSelected.All.SortBy(sort, true);
            }
            else sortableList = String.Compare(order, "Descending", true) == 0 ? jobSelected.All.SortBy(sort, false) : jobSelected.All.SortBy(sort);
              }

              // Bind list to datagrid control
              dataGrid.CurrentPageIndex = index;
              dataGrid.CurrentPageIndex = jobSelected.AllCount <= dataGrid.PageSize*dataGrid.CurrentPageIndex ? 0 : index;

              dataGrid.CurrentSortExpression = sort;
              dataGrid.CurrentSortOrder = order;
              dataGrid.DataSource = sortableList;
              dataGrid.DataBind();
        }
Esempio n. 4
0
        public JobOfferContainer JobOfferSelectBySubscriber(DBString SubscriberIDVal, DBString TypeIdRef)
        {
            PrincipalPermission permReg = new PrincipalPermission(Thread.CurrentPrincipal.Identity.Name, "Registered");
              PrincipalPermission permAdmin = new PrincipalPermission(Thread.CurrentPrincipal.Identity.Name, "Administrator");
              permReg.Union(permAdmin).Demand();

              TraceCallEnterEvent.Raise();
              try
              {
            JobOfferContainer result = new JobOfferContainer();
            DataSet entitySet = m_DataContext.ndihdJobOfferSelectBySubscriber(SubscriberIDVal, TypeIdRef);
            result = new JobOfferContainer(entitySet.Tables[0]);
            TraceCallReturnEvent.Raise();
            return result;
              }
              catch (Exception ex)
              {
            ExceptionManager.Publish(ex);
            TraceCallReturnEvent.Raise(false);
            throw;
              }
        }
Esempio n. 5
0
 public virtual JobOfferContainer SelectChildrenBySenderOfJobOffer(DBString LoginNameVal)
 {
     TraceCallEnterEvent.Raise();
       try
       {
     JobOfferContainer result;
     DataSet entitySet = m_DataContext.ndihdSenderOfJobOfferSelectBy(LoginNameVal);
     result = new JobOfferContainer(entitySet.Tables[0]);
     TraceCallReturnEvent.Raise();
     return result;
       }
       catch (Exception ex)
       {
     ExceptionManager.Publish(ex);
     TraceCallReturnEvent.Raise(false);
     throw;
       }
 }