Esempio n. 1
0
        private CriteriaOperatorCollection GetOperatorCollection(string fields, DataTable dataTable)
        {
            var operatorCollection = new CriteriaOperatorCollection();

            foreach (string property in fields.Split(';'))
            {
                if (property != "" && property.IndexOf("!") == -1 && property != "This")
                {
                    XPMemberInfo xpMemberInfo = ReflectorHelper.GetXpMemberInfo(Session, ObjectType, property);
                    if (xpMemberInfo.IsPersistent)
                    {
                        operatorCollection.Add(CriteriaOperator.Parse(property, new object[0]));
                        var dataColumn = new DataColumn(property)
                        {
                            DataType = xpMemberInfo.MemberType
                        };
                        if (typeof(XPBaseObject).IsAssignableFrom(dataColumn.DataType))
                        {
                            dataColumn.DataType = Session.GetClassInfo(dataColumn.DataType).KeyProperty.MemberType;
                        }
                        dataTable.Columns.Add(dataColumn);
                        if (property == ObjectClassInfo.KeyProperty.Name)
                        {
                            dataTable.PrimaryKey = new[] { dataColumn }
                        }
                        ;
                    }
                }
            }
            return(operatorCollection);
        }
Esempio n. 2
0
        public DataTable GetDataTable(CriteriaOperator criteriaOperator, string fields)
        {
            var dataTable = new DataTable();
            CriteriaOperatorCollection operatorCollection = GetOperatorCollection(fields, dataTable);


            List <object[]> selectData = Session.SelectData(ObjectClassInfo, operatorCollection,
                                                            criteriaOperator,
                                                            false, TopReturnedObjects, Sorting);


            foreach (var objects in selectData)
            {
                int     i      = 0;
                DataRow newRow = dataTable.NewRow();
                foreach (DataColumn dataColumn in dataTable.Columns)
                {
                    newRow[dataColumn] = objects[i] ?? DBNull.Value;
                    i++;
                }
                dataTable.Rows.Add(newRow);
            }

            return(dataTable);
        }
Esempio n. 3
0
        public void FillProductionView()
        {
            CriteriaOperatorCollection productionViewCriteria = new CriteriaOperatorCollection();

            if (((DateTime?)fromFilterDateEdit.EditValue).HasValue)
            {
                productionViewCriteria.Add(new BinaryOperator(Production.Fields.ProdMainDate.PropertyName, Convert.ToDateTime(fromFilterDateEdit.EditValue), BinaryOperatorType.GreaterOrEqual));
            }
            if (((DateTime?)toFilterDateEdit.EditValue).HasValue)
            {
                productionViewCriteria.Add(new BinaryOperator(Production.Fields.ProdMainDate.PropertyName, Convert.ToDateTime(toFilterDateEdit.EditValue), BinaryOperatorType.LessOrEqual));
            }
            if (((int?)customerFilterLookUpEdit.EditValue).HasValue)
            {
                productionViewCriteria.Add(new BinaryOperator(Production.Fields.ProdMainItemID.ItemCustomerID.CustomerID.PropertyName, Convert.ToInt32(customerFilterLookUpEdit.EditValue), BinaryOperatorType.Equal));
            }
            if (((int?)shiftFilterLookUpEdit.EditValue).HasValue)
            {
                productionViewCriteria.Add(new BinaryOperator(Production.Fields.ProdMainShift.ShiftID.PropertyName, Convert.ToInt32(shiftFilterLookUpEdit.EditValue), BinaryOperatorType.Equal));
            }
            if (((int?)machineFilterLookUpEdit.EditValue).HasValue)
            {
                productionViewCriteria.Add(new BinaryOperator(Production.Fields.ProdMainMachineLine.MachineLineID.PropertyName, Convert.ToInt32(machineFilterLookUpEdit.EditValue), BinaryOperatorType.Equal));
            }
            if (((int?)itemFilterLookUpEdit.EditValue).HasValue)
            {
                productionViewCriteria.Add(new BinaryOperator(Production.Fields.ProdMainItemID.ItemID.PropertyName, Convert.ToInt32(itemFilterLookUpEdit.EditValue), BinaryOperatorType.Equal));
            }

            productionXPView.Criteria = CriteriaOperator.And(productionViewCriteria);
        }
Esempio n. 4
0
        public static int GetNewPalletNumber(Session session, DateTime inventoryDate, int itemID, int?shift)
        {
            int?value = null;

            CriteriaOperatorCollection filter = new CriteriaOperatorCollection();

            filter.Add(new BinaryOperator("InventoryDate", inventoryDate.Date, BinaryOperatorType.GreaterOrEqual));
            filter.Add(new BinaryOperator("InventoryDate", inventoryDate.Date.AddDays(1), BinaryOperatorType.Less));
            filter.Add(new BinaryOperator("InventoryItemID", itemID, BinaryOperatorType.Equal));
            if (shift.HasValue)
            {
                filter.Add(new BinaryOperator("Shift", (object)shift, BinaryOperatorType.Equal));
            }
            else
            {
                return(1);
            }


            value = (int?)session.Evaluate <Inventory>(new AggregateOperand("", "Pallet", Aggregate.Max), new GroupOperator(GroupOperatorType.And, filter));

            if (value.HasValue)
            {
                return(value.Value + 1);
            }
            else
            {
                return(1);
            }
        }
Esempio n. 5
0
 public static void Esit(this CriteriaOperatorCollection list, string alan, TextBox textBox)
 {
     if (!string.IsNullOrWhiteSpace(textBox.Text))
     {
         list.Add(new BinaryOperator(alan, textBox.Text));
     }
 }
Esempio n. 6
0
        public void FillAdjustmentView()
        {
            CriteriaOperatorCollection inventoryViewCriteria = new CriteriaOperatorCollection();

            if (((DateTime?)fromFilterDateEdit.EditValue).HasValue)
            {
                inventoryViewCriteria.Add(new BinaryOperator(InventoryAdjustment.Fields.AdjustmentDate.PropertyName, Convert.ToDateTime(fromFilterDateEdit.EditValue), BinaryOperatorType.GreaterOrEqual));
            }
            if (((DateTime?)toFilterDateEdit.EditValue).HasValue)
            {
                inventoryViewCriteria.Add(new BinaryOperator(InventoryAdjustment.Fields.AdjustmentDate.PropertyName, Convert.ToDateTime(toFilterDateEdit.EditValue), BinaryOperatorType.LessOrEqual));
            }
            if (((int?)customerFilterLookUpEdit.EditValue).HasValue)
            {
                inventoryViewCriteria.Add(new BinaryOperator(InventoryAdjustment.Fields.AdjustmentItem.ItemCustomerID.CustomerID.PropertyName, Convert.ToInt32(customerFilterLookUpEdit.EditValue), BinaryOperatorType.Equal));
            }
            if (((int?)itemFilterLookUpEdit.EditValue).HasValue)
            {
                inventoryViewCriteria.Add(new BinaryOperator(InventoryAdjustment.Fields.AdjustmentItem.ItemID.PropertyName, Convert.ToInt32(itemFilterLookUpEdit.EditValue), BinaryOperatorType.Equal));
            }

            inventoryXPView.Criteria = CriteriaOperator.And(inventoryViewCriteria);


            //Me.adjustmentGridControl.DataSource = m_Adjustment.GetAdjustmentView(CType(Me.fromFilterDateEdit.EditValue, Date?), CType(Me.toFilterDateEdit.EditValue, Date?), _
            //                                                                     CType(Me.customerFilterLookUpEdit.EditValue, Integer?), CType(Me.itemFilterLookUpEdit.EditValue, Integer?))
        }
Esempio n. 7
0
        public static int?GetLPNQuantity(Session session, int LPNNumber, int customerID, DateTime inventoryDate, Inventory currentRecord)
        {
            CriteriaOperatorCollection filter = new CriteriaOperatorCollection();

            filter.Add(new BinaryOperator("InventoryDate", inventoryDate, BinaryOperatorType.Equal));
            filter.Add(new BinaryOperator(Inventory.Fields.InventoryItemID.ItemCustomerID.CustomerID.PropertyName, customerID, BinaryOperatorType.Equal));
            filter.Add(new BinaryOperator("LPNNumber", LPNNumber, BinaryOperatorType.Equal));
            filter.Add(new BinaryOperator(Inventory.Fields.InventoryID.PropertyName, currentRecord.InventoryID, BinaryOperatorType.NotEqual));

            int?LPNQuantity = (int?)session.Evaluate <Inventory>(new AggregateOperand("", "InventoryQuantity", Aggregate.Sum), new GroupOperator(GroupOperatorType.And, filter));

            if (LPNQuantity.HasValue)
            {
                LPNQuantity += currentRecord.InventoryQuantity;
            }
            else
            {
                LPNQuantity = currentRecord.InventoryQuantity;
            }


            if (LPNQuantity.HasValue)
            {
                return(LPNQuantity.Value);
            }
            else
            {
                return(0);
            }
        }
        private void AddReceivingsToSumary(DateTime?fromDate, DateTime?toDate, int currentItem)
        {
            double total = 0;
            CriteriaOperatorCollection theCriteria = new CriteriaOperatorCollection();

            if (fromDate.HasValue)
            {
                theCriteria.Add(new BinaryOperator("ReceivMainID.ReceivDate", fromDate.Value, BinaryOperatorType.GreaterOrEqual));
            }
            if (toDate.HasValue)
            {
                theCriteria.Add(new BinaryOperator("ReceivMainID.ReceivDate", toDate.Value, BinaryOperatorType.LessOrEqual));
            }

            theCriteria.Add(new BinaryOperator("ReceivDetItemID", currentItem, BinaryOperatorType.Equal));
            total = Convert.ToDouble(Session.DefaultSession.Evaluate(typeof(ReceivingDetail), CriteriaOperator.Parse("Sum(intUnits)"), CriteriaOperator.And(theCriteria)));

            theCriteria.Clear();

            if (fromDate.HasValue)
            {
                theCriteria.Add(new BinaryOperator("ReceiveMainID.ReceivDate", fromDate.Value, BinaryOperatorType.GreaterOrEqual));
            }
            if (toDate.HasValue)
            {
                theCriteria.Add(new BinaryOperator("ReceiveMainID.ReceivDate", toDate.Value, BinaryOperatorType.LessOrEqual));
            }
            theCriteria.Add(new BinaryOperator("ReturnDetItemID", currentItem, BinaryOperatorType.Equal));
            total += Convert.ToDouble(Session.DefaultSession.Evaluate(typeof(ReceivedReturns), CriteriaOperator.Parse("Sum(ReturnDetQty)"), CriteriaOperator.And(theCriteria)));

            transactionSummary.Received = total;
        }
        private void Btn_Bul_Click(object sender, EventArgs e)
        {
            CriteriaOperatorCollection filtreler = new CriteriaOperatorCollection();

            if (combo_Kategori.SelectedIndex == 0)
            {
                filtreler.Esit("TCNO", txt_Ara);
            }
            else if (combo_Kategori.SelectedIndex == 1)
            {
                filtreler.Esit("Ad", txt_Ara);
            }
            else if (combo_Kategori.SelectedIndex == 2)
            {
                filtreler.Esit("Soyad", txt_Ara);
            }
            else if (combo_Kategori.SelectedIndex == 3)
            {
                //string Tarih = Convert.ToString(dtp_Tarih.Value.Date);
                filtreler.TarihAra("Tarih", dtp_Tarih);
            }
            else if (combo_Kategori.SelectedIndex == 4)
            {
                filtreler.BuyukOlanlarByte("Yas", txt_Ara);
            }
            else
            {
                //MessageBox.Show("Yapım Aşamasında...");
            }
            dgv_Kayit_Listele.DataSource = klinikler = new XPCollection <Klinik>(CriteriaOperator.And(filtreler));
        }
Esempio n. 10
0
        private string CreateWhereClauseGroupOperator(GroupOperator filter, CriteriaOperatorCollection operands, GroupOperatorType operatorType)
        {
            var whereClause = string.Empty;

            // var operands = ((GroupOperator)eventLogGrid.FilterCriteria).Operands;

            // var operatorType = ((GroupOperator)eventLogGrid.FilterCriteria).OperatorType.ToString();


            for (int i = 0; i < operands.Count; i++)
            {
                if (operands[i].GetType() == typeof(GroupOperator))
                {
                    whereClause += CreateWhereClauseGroupOperator((GroupOperator)operands[i], operands, operatorType);
                }
                else
                {
                    whereClause += CreateWhereClauseCriteriaOperator(operands[i]);
                    if (i + 1 != operands.Count)
                    {
                        whereClause += $" {operatorType} ";
                    }
                }
            }

            return(whereClause);
        }
Esempio n. 11
0
 public static void IleBaslayan(this CriteriaOperatorCollection list, string alan, TextBox textBox)
 {
     if (!string.IsNullOrWhiteSpace(textBox.Text))
     {
         list.Add(new BinaryOperator(alan, textBox.Text + "%", BinaryOperatorType.Like));
     }
 }
Esempio n. 12
0
        private static void AddRMItems(Session ReportSession, bool OnlyAssignedCustomers)
        {
            XPCollection <LocationInventory> itemCollection = null;
            CriteriaOperatorCollection       theCriteria    = new CriteriaOperatorCollection();
            VRMItemKey VRMKey = new VRMItemKey();

            theCriteria.Add(new BinaryOperator(LocationInventory.Fields.LocationInventoryItem.ItemType.PropertyName, "RM", BinaryOperatorType.Equal));

            if (OnlyAssignedCustomers)
            {
                theCriteria.Add(new InOperator(LocationInventory.Fields.LocationInventoryItem.ItemCustomerID.PropertyName, UsersCustomerBLL.GetAssignedCustomerIDs(ReportSession)));
            }

            itemCollection = new XPCollection <LocationInventory>(ReportSession, new GroupOperator(GroupOperatorType.And, theCriteria));

            foreach (LocationInventory item in itemCollection)
            {
                VRMKey.ItemCode = item.LocationInventoryItem.ItemCode;
                VRMKey.Location = item.Location.LocationCode;

                if (CurrentRMInventoryDictionary.ContainsKey(VRMKey))
                {
                    CurrentRMInventoryDictionary[VRMKey].QuantityOnHand += item.QuantityOnHand;
                }
                else
                {
                    CurrentRMInventoryDictionary.Add(VRMKey, new VRMItem()
                    {
                        Item = item
                    });
                }
            }
        }
Esempio n. 13
0
        List <object> InputObjectKeys(XPClassInfo classInfo, UnitOfWork inputUow)
        {
            var operatorCollection = new CriteriaOperatorCollection {
                new OperandProperty(classInfo.KeyProperty.Name)
            };

            return(inputUow.SelectData(classInfo, operatorCollection, null, false, 0, new SortingCollection()).Select(r => r[0]).ToList());
        }
Esempio n. 14
0
        private static FunctionOperator createOperandProperty(string property, FunctionOperatorType operatorType)
        {
            CriteriaOperatorCollection operands        = new CriteriaOperatorCollection();
            OperandProperty            propertyOperand = new OperandProperty(property);

            operands.Add(propertyOperand);
            return(new FunctionOperator(operatorType, operands));
        }
Esempio n. 15
0
        private static FunctionOperator createOperandValue(object requiredValue, FunctionOperatorType operatorType)
        {
            CriteriaOperatorCollection operands = new CriteriaOperatorCollection();
            OperandValue operandValue           = new OperandValue(requiredValue);

            operands.Add(operandValue);
            return(new FunctionOperator(operatorType, operands));
        }
 protected CriteriaOperatorCollection VisitOperands(CriteriaOperatorCollection operands)
 {
     foreach (CriteriaOperator operand in operands)
     {
         AcceptOperator(operand);
     }
     return(operands);
 }
Esempio n. 17
0
        public static void BuyukOlanlarByte(this CriteriaOperatorCollection list, string alan, TextBox textBox)
        {
            byte deger;

            if (byte.TryParse(textBox.Text, out deger))
            {
                list.Add(new BinaryOperator(alan, deger, BinaryOperatorType.GreaterOrEqual));
            }
        }
        public Expression Convert(CriteriaOperatorCollection operands, ParameterExpression thisExpression, ICriteriaToExpressionConverter converter)
        {
            Type elementType = GetElementType(thisExpression);
            ParameterExpression elementParameter = Expression.Parameter(elementType, "elem");
            LambdaExpression    groupSelect      = Expression.Lambda(converter.Convert(elementParameter, operands[1]), elementParameter);
            Expression          groupEpression   = Expression.Call(typeof(Enumerable), "GroupBy", new Type[] { elementType, groupSelect.Body.Type }, thisExpression, groupSelect);

            return(Expression.Call(typeof(Enumerable), "Count", new Type[] { groupEpression.Type.GetGenericArguments()[0] }, groupEpression));
        }
Esempio n. 19
0
        public static void TarihAra(this CriteriaOperatorCollection list, string alan, DateTimePicker date)
        {
            DateTime deger;

            if (DateTime.TryParse(Convert.ToString(date.Value.Date), out deger))
            {
                return;
            }
            list.Add(new BinaryOperator(alan, deger, BinaryOperatorType.Equal));
        }
        protected virtual CriteriaOperator VisitGroup(GroupOperator theOperator)
        {
            CriteriaOperatorCollection operands = this.VisitOperands(theOperator.Operands);

            if (object.ReferenceEquals(theOperator.Operands, operands))
            {
                return(theOperator);
            }
            return(new GroupOperator(theOperator.OperatorType, operands));
        }
Esempio n. 21
0
        private void FilterLots()
        {
            CriteriaOperatorCollection lotViewCriteria = new CriteriaOperatorCollection();

            if (((int?)lpnLookUpEdit.EditValue).HasValue)
            {
                lotViewCriteria.Add(new BinaryOperator(LocationInventoryByLot.Fields.LPNNumber.PropertyName, Convert.ToInt32(lpnLookUpEdit.EditValue), BinaryOperatorType.Equal));

                LotXpView.Criteria = CriteriaOperator.And(lotViewCriteria);
                LotXpView.Reload();
            }
        }
Esempio n. 22
0
        public static bool IsUniqueConstrauntViolated <T>(this T prmValue, params string[] prmUniqueFields) where T : XPObject
        {
            var operands = new CriteriaOperatorCollection();

            Array.ForEach(prmUniqueFields, property => operands.Add(new BinaryOperator(new OperandProperty(property),
                                                                                       new OperandValue(prmValue.ClassInfo.GetMember(property).GetValue(prmValue)), BinaryOperatorType.Equal)));
            CriteriaOperator keyCondition = new NotOperator(new BinaryOperator(prmValue.ClassInfo.KeyProperty.Name,
                                                                               prmValue.ClassInfo.KeyProperty.GetValue(prmValue)));

            return(prmValue.Session.FindObject <T>(PersistentCriteriaEvaluationBehavior.InTransaction,
                                                   new GroupOperator(new GroupOperator(GroupOperatorType.And, operands), keyCondition)) != null);
        }
Esempio n. 23
0
        private void FilterLpns()
        {
            CriteriaOperatorCollection lpnViewCriteria = new CriteriaOperatorCollection();

            if (((int?)itemLookUpEdit.EditValue).HasValue && ((int?)locationLookUpEdit.EditValue).HasValue)
            {
                lpnViewCriteria.Add(new BinaryOperator(LocationInventoryByLot.Fields.LocationInventoryItem.ItemID.PropertyName, Convert.ToInt32(itemLookUpEdit.EditValue), BinaryOperatorType.Equal));
                lpnViewCriteria.Add(new BinaryOperator(LocationInventoryByLot.Fields.Location.Oid.PropertyName, Convert.ToInt32(locationLookUpEdit.EditValue), BinaryOperatorType.Equal));

                lpnXpView.Criteria = CriteriaOperator.And(lpnViewCriteria);
            }
        }
        protected virtual CriteriaOperator VisitIn(InOperator theOperator)
        {
            CriteriaOperator           leftOperand = this.AcceptOperator(theOperator.LeftOperand);
            CriteriaOperatorCollection operands    = this.VisitOperands(theOperator.Operands);

            if (object.ReferenceEquals(theOperator.LeftOperand, leftOperand) &&
                object.ReferenceEquals(theOperator.Operands, operands))
            {
                return(theOperator);
            }
            return(new InOperator(leftOperand, operands));
        }
Esempio n. 25
0
        private static CriteriaOperatorCollection RemoveEmptyOperands(CriteriaOperatorCollection source)
        {
            CriteriaOperatorCollection result = new CriteriaOperatorCollection();

            foreach (CriteriaOperator operand in source)
            {
                if (!IsNull(operand))
                {
                    result.Add(operand);
                }
            }
            return(result);
        }
        private void AddProductionToSummary(DateTime?fromDate, DateTime?toDate, int currentItem)
        {
            CriteriaOperatorCollection theCriteria = new CriteriaOperatorCollection();

            if (fromDate.HasValue)
            {
                theCriteria.Add(new BinaryOperator("InventoryDate", fromDate.Value, BinaryOperatorType.GreaterOrEqual));
            }
            if (toDate.HasValue)
            {
                theCriteria.Add(new BinaryOperator("InventoryDate", toDate.Value, BinaryOperatorType.LessOrEqual));
            }
            theCriteria.Add(new BinaryOperator("InventoryItemID", currentItem, BinaryOperatorType.Equal));
            transactionSummary.Produced = Convert.ToDouble(Session.DefaultSession.Evaluate(typeof(Inventory), CriteriaOperator.Parse("Sum(InventoryQuantity)"), CriteriaOperator.And(theCriteria)));
        }
        private void AddAdjustmentsToSummary(DateTime?fromDate, DateTime?toDate, int currentItem)
        {
            CriteriaOperatorCollection theCriteria = new CriteriaOperatorCollection();

            if (fromDate.HasValue)
            {
                theCriteria.Add(new BinaryOperator("AdjustmentDate", fromDate.Value, BinaryOperatorType.GreaterOrEqual));
            }
            if (toDate.HasValue)
            {
                theCriteria.Add(new BinaryOperator("AdjustmentDate", toDate.Value, BinaryOperatorType.LessOrEqual));
            }
            theCriteria.Add(new BinaryOperator("AdjustmentItem", currentItem, BinaryOperatorType.Equal));
            transactionSummary.Adjusted = Convert.ToDouble(Session.DefaultSession.Evaluate(typeof(InventoryAdjustment), CriteriaOperator.Parse("Sum(NewCount) - Sum(OriginalQuantity)"), CriteriaOperator.And(theCriteria)));
        }
Esempio n. 28
0
        private void Btn_Bul_Click(object sender, EventArgs e)
        {
            CriteriaOperatorCollection filtreler = new CriteriaOperatorCollection();

            if (combo_Kategori.SelectedIndex == 0)
            {
                filtreler.Esit("Kod", txt_Ara);
            }
            else if (combo_Kategori.SelectedIndex == 1)
            {
                filtreler.Esit("Ad", txt_Ara);
            }

            dgv_Kayit_Listele.DataSource = Brans = new XPCollection <Brans>(CriteriaOperator.And(filtreler));
        }
        private void AddUsedInProductiontoSummary(DateTime?fromDate, DateTime?toDate, int currentItem)
        {
            CriteriaOperatorCollection theCriteria = new CriteriaOperatorCollection();

            if (fromDate.HasValue)
            {
                theCriteria.Add(new BinaryOperator("InventoryBOMInventoryID.InventoryDate", fromDate.Value, BinaryOperatorType.GreaterOrEqual));
            }
            if (toDate.HasValue)
            {
                theCriteria.Add(new BinaryOperator("InventoryBOMInventoryID.InventoryDate", toDate.Value, BinaryOperatorType.LessOrEqual));
            }
            theCriteria.Add(new BinaryOperator("InventoryBOMRawMatID", currentItem, BinaryOperatorType.Equal));
            transactionSummary.UsedInProduction = Convert.ToDouble(Session.DefaultSession.Evaluate(typeof(InventoryBOMs), CriteriaOperator.Parse("Sum((InventoryBOMQuantity + InventoryBOMQuantity * (ScrapFactor)) * InventoryBOMInventoryID.InventoryQuantity * -1)"), CriteriaOperator.And(theCriteria)));
        }
        protected CriteriaOperatorCollection VisitOperands(CriteriaOperatorCollection operands)
        {
            bool isModified = false;
            CriteriaOperatorCollection result = new CriteriaOperatorCollection(operands.Count);

            foreach (CriteriaOperator operand in operands)
            {
                CriteriaOperator acceptedOperand = this.AcceptOperator(operand);
                result.Add(acceptedOperand);
                if (!object.ReferenceEquals(operand, acceptedOperand))
                {
                    isModified = true;
                }
            }
            return(isModified ? result : operands);
        }
        public HQLSubQueryCriteria Parse(CriteriaOperatorCollection operands)
        {
            if (operands.IsEmpty())
            {
                return null;
            }

            if (operands.All(x => x is ConstantValue) == false)
            {
                return null;
            }

            var constantValues = operands.Cast<ConstantValue>().ToList();

            if (constantValues.Count < 2)
            {
                return null;
            }

            var markerOperand = constantValues[0];

            if (markerOperand.Value.Equals(HQL_SUBQUERY_MARKER) == false)
            {
                return null;
            }

            var bodyOperand = constantValues[1];

            if (bodyOperand.Value is string == false)
            {
                return null;
            }

            var parameterOperands = constantValues.Skip(2).ToList();

            return new HQLSubQueryCriteria
            {
                QueryTemplate = bodyOperand.Value.As<string>(),
                Parameters = parameterOperands
            };
        }
Esempio n. 32
0
 List<object> InputObjectKeys(XPClassInfo classInfo, UnitOfWork inputUow) {
     var operatorCollection = new CriteriaOperatorCollection{
                 new OperandProperty(classInfo.KeyProperty.Name)
             };
     return inputUow.SelectData(classInfo, operatorCollection, null, false, 0, new SortingCollection()).Select(r => r[0]).ToList();
 }
        private string ProcessOperands(CriteriaOperatorCollection operands)
        {
            var hqlSubQueryCriteria = new HQLSubQueryCriteriaParser().Parse(operands);

            if (hqlSubQueryCriteria != null)
            {
                var parameterNames = hqlSubQueryCriteria.Parameters.Select(ProcessConstantValue);

                var queryTemplate = hqlSubQueryCriteria.QueryTemplate;
                var templateArgs = parameterNames.Cast<object>().ToArray();

                return queryTemplate.FillWith(templateArgs);
            }

            throw new NotSupportedException("Не поддерживаем обработку данной коллекции.");
        }
        private void SelectRegister_Execute(object sender, SimpleActionExecuteEventArgs args)
        {
            ObjectSpace objectSpace = Application.CreateObjectSpace();
            ConstrainstParameter cpNHHK = objectSpace.FindObject<ConstrainstParameter>(
                           new BinaryOperator("Code", "REGISTERSEMESTER"));
            if (cpNHHK == null || cpNHHK.Value == 0 || cpNHHK.Value.ToString().Length!=5)
                throw new UserFriendlyException("Người Quản trị chưa thiết lập NHHK để ĐKMH, vui lòng liên hệ quản trị viên.");

            CriteriaOperatorCollection c = new CriteriaOperatorCollection();

            dicStudentRegDetail = new Dictionary<string, List<string>>();

            CollectionSource newCollectionSource = new CollectionSource(objectSpace, typeof(Lesson));
            listVacancies = new List<Vacancy>();
            foreach (StudentClass studentClass in View.SelectedObjects)
            {
                foreach (Student student in studentClass.Students)
                {
                    if (!dicStudentRegDetail.ContainsKey(student.StudentCode))
                        dicStudentRegDetail.Add(student.StudentCode, new List<string>());

                    foreach (RegisterDetail regDetail in student.RegisterDetails)
                    {
                        foreach (TkbSemester tkbsem in regDetail.Lesson.TKBSemesters)
                        {
                            listVacancies.Add( new Vacancy(tkbsem.Day, tkbsem.Period, tkbsem.Weeks, (tkbsem.Classroom == null ? "" : tkbsem.Classroom.ClassroomCode)));
                        }
                        dicStudentRegDetail[student.StudentCode].Add(regDetail.Lesson.Subject.SubjectCode);

                        newCollectionSource.Criteria[regDetail.Lesson.Subject.SubjectCode] =
                            new BinaryOperator("Subject.SubjectCode", regDetail.Lesson.Subject.SubjectCode, BinaryOperatorType.NotEqual);
                    }
                    //listStudentCode.Add(student.StudentCode);
                }
            }

            using (XPCollection xpLesson = new XPCollection(objectSpace.Session, typeof(Lesson)))
            {
                Vacancy vc;
                foreach (Lesson lesson in xpLesson)
                {
                    if ((Convert.ToInt32(lesson.Semester.SemesterName) <= cpNHHK.Value) || (lesson.NumRegistration >= lesson.NumExpectation))
                    {
                        //không đăng ký, quá sĩ số, khác nhhk
                        newCollectionSource.Criteria[lesson.Oid.ToString()] = new BinaryOperator("Oid", lesson.Oid, BinaryOperatorType.NotEqual);

                    }
                    //vi phạm thời khóa biểu
                    foreach (TkbSemester tkbsem in lesson.TKBSemesters)
                    {
                        vc = new Vacancy(tkbsem.Day, tkbsem.Period, tkbsem.Weeks, (tkbsem.Classroom == null ? "" : tkbsem.Classroom.ClassroomCode));
                        if (Utils.IsConfictTKB(listVacancies, vc))
                        {
                            newCollectionSource.Criteria[lesson.Oid.ToString()] = new BinaryOperator("Oid", lesson.Oid, BinaryOperatorType.NotEqual);
                            break;
                        }
                    }

                }
            }

            ListView lv = Application.CreateListView(
                Application.FindListViewId(typeof(Lesson)),
                newCollectionSource, true);
            lv.Editor.AllowEdit = false;
            lv.Editor.ControlsCreated += Editor_ControlsCreated;

            args.ShowViewParameters.CreatedView = lv;
            args.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow;
            args.ShowViewParameters.CreateAllControllers = true;
            DialogController selectAcception = new DialogController();
            args.ShowViewParameters.Controllers.Add(selectAcception);
            selectAcception.Accepting += selectAcception_AcceptingAdmin;
        }
 // Простая выборка полей по указанному запросу
 private SelectStatementResult SelectSimple(string sql, string parameterName, object parameterValue, params string[] columnNames)
 {
     StringCollection parametersNames = new StringCollection();
     parametersNames.Add(parameterName);
     CriteriaOperatorCollection selectFields = new CriteriaOperatorCollection(columnNames.Length);
     foreach (string columnName in columnNames)
         selectFields.Add(new QueryOperand(columnName, null));
     Query query = new Query(sql, new QueryParameterCollection(new OperandValue(parameterValue)), parametersNames);
     return SelectData(query, selectFields);
 }
Esempio n. 36
0
        private static CriteriaOperatorCollection GetCriteria(this GridView gv)
        {
            var go = gv.ActiveFilterCriteria as GroupOperator;
            if (ReferenceEquals(go, null))
            {
                if (!ReferenceEquals(gv.ActiveFilterCriteria, null))
                {
                    var OpC = new CriteriaOperatorCollection();
                    OpC.Add(gv.ActiveFilterCriteria);
                    return OpC;
                }

                return null;
            }
            return go.Operands;
        }
 private SelectStatementResult SelectData(Query query, CriteriaOperatorCollection targets)
 {
     if (query.ConstantValues != null && query.OperandIndexes != null && query.ConstantValues.Count > 0)
     {
         CriteriaOperatorCollection customTargets = new CriteriaOperatorCollection();
         if (query.OperandIndexes.Count == 0)
         {
             customTargets.Add(new OperandValue(1));
         }
         else
         {
             CriteriaOperator[] trgts = new CriteriaOperator[query.OperandIndexes.Count];
             for (int i = 0; i < targets.Count; i++)
             {
                 if (query.OperandIndexes.ContainsKey(i))
                 {
                     trgts[query.OperandIndexes[i]] = targets[i];
                 }
             }
             customTargets.AddRange(trgts);
         }
         SelectStatementResult queryResult = SelectDataSimple(query, customTargets, false)[0];
         SelectStatementResultRow[] rows = new SelectStatementResultRow[queryResult.Rows.Length];
         for (int ri = 0; ri < rows.Length; ri++)
         {
             object[] values = new object[targets.Count];
             for (int i = 0; i < targets.Count; i++)
             {
                 if (query.OperandIndexes.ContainsKey(i))
                 {
                     values[i] = queryResult.Rows[ri].Values[query.OperandIndexes[i]];
                 }
                 else
                 {
                     values[i] = query.ConstantValues[i].Value;
                 }
             }
             rows[ri] = new SelectStatementResultRow(values);
         }
         return new SelectStatementResult(rows);
     }
     return SelectDataSimple(query, targets, false)[0];
 }
 private SelectStatementResult[] SelectDataSimple(Query query, CriteriaOperatorCollection targets, bool includeMetadata)
 {
     // Команда выборки доступна как поле в процедуре отмены команды CancelSelect
     selectCommand = CreateCommand(query);
     try
     {
         SelectStatementResult[] result;
         for (int tryCount = 1; ; ++tryCount)
         {
             try
             {
                 result = InternalGetData(selectCommand, targets, query.SkipSelectedRecords, query.TopSelectedRecords, includeMetadata);
                 break;
             }
             catch (Exception e)
             {
                 if (Transaction == null && IsConnectionBroken(e) && tryCount <= 1)
                 {
                     try { DoReconnect(); continue; }
                     catch { }
                 }
                 throw WrapException(e, selectCommand);
             }
         }
         Trace.WriteLineIf(xpoSwitch.TraceInfo, new SelectStatementResultTracer(targets, result));
         return result;
     }
     finally
     {
         // Блокировка переменной selectCommand
         lock (selectCancelLocker)
         {
             DisposeCommand(selectCommand);
             selectCommand = null;
         }
     }
 }
        private void SelectRegister_Execute(object sender, SimpleActionExecuteEventArgs args)
        {
            PopUpMessage ms;
            DialogController dc;
            ObjectSpace objectSpace = Application.CreateObjectSpace();
            {
                ConstrainstParameter cpNHHK = objectSpace.FindObject<ConstrainstParameter>(
                           new BinaryOperator("Code", "REGISTERSEMESTER"));

                if (cpNHHK == null || cpNHHK.Value == 0)
                    throw new UserFriendlyException("Người Quản trị chưa thiết lập NHHK để ĐKMH, vui lòng liên hệ quản trị viên.");

                if (SecuritySystem.CurrentUser is Student)
                {
                    #region student

                    CriteriaOperatorCollection c = new CriteriaOperatorCollection();

                    if (!IsInBookTime((Student)SecuritySystem.CurrentUser))
                    {
                        ms = objectSpace.CreateObject<PopUpMessage>();
                        ms.Title = "Không đăng ký được";
                        //ms.Message = string.Format("Chỉ đăng ký được trong khoảng thời gian qui định");
                        ms.Message = string.Format("Chỉ chọn được trong khoảng thời gian qui định\r\n từ ngày {0:dd-MM-yyyy} đến ngày {1:dd-MM-yyyy}",
                                StartConfirmDate, EndConfirmDate);
                        args.ShowViewParameters.CreatedView = Application.CreateDetailView(
                             objectSpace, ms);
                        args.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow;
                        args.ShowViewParameters.CreatedView.Caption = "Thông báo";
                        dc = Application.CreateController<DialogController>();
                        dc.AcceptAction.Active.SetItemValue("object", false);
                        dc.CancelAction.Caption = "Đóng";
                        args.ShowViewParameters.Controllers.Add(dc);

                        dc.SaveOnAccept = false;

                        return;
                    }

                    decimal deptAmount = 0m;
                    if (IsInDeptStudent(objectSpace, (Student)SecuritySystem.CurrentUser, out deptAmount))
                    {
                        ms = objectSpace.CreateObject<PopUpMessage>();
                        ms.Title = "Không đăng ký được";
                        ms.Message = string.Format("Không đăng ký được vì bạn đang nợ học phí số tiền {0:0,0}", deptAmount);
                        args.ShowViewParameters.CreatedView = Application.CreateDetailView(
                             objectSpace, ms);
                        args.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow;
                        args.ShowViewParameters.CreatedView.Caption = "Thông báo";
                        dc = Application.CreateController<DialogController>();
                        dc.AcceptAction.Active.SetItemValue("object", false);
                        dc.CancelAction.Caption = "Đóng";
                        args.ShowViewParameters.Controllers.Add(dc);
                        dc.SaveOnAccept = false;
                        return;
                    }

                    CollectionSource newCollectionSource = new CollectionSource(objectSpace, typeof(Lesson));
                    newCollectionSource.Criteria[cpNHHK.Value.ToString()] = new BinaryOperator(
                        "Semester.SemesterName", cpNHHK.Value, BinaryOperatorType.Greater);

                    listVacancies = new List<Vacancy>();
                    ASPxGridListEditor listEditor = ((ListView)View).Editor as ASPxGridListEditor;
                    ASPxGridView gv = listEditor.Grid;
                    gv.Selection.SelectAll();

                    foreach (RegisterDetail regDetail in ((ListView)View).SelectedObjects)
                    {
                        foreach (TkbSemester tkbsem in regDetail.Lesson.TKBSemesters)
                        {
                            listVacancies.Add(new Vacancy(tkbsem.Day, tkbsem.Period, tkbsem.Weeks, tkbsem.Classroom.ClassroomCode));
                        }
                        newCollectionSource.Criteria[regDetail.Lesson.Subject.SubjectCode] =
                               new BinaryOperator("Subject.SubjectCode", regDetail.Lesson.Subject.SubjectCode, BinaryOperatorType.NotEqual);

                        //newCollectionSource.Criteria[regDetail.Lesson.Oid.ToString()] =
                        //    new BinaryOperator("Oid", regDetail.Lesson.Oid, BinaryOperatorType.NotEqual);
                    }

                    using (XPCollection xpLesson = new XPCollection(objectSpace.Session, typeof(Lesson)))
                    {
                        Vacancy vc;
                        foreach (Lesson lesson in xpLesson)
                        {
                            if ((!lesson.CanRegister) || (lesson.NumRegistration >= lesson.NumExpectation)) //||(Convert.ToInt32(lesson.Semester.SemesterName)<=cpNHHK.Value)
                            {
                                //quá sĩ số
                                newCollectionSource.Criteria[lesson.Oid.ToString()] = new BinaryOperator("Oid", lesson.Oid, BinaryOperatorType.NotEqual);

                            }
                            //vi phạm thời khóa biểu
                            foreach (TkbSemester tkbsem in lesson.TKBSemesters)
                            {
                                vc = new Vacancy(tkbsem.Day, tkbsem.Period, tkbsem.Weeks, (tkbsem.Classroom == null ? "" : tkbsem.Classroom.ClassroomCode));
                                if (Utils.IsConfictTKB(listVacancies, vc))
                                {
                                    newCollectionSource.Criteria[lesson.Oid.ToString()] = new BinaryOperator("Oid", lesson.Oid, BinaryOperatorType.NotEqual);
                                    break;
                                }
                            }

                        }
                    }

                    ListView lv = Application.CreateListView(
                        Application.FindListViewId(typeof(Lesson)),
                        newCollectionSource, true);
                    lv.Editor.AllowEdit = false;
                    lv.Editor.ControlsCreated += Editor_ControlsCreated;

                    args.ShowViewParameters.CreatedView = lv;
                    args.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow;
                    args.ShowViewParameters.CreateAllControllers = true;
                    DialogController selectAcception = new DialogController();
                    args.ShowViewParameters.Controllers.Add(selectAcception);
                    selectAcception.AcceptAction.Caption = "Chọn";
                    selectAcception.CancelAction.Caption = "Bỏ qua";
                    selectAcception.Accepting += selectAcception_AcceptingStudent;
                    #endregion
                }
                else
                {

                    CriteriaOperatorCollection c = new CriteriaOperatorCollection();

                    dicStudentRegDetail = new Dictionary<string, List<string>>();

                    CollectionSource newCollectionSource = new CollectionSource(objectSpace, typeof(Lesson));
                    newCollectionSource.Criteria[cpNHHK.Value.ToString()] = new BinaryOperator(
                       "Semester.SemesterName", cpNHHK.Value, BinaryOperatorType.Greater);
                    listVacancies = new List<Vacancy>();
                    foreach (Student student in View.SelectedObjects)
                    {
                        if (!dicStudentRegDetail.ContainsKey(student.StudentCode))
                            dicStudentRegDetail.Add(student.StudentCode, new List<string>());

                        foreach (RegisterDetail regDetail in student.RegisterDetails)
                        {
                            foreach (TkbSemester tkbsem in regDetail.Lesson.TKBSemesters)
                            {
                                listVacancies.Add(new Vacancy(tkbsem.Day, tkbsem.Period, tkbsem.Weeks, tkbsem.Classroom.ClassroomCode));
                            }
                            dicStudentRegDetail[student.StudentCode].Add(regDetail.Lesson.Subject.SubjectCode);

                            newCollectionSource.Criteria[regDetail.Lesson.Subject.SubjectCode] =
                                new BinaryOperator("Subject.SubjectCode", regDetail.Lesson.Subject.SubjectCode, BinaryOperatorType.NotEqual);
                        }
                        //listStudentCode.Add(student.StudentCode);
                    }

                    using (XPCollection xpLesson = new XPCollection(objectSpace.Session, typeof(Lesson)))
                    {
                        Vacancy vc;
                        foreach (Lesson lesson in xpLesson)
                        {
                            if ((lesson.NumRegistration >= lesson.NumExpectation))//(Convert.ToInt32(lesson.Semester.SemesterName) <= cpNHHK.Value) ||
                            {
                                //quá sĩ số
                                newCollectionSource.Criteria[lesson.Oid.ToString()] = new BinaryOperator("Oid", lesson.Oid, BinaryOperatorType.NotEqual);

                            }
                            //vi phạm thời khóa biểu
                            foreach (TkbSemester tkbsem in lesson.TKBSemesters)
                            {
                                vc = new Vacancy(tkbsem.Day, tkbsem.Period, tkbsem.Weeks, (tkbsem.Classroom == null ? "" : tkbsem.Classroom.ClassroomCode));
                                if (Utils.IsConfictTKB(listVacancies, vc))
                                {
                                    newCollectionSource.Criteria[lesson.Oid.ToString()] = new BinaryOperator("Oid", lesson.Oid, BinaryOperatorType.NotEqual);
                                    break;
                                }
                            }

                        }
                    }

                    ListView lv = Application.CreateListView(
                        Application.FindListViewId(typeof(Lesson)),
                        newCollectionSource, true);
                    lv.Editor.AllowEdit = false;
                    lv.Editor.ControlsCreated += Editor_ControlsCreated;

                    args.ShowViewParameters.CreatedView = lv;
                    args.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow;
                    args.ShowViewParameters.CreateAllControllers = true;
                    //args.ShowViewParameters.Context = TemplateContext.View;
                    DialogController selectAcception = new DialogController();
                    args.ShowViewParameters.Controllers.Add(selectAcception);
                    selectAcception.Accepting += selectAcception_AcceptingAdmin;

                    selectAcception.AcceptAction.Caption = "Chọn";
                    selectAcception.CancelAction.Caption = "Bỏ qua";

                }
            }
        }
        private void SelectRegister_Execute(object sender, SimpleActionExecuteEventArgs args)
        {
            ObjectSpace os = Application.CreateObjectSpace();

            if (SecuritySystem.CurrentUser is Student)
            {
                #region student
                ObjectSpace objectSpace = Application.CreateObjectSpace();
                CriteriaOperatorCollection c = new CriteriaOperatorCollection();

                CollectionSource newCollectionSource = new CollectionSource(objectSpace, typeof(Lesson));
                listVacancies = new List<Vacancy>();
                foreach (RegisterDetail regDetail in ((ProxyCollection)((DevExpress.ExpressApp.ListView)View).CollectionSource.Collection))
                {
                    foreach (TkbSemester tkbsem in regDetail.Lesson.TKBSemesters)
                    {
                        listVacancies.Add(new Vacancy(tkbsem.Day, tkbsem.Period, tkbsem.Weeks, tkbsem.Classroom.ClassroomCode));
                    }
                    //newCollectionSource.Criteria[regDetail.Lesson.Oid.ToString()] =
                    //    new BinaryOperator("Oid", regDetail.Lesson.Oid, BinaryOperatorType.NotEqual);
                }

                using (XPCollection xpLesson = new XPCollection(objectSpace.Session, typeof(Lesson)))
                {
                    Vacancy vc;
                    foreach (Lesson lesson in xpLesson)
                    {
                        if ((!lesson.CanRegister) || (lesson.NumRegistration >= lesson.NumExpectation))
                        {
                            //quá sĩ số
                            newCollectionSource.Criteria[lesson.Oid.ToString()] = new BinaryOperator("Oid", lesson.Oid, BinaryOperatorType.NotEqual);

                        }
                        //vi phạm thời khóa biểu
                        foreach (TkbSemester tkbsem in lesson.TKBSemesters)
                        {
                            vc = new Vacancy(tkbsem.Day, tkbsem.Period, tkbsem.Weeks, (tkbsem.Classroom == null ? "" : tkbsem.Classroom.ClassroomCode));
                            if (Utils.IsConfictTKB(listVacancies, vc))
                            {
                                newCollectionSource.Criteria[lesson.Oid.ToString()] = new BinaryOperator("Oid", lesson.Oid, BinaryOperatorType.NotEqual);
                                break;
                            }
                        }

                    }
                }

                DevExpress.ExpressApp.ListView lv = Application.CreateListView(
                    Application.FindListViewId(typeof(Lesson)),
                    newCollectionSource, true);
                lv.Editor.AllowEdit = false;
                lv.Editor.ControlsCreated += Editor_ControlsCreated;

                args.ShowViewParameters.CreatedView = lv;
                args.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow;
                args.ShowViewParameters.CreateAllControllers = true;
                DialogController selectAcception = new DialogController();
                args.ShowViewParameters.Controllers.Add(selectAcception);
                selectAcception.Accepting += selectAcception_AcceptingStudent;
                #endregion
            }
            else
            {
                ObjectSpace objectSpace = Application.CreateObjectSpace();
                CriteriaOperatorCollection c = new CriteriaOperatorCollection();
                listStudentCode = new List<string>();
                CollectionSource newCollectionSource = new CollectionSource(objectSpace, typeof(Lesson));
                listVacancies = new List<Vacancy>();
                foreach (Student student in View.SelectedObjects)
                {
                    foreach (RegisterDetail regDetail in student.RegisterDetails)
                    {
                        foreach (TkbSemester tkbsem in regDetail.Lesson.TKBSemesters)
                        {
                            listVacancies.Add(new Vacancy(tkbsem.Day, tkbsem.Period, tkbsem.Weeks, tkbsem.Classroom.ClassroomCode));
                        }
                        //newCollectionSource.Criteria[regDetail.Lesson.Oid.ToString()] =
                        //    new BinaryOperator("Oid", regDetail.Lesson.Oid, BinaryOperatorType.NotEqual);
                    }
                    listStudentCode.Add(student.StudentCode);
                }
                using (XPCollection xpLesson = new XPCollection(objectSpace.Session, typeof(Lesson)))
                {
                    Vacancy vc;
                    foreach (Lesson lesson in xpLesson)
                    {
                        if ((!lesson.CanRegister) || (lesson.NumRegistration >= lesson.NumExpectation))
                        {
                            //quá sĩ số
                            newCollectionSource.Criteria[lesson.Oid.ToString()] = new BinaryOperator("Oid", lesson.Oid, BinaryOperatorType.NotEqual);

                        }
                        //vi phạm thời khóa biểu
                        foreach (TkbSemester tkbsem in lesson.TKBSemesters)
                        {
                            vc = new Vacancy(tkbsem.Day, tkbsem.Period, tkbsem.Weeks, (tkbsem.Classroom == null ? "" : tkbsem.Classroom.ClassroomCode));
                            if (Utils.IsConfictTKB(listVacancies, vc))
                            {
                                newCollectionSource.Criteria[lesson.Oid.ToString()] = new BinaryOperator("Oid", lesson.Oid, BinaryOperatorType.NotEqual);
                                break;
                            }
                        }

                    }
                }

                DevExpress.ExpressApp.ListView lv = Application.CreateListView(
                    Application.FindListViewId(typeof(Lesson)),
                    newCollectionSource, true);
                lv.Editor.AllowEdit = false;
                lv.Editor.ControlsCreated += Editor_ControlsCreated;

                args.ShowViewParameters.CreatedView = lv;
                args.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow;
                args.ShowViewParameters.CreateAllControllers = true;
                DialogController selectAcception = new DialogController();
                args.ShowViewParameters.Controllers.Add(selectAcception);
                selectAcception.Accepting += selectAcception_AcceptingAdmin;
            }
        }
 private void Process(CriteriaOperatorCollection operands)
 {
     if (operands != null)
         foreach (CriteriaOperator operand in operands) Process(operand);
 }
Esempio n. 42
0
 private CriteriaOperatorCollection GetOperatorCollection(string fields, DataTable dataTable)
 {
     var operatorCollection = new CriteriaOperatorCollection();
     foreach (string property in fields.Split(';'))
         if (property != "" && property.IndexOf("!") == -1 && property != "This")
         {
             XPMemberInfo xpMemberInfo = ReflectorHelper.GetXpMemberInfo(Session, ObjectType, property);
             if (xpMemberInfo.IsPersistent)
             {
                 operatorCollection.Add(CriteriaOperator.Parse(property, new object[0]));
                 var dataColumn = new DataColumn(property) {DataType = xpMemberInfo.MemberType};
                 if (typeof (XPBaseObject).IsAssignableFrom(dataColumn.DataType))
                     dataColumn.DataType = Session.GetClassInfo(dataColumn.DataType).KeyProperty.MemberType;
                 dataTable.Columns.Add(dataColumn);
                 if (property == ObjectClassInfo.KeyProperty.Name)
                     dataTable.PrimaryKey = new[] {dataColumn};
             }
         }
     return operatorCollection;
 }
 private void Process(CriteriaOperatorCollection operands)
 {
     if (operands != null)
         for (int i = 0; i < operands.Count; i++)
             operands[i] = Process(operands[i]);
 }