private void but_next_Click(object sender, EventArgs e)
        {
            if (isFormValidated())
            {
                DialogResult result = Dialog_MyMessageBox.Show(Constant.NOTIFICATION_CONFIRM_CONTINUE_CRITERIA, 2);

                if (result == DialogResult.Yes)
                {
                    MyCriteria notifyCriteria = new MyCriteria();
                    notifyCriteria.batch            = Common.loggedUser.myConfigObj.currentBatch;
                    notifyCriteria.degree           = dropdown_degree.SelectedItem.ToString();
                    notifyCriteria.arrears          = Convert.ToInt32(numeric_arrears.Value);
                    notifyCriteria.X                = Convert.ToDouble(numeric_x.Value);
                    notifyCriteria.XII              = Convert.ToDouble(numeric_xii.Value);
                    notifyCriteria.isPlaced         = isPlaced;
                    notifyCriteria.isDiplomaAllowed = isDiplomaAllowed;
                    notifyCriteria.branch           = getSelectedBranchList();

                    if (radio_cgpa.Checked)
                    {
                        notifyCriteria.cgpa = Convert.ToDouble(numeric_cgpa.Value);
                    }
                    else
                    {
                        notifyCriteria.cgpa = Convert.ToDouble(label_equiCgpa.Text);
                    }

                    form_Notification.notification.CriteriaObj = notifyCriteria;
                    form_Notification.step++;
                    form_Notification.but_resultList.Enabled = true;
                    form_Notification.but_resultList.PerformClick();
                }
            }
        }
Example #2
0
        public void Query_constructed_correctly()
        {
            SearchQueryBuilder builder = SearchQueryBuilder.Create("SELECT [[*]] FROM MyTable WHERE Active IS NULL",
                                                                   true);
            var criteria = new MyCriteria()
                           .Where(MyField.Name).IsEqualTo("Jeevan") as MyCriteria;
            SearchQuery searchQuery = builder.Build(criteria);

            Assert.Equal("SELECT * FROM MyTable WHERE Active IS NULL AND Name = @p0", searchQuery.DataQuery);
        }
 private void populateCriteriaBox(MyCriteria placementCriteria)
 {
     label_batch.Text   = placementCriteria.batch.ToString();
     label_degree.Text  = placementCriteria.degree;
     label_cgpa.Text    = placementCriteria.cgpa.ToString();
     label_branch.Text  = placementCriteria.branch.Count.ToString();
     label_arrears.Text = placementCriteria.arrears.ToString();
     label_x.Text       = placementCriteria.X.ToString() + "%";
     label_xii.Text     = placementCriteria.XII.ToString() + "%";
     label_status.Text  = (placementCriteria.isPlaced) ? Labels.PLACED_ALLOWED : Labels.NON_PLACED;
 }
Example #4
0
        public IDictionary <string, IList <Entity_Student> > filteredStudentList(MyCriteria notifyCriteria)
        {
            Utility.logFile(Constant.METHOD_ENTER + Utility.getCurrentMethodName(1) + "(NotificationManagerImpl)", null, Constant.LOGTYPE_INFO);
            DetachedCriteria mainCriteria = DetachedCriteria.For <Entity_Student>("student");

            mainCriteria.CreateAlias("scoreObj", "score");
            Conjunction conjunction = Restrictions.Conjunction();

            conjunction.Add(Restrictions.Eq("student.myConfigObj.currentBatch", notifyCriteria.batch));
            conjunction.Add(Restrictions.Eq("student.myConfigObj.currentDegree", notifyCriteria.degree));
            conjunction.Add(Restrictions.Ge("score.X", notifyCriteria.X));
            conjunction.Add(Restrictions.Ge("score.cgpa", notifyCriteria.cgpa));
            conjunction.Add(Restrictions.Le("score.arrears", notifyCriteria.arrears));
            conjunction.Add(Restrictions.In("student.branch", notifyCriteria.branch));

            if (notifyCriteria.isDiplomaAllowed)
            {
                Disjunction disjunction = Restrictions.Disjunction();
                disjunction.Add(Restrictions.Ge("score.XII", notifyCriteria.XII));
                disjunction.Add(Restrictions.Ge("score. ", notifyCriteria.XII));

                conjunction.Add(disjunction);
            }
            else
            {
                conjunction.Add(Restrictions.Ge("score.XII", notifyCriteria.XII));
            }

            mainCriteria.Add(conjunction);

            if (!notifyCriteria.isPlaced)
            {
                DetachedCriteria subCriteria = DetachedCriteria.For <Entity_PlacementDetails>("placedObj");
                subCriteria.Add(Restrictions.EqProperty("placedObj.studentId", "student.studentId"));
                subCriteria.SetProjection(Projections.Distinct(Projections.Property("placedObj.studentId")));
                mainCriteria.Add(Subqueries.NotExists(subCriteria));
            }

            IList list = persistence.findByCriteria(mainCriteria);

            if (list != null && list.Count > 0)
            {
                IDictionary <string, IList <Entity_Student> > eligibleStudentMap = prepareStudentList(list.Cast <Entity_Student>().ToList());
                return(eligibleStudentMap);
            }
            else
            {
                return(null);
            }
        }
        private void prepareDataForDB()
        {
            MyCriteria    placementCriteria = form_Notification.notification.CriteriaObj;
            PlacementInfo placementInfoObj  = form_Notification.notification.PlacementObj;

            populateCriteriaBox(placementCriteria);
            populatePlacementInfoBox(placementInfoObj);

            form_Notification.notification.criteria = Utility.convertObjectToByteArray(placementCriteria);
            notifyMsg = placementInfoObj.message;
            placementInfoObj.message = null;
            form_Notification.notification.placementInfo      = Utility.convertObjectToByteArray(placementInfoObj);
            form_Notification.notification.eligibleStudentMap = Utility.convertObjectToByteArray
                                                                    (form_Notification.notification.EligibleStudentMapObj);
        }