protected override void OnActivated() { base.OnActivated(); string condition = CriteriaOperator.And(CriteriaOperator.Parse("[gioCong] Is Null")).ToString(); CriteriaOperator criteria = CriteriaOperator.Parse(condition); IList <CheckInOut> checkInOuts = ObjectSpace.GetObjects <CheckInOut>(criteria); foreach (CheckInOut checkInOut in checkInOuts) { CheckInOut check = ObjectSpace.GetObjectByKey <CheckInOut>(checkInOut.Id); CriteriaOperator criteriaOperator = CriteriaOperator.And(CriteriaOperator.Parse("[nguoiChamCong] = ?", check.nguoiChamCong), CriteriaOperator.Parse("[ngay.ngayChamCong] = ?", check.NgayCham)); GioCong gio = ObjectSpace.FindObject <GioCong>(criteriaOperator); check.gioCong = gio; } ObjectSpace.CommitChanges(); ObjectSpace.Refresh(); View.Refresh(); Console.WriteLine(checkInOuts); }
public bool unselectUnitTypeForItem(Guid itemUnitTypeConfigId) { using (UnitOfWork uow = XpoHelper.GetNewUnitOfWork()) { try { ItemUnitTypeConfig iutc = uow.GetObjectByKey <ItemUnitTypeConfig>(itemUnitTypeConfigId); iutc.RowStatus = Utility.Constant.ROWSTATUS_DEFAULT; iutc.IsMaster = false; iutc.IsSelected = false; iutc.Save(); XPCollection <ItemUnit> itemUnits = new XPCollection <ItemUnit>(uow, CriteriaOperator.And( new BinaryOperator("ItemId", iutc.ItemId, BinaryOperatorType.Equal), new NotOperator(new NullOperator("UnitId")), new NotOperator(new NullOperator("UnitId.UnitTypeId")), new BinaryOperator("UnitId.UnitTypeId.Code", iutc.UnitTypeId.Code, BinaryOperatorType.Equal) )); foreach (ItemUnit iu in itemUnits) { iu.RowStatus = Utility.Constant.ROWSTATUS_DELETED; iu.Save(); } uow.FlushChanges(); uow.CommitChanges(); return(true); } catch { throw; } finally { uow.Dispose(); } } }
private FinancialSalesOrManufactureExpenseSummary_Fact GetFinancialSalesOrManufactureExpenseSummary( Session session, Guid OwnerOrgId, DateTime IssueDate ) { FinancialSalesOrManufactureExpenseSummary_Fact result = null; try { Util util = new Util(); OwnerOrgDim ownerOrgDim = util.GetXpoObjectByFieldName <OwnerOrgDim, Guid>(session, "RefId", OwnerOrgId, BinaryOperatorType.Equal); MonthDim monthDim = util.GetXpoObjectByFieldName <MonthDim, string>(session, "Name", IssueDate.Month.ToString(), BinaryOperatorType.Equal); YearDim yearDim = util.GetXpoObjectByFieldName <YearDim, string>(session, "Name", IssueDate.Year.ToString(), BinaryOperatorType.Equal); if (ownerOrgDim == null || monthDim == null || yearDim == null) { return(null); } else { CriteriaOperator criteria_RowStatus = new BinaryOperator("RowStatus", Constant.ROWSTATUS_ACTIVE, BinaryOperatorType.GreaterOrEqual); CriteriaOperator criteria_OwnerOrg = new BinaryOperator("OwnerOrgDimId", ownerOrgDim, BinaryOperatorType.Equal); CriteriaOperator criteria_Month = new BinaryOperator("MonthDimId", monthDim, BinaryOperatorType.Equal); CriteriaOperator criteria_Year = new BinaryOperator("YearDimId", yearDim, BinaryOperatorType.Equal); CriteriaOperator criteria = CriteriaOperator.And(criteria_RowStatus, criteria_OwnerOrg, criteria_Month, criteria_Year); FinancialSalesOrManufactureExpenseSummary_Fact fact = session.FindObject <FinancialSalesOrManufactureExpenseSummary_Fact>(criteria); if (fact == null) { return(null); } result = fact; } } catch (Exception) { return(result); } return(result); }
public XPCollection <ETLBusinessObject> GetOlderETLBusinessObject(Session session, Guid jobId, Int64 ObjectId) { XPCollection <ETLBusinessObject> etlBusinessObjectCollection = null; try { ETLJob job = session.GetObjectByKey <ETLJob>(jobId); if (job == null) { return(null); } BusinessObject businessObject = session.GetObjectByKey <BusinessObject>(ObjectId); if (businessObject == null) { return(null); } DateTime issueDate = businessObject.ObjectIssueDate; DateTime createDate = businessObject.IssuedDateTimeStamp; CriteriaOperator criteria_Job = new BinaryOperator("ETLJobId", job, BinaryOperatorType.Equal); //DateTime CriteriaOperator criteria_IssueDate = new BinaryOperator(new OperandProperty("BusinessObjectId.ObjectIssueDate"), issueDate, BinaryOperatorType.Less); CriteriaOperator criteria_IssueDate_1 = new BinaryOperator(new OperandProperty("BusinessObjectId.ObjectIssueDate"), issueDate, BinaryOperatorType.Equal); CriteriaOperator criteria_CreateDate = new BinaryOperator("BusinessObjectId.IssuedDateTimeStamp", createDate, BinaryOperatorType.LessOrEqual); CriteriaOperator criteria_Datetime = CriteriaOperator.Or( criteria_IssueDate, CriteriaOperator.And(criteria_IssueDate_1, criteria_CreateDate)); CriteriaOperator criteria_RowStatus = new BinaryOperator("RowStatus", 0, BinaryOperatorType.GreaterOrEqual); CriteriaOperator criteria_BusinessObjectId = new BinaryOperator(new OperandProperty("BusinessObjectId.BusinessObjectId"), businessObject.BusinessObjectId, BinaryOperatorType.NotEqual); CriteriaOperator criteria = CriteriaOperator.And(criteria_Job, criteria_Datetime, criteria_RowStatus, criteria_BusinessObjectId); etlBusinessObjectCollection = new XPCollection <ETLBusinessObject>(session, criteria); } catch (Exception) { throw; } return(etlBusinessObjectCollection); }
public override void InitXpoDatasource(XpoDataSource datasource) { Session session = null; try { session = XpoHelper.GetNewSession(); //Set TypeName datasource.TypeName = typeof(NAS.DAL.Nomenclature.Organization.Organization).FullName; //Set Criteria //Get CUSTOMER trading type TradingCategory customerTradingCategory = session.FindObject <TradingCategory>(new BinaryOperator("Code", "CUSTOMER")); CriteriaOperator criteria = CriteriaOperator.And( //row status is active new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE), //find customer and customer new ContainsOperator("OrganizationCategories", CriteriaOperator.And( new BinaryOperator("TradingCategoryId.TradingCategoryId", customerTradingCategory.TradingCategoryId), new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE) ) ) ); datasource.Criteria = criteria.ToString(); datasource.DefaultSorting = "Code"; } catch (Exception) { throw; } finally { if (session != null) { session.Dispose(); } } }
protected override void OnViewControlsCreated() { base.OnViewControlsCreated(); ListView Vista = (ListView)this.View; BinaryOperator CriteriaUsuario = new BinaryOperator("UserName", SecuritySystem.CurrentUserName); Usuario Usuario = this.ObjectSpace.FindObject <Usuario>(CriteriaUsuario); BinaryOperator UsuarioActual = new BinaryOperator("UsuarioRegistro.Oid", Usuario.Oid); if (!Usuario.UsuarioAdministrador && !Usuario.UsuarioGerente && !Usuario.UsuarioTaller && !Usuario.UsuarioJefeTaller) { CriteriaOperator UsuarioCriteria = CriteriaOperator.And(UsuarioActual); Vista.CollectionSource.Criteria["Filtro Salida Vehiculo"] = UsuarioCriteria; } else if (Usuario.UsuarioGerente) { BinaryOperator BinaryFecha = new BinaryOperator("FechaSalida", "2020-01-01", BinaryOperatorType.GreaterOrEqual); CriteriaOperator FechaCriteria = CriteriaOperator.And(BinaryFecha); Vista.CollectionSource.Criteria["Filtro Usuario"] = FechaCriteria; } }
public FinancialCustomerLiabilitySummary_Fact get_FinancialCustomerLiabilitySUmmary_FactId_6(Session session, int FinacialAccountDimId, int CustomerOrgDimId, int MonthDimId, int YearDimId, short RowStatus) { try { FinancialCustomerLiabilitySummary_Fact fclsf = session.FindObject <FinancialCustomerLiabilitySummary_Fact>( CriteriaOperator.And( new BinaryOperator("FinancialAccountDimId", FinacialAccountDimId, BinaryOperatorType.Equal), new BinaryOperator("CustomerOrgDimId", CustomerOrgDimId, BinaryOperatorType.Equal), new BinaryOperator("MonthDimId", MonthDimId, BinaryOperatorType.Equal), new BinaryOperator("YearDimId", YearDimId, BinaryOperatorType.Equal), new BinaryOperator("RowStatus", RowStatus, BinaryOperatorType.Equal) )); if (fclsf == null) { return(null); } return(fclsf); } catch (Exception) { throw; } }
public XPCollection <Currency> get_Collection_Currency_Id(Session session, string CurrencyType_Id, short RowStatus) { try { XPCollection <Currency> currencyid = new XPCollection <Currency>(session, CriteriaOperator.And( new BinaryOperator("CurrencyTypeId", CurrencyType_Id, BinaryOperatorType.Equal), new BinaryOperator("RowStatus", RowStatus, BinaryOperatorType.Equal) )); if (currencyid != null) { return(currencyid); } return(null); } catch (Exception) { throw; } }
public FinancialGeneralLedgerByMonth get_FinancialGeneralLedgerByMonth_Debit(Session session, int FinancialGeneralLedgerByYear_FactId, int CorrespondFinancialAccountDimId, int MonthDimId, short RowStatus) { try { FinancialGeneralLedgerByMonth FGLM = session.FindObject <FinancialGeneralLedgerByMonth>( CriteriaOperator.And( new BinaryOperator("FinancialGeneralLedgerByYear_FactId", FinancialGeneralLedgerByYear_FactId, BinaryOperatorType.Equal), new BinaryOperator("CorrespondFinancialAccountDimId", CorrespondFinancialAccountDimId, BinaryOperatorType.Equal), new BinaryOperator("MonthDimId", MonthDimId, BinaryOperatorType.Equal), new BinaryOperator("RowStatus", RowStatus, BinaryOperatorType.Equal), new BinaryOperator("DebitSum", 0, BinaryOperatorType.Greater) )); if (FGLM == null) { return(null); } return(FGLM); } catch (Exception) { throw; } }
public NAS.DAL.Accounting.Currency.CurrencyType GetDefaultCurrencyType(DevExpress.Xpo.Session session) { try { CurrencyType currencyType_Id_true = session.FindObject <CurrencyType>( CriteriaOperator.And( new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE, BinaryOperatorType.Equal), new BinaryOperator("IsMaster", true, BinaryOperatorType.Equal) )); if (currencyType_Id_true != null) { return(currencyType_Id_true); } return(null); } catch (Exception) { throw new NotImplementedException(); } }
protected fmCAVTInvoiceBase AVTInvoiceCheck() { crmCParty supl = null; if (crmUserParty.CurrentUserParty != null) { if (crmUserParty.CurrentUserParty.Value != null) { supl = (crmCParty)crmUserParty.CurrentUserPartyGet(this.Session).Party; } } fmCAVTInvoiceBase invoice = Session.FindObject <fmCAVTInvoiceBase>( CriteriaOperator.And( new BinaryOperator("Number", AVTInvoiceNumber), new BinaryOperator("Date", AVTInvoiceDate), new BinaryOperator("Supplier", supl) )); return(invoice); }
public override void ItemsRequestedByFilterCondition(DevExpress.Xpo.Session session, object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { ASPxComboBox combo = source as ASPxComboBox; XPCollection <SalesInvoice> collection = new XPCollection <SalesInvoice>(session); collection.SkipReturnedObjects = e.BeginIndex; collection.TopReturnedObjects = e.EndIndex - e.BeginIndex + 1; CriteriaOperator criteria = CriteriaOperator.And( //row status is active new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE, BinaryOperatorType.GreaterOrEqual), new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like) ); collection.Criteria = criteria; collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending)); combo.DataSource = collection; combo.DataBindItems(); }
public XPCollection <Transaction> GetPlanningTransactionsOfBill(Session session, Guid billId) { XPCollection <Transaction> resultTransaction = null; try { NAS.DAL.Invoice.SalesInvoice bill = session.GetObjectByKey <NAS.DAL.Invoice.SalesInvoice>(billId); CriteriaOperator criteria = CriteriaOperator.And( new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE, BinaryOperatorType.GreaterOrEqual), new ContainsOperator("GeneralJournals", new BinaryOperator("JournalType", JounalTypeConstant.PLANNING))); resultTransaction = new XPCollection <Transaction>(session, bill.SaleInvoiceTransactions, criteria); } catch (Exception) { throw; } return(resultTransaction); }
public static XPView GetReceivingDetailsByItemID(int itemID) { XPView ReceivingXPView = new XPView(Session.DefaultSession, typeof(ReceivingDetail)); ReceivingXPView.Properties.AddRange(new ViewProperty[] { new ViewProperty("ReceiveDetID", SortDirection.None, ReceivingDetail.Fields.ReceivDetID, false, true), new ViewProperty("ReceiveMainID", SortDirection.Ascending, ReceivingDetail.Fields.ReceivMainID.ReceivID, false, true), new ViewProperty("ReceiveDetLot", SortDirection.None, ReceivingDetail.Fields.ReceivDetLot, false, true), new ViewProperty("ReceiveDetLPN", SortDirection.None, ReceivingDetail.Fields.ReceivDetLPN, false, true), new ViewProperty("ExpirationDate", SortDirection.None, ReceivingDetail.Fields.ExpirationDate, false, true), new ViewProperty("ReceiveDetQty", SortDirection.None, ReceivingDetail.Fields.ReceivDetQty, false, true), new ViewProperty("ReceiveBOL", SortDirection.None, ReceivingDetail.Fields.ReceivMainID.ReceivBOL, false, true), new ViewProperty("ReceiveDate", SortDirection.None, ReceivingDetail.Fields.ReceivMainID.ReceivDate, false, true) }); ReceivingXPView.Criteria = CriteriaOperator.And(new BinaryOperator(ReceivingDetail.Fields.ReceivDetItemID.ItemType.PropertyName, "FG", BinaryOperatorType.NotEqual), new BinaryOperator(ReceivingDetail.Fields.ReceivDetItemID.ItemID.PropertyName, itemID, BinaryOperatorType.Equal)); return(ReceivingXPView); }
protected override void OnActivated() { base.OnActivated(); //MessageBox.Show("Cập nhật nhân viên"); CriteriaOperator criteria = CriteriaOperator.And(CriteriaOperator.Parse("[thoiGianChamCongs][].Count() = ?", 0)); IList <NhanVien> nhanViens = ObjectSpace.GetObjects <NhanVien>(criteria); if (!Equals(nhanViens, null)) { foreach (NhanVien nv in nhanViens) { nv.ngayNghiViec = new DateTime(2019, 3, 30); } } ObjectSpace.CommitChanges(); ObjectSpace.Refresh(); View.Refresh(); // Perform various tasks depending on the target View. }
public LegalInvoiceArtifactIdentifierType get_IdentifierTypeId(Session session, string Name) { try { LegalInvoiceArtifactIdentifierType id_indentifier = session.FindObject <LegalInvoiceArtifactIdentifierType>( CriteriaOperator.And( new BinaryOperator("Name", Name, BinaryOperatorType.Equal), new BinaryOperator("RowStatus", 0, BinaryOperatorType.Greater) )); if (id_indentifier == null) { return(null); } return(id_indentifier); } catch (Exception) { throw; } }
public XPCollection <InventoryJournal> getTransactionInventoryJournals(Session session, Guid InventoryId, Guid ItemUnitId) { try { AccountingPeriod currentAP = AccountingPeriodBO.getCurrentAccountingPeriod(session); //if (currentAP == null) // return null; XPCollection <InventoryTransaction> ITLst = new XPCollection <InventoryTransaction>(session); //ITLst.Criteria = CriteriaOperator.And( // new BinaryOperator("AccountingPeriodId", currentAP, BinaryOperatorType.Equal), // new BinaryOperator("RowStatus", 0, BinaryOperatorType.Greater) // ); ITLst.Criteria = new BinaryOperator("RowStatus", 0, BinaryOperatorType.Greater); if (ITLst == null || ITLst.Count == 0) { return(null); } CriteriaOperator criteriaIN = new InOperator("InventoryTransactionId", ITLst); XPCollection <InventoryJournal> IJLst = new XPCollection <InventoryJournal>(session); IJLst.Criteria = CriteriaOperator.And( new InOperator("InventoryTransactionId", ITLst), new BinaryOperator("ItemUnitId!Key", ItemUnitId, BinaryOperatorType.Equal), new BinaryOperator("InventoryId!Key", InventoryId, BinaryOperatorType.Equal) ); SortingCollection sortCollection = new SortingCollection(); sortCollection.Add(new SortProperty("InventoryTransactionId.IssueDate", DevExpress.Xpo.DB.SortingDirection.Descending)); sortCollection.Add(new SortProperty("CreateDate", DevExpress.Xpo.DB.SortingDirection.Descending)); sortCollection.Add(new SortProperty("UpdateDate", DevExpress.Xpo.DB.SortingDirection.Descending)); IJLst.Sorting = sortCollection; return(IJLst); } catch (Exception e) { return(null); } }
public override XPCollection <Transaction> GetRelatedTransactionsWithBill(Session session, Guid billId) { try { XPCollection <Transaction> ret = null; ObjectBO objectBO = new ObjectBO(); List <Guid> billIds = new List <Guid>(); billIds.Add(billId); ObjectTypeCustomField objectTypeCustomField = ObjectTypeCustomField.GetDefault(session, DefaultObjectTypeCustomFieldEnum.RECEIPT_VOUCHER_SALE_INVOICE); var relatedObjectList = objectBO.FindCMSObjectsOfBuiltInCustomField( session, objectTypeCustomField.ObjectTypeCustomFieldId, billIds); if (relatedObjectList == null) { return(null); } var relatedObjectIdList = relatedObjectList.Select(r => r.ObjectId); CriteriaOperator criteria = CriteriaOperator.And( new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE, BinaryOperatorType.GreaterOrEqual), new ContainsOperator("TransactionObjects", new InOperator("ObjectId.ObjectId", relatedObjectIdList))); ret = new XPCollection <Transaction>(session, new XPCollection <ReceiptVouchesTransaction>(session), criteria); return(ret); } catch (Exception) { throw; } }
protected void Grid_LegalInvoiceArtifactType_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { { string[] m = { "Code", "Name", "Category" }; for (int i = 0; i < m.Length; i++) { if (e.Column.FieldName.Equals(m[i]) && Grid_LegalInvoiceArtifactType.IsEditing && !Grid_LegalInvoiceArtifactType.IsNewRowEditing) { SaleInvoiceArtiface saleId = session.FindObject <SaleInvoiceArtiface>( CriteriaOperator.And( new BinaryOperator("LegalInvoiceArtifactTypeId", e.KeyValue.ToString(), BinaryOperatorType.Equal), new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE, BinaryOperatorType.Equal) )); if (saleId != null) { e.Editor.ReadOnly = true; } } } } }
protected void comboInventory_ItemsRequestedByFilterCondition(object source, ListEditItemsRequestedByFilterConditionEventArgs e) { ASPxComboBox comboItemUnit = source as ASPxComboBox; XPCollection <Inventory> collection = new XPCollection <Inventory>(session); collection.SkipReturnedObjects = e.BeginIndex; collection.TopReturnedObjects = e.EndIndex - e.BeginIndex + 1; CriteriaOperator criteria = CriteriaOperator.And( CriteriaOperator.Or( new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like), new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like) ), new BinaryOperator("RowStatus", 1, BinaryOperatorType.GreaterOrEqual)); collection.Criteria = criteria; collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending)); comboItemUnit.DataSource = collection; comboItemUnit.DataBindItems(); }
protected CriteriaOperator GetFilterExpressionState(string filter) { //string filterString = CriteriaOperator op = CriteriaOperator.Parse(filterExpression, 0);; CriteriaOperator op = CriteriaOperator.Parse(filter, 0); var additionalFilter = AdditionalFilter(op, ListState.ViewType); if (additionalFilter != null) { if (op != null) { return(CriteriaOperator.And(additionalFilter, op)); //return op.CriteriaOperator.And(additionalFilter); } else { return(additionalFilter); } } return(op); }
private void Duyet_Execute(object sender, SimpleActionExecuteEventArgs e) { LanTangCa lanTangCa = (LanTangCa)View.CurrentObject; lanTangCa.ngayDuyet = DateTime.Today; lanTangCa.nguoiDuyet = lanTangCa.Session.GetObjectByKey <NguoiDung>(SecuritySystem.CurrentUserId); CriteriaOperator criteriaOperator = CriteriaOperator.And(CriteriaOperator.Parse("[nguoiChamCong] = ?", lanTangCa.nguoiTangCa), CriteriaOperator.Parse("[ngay.ngayChamCong] = ?", lanTangCa.ngayTangCa)); GioCong gio = ObjectSpace.FindObject <GioCong>(criteriaOperator); if (!Equals(gio, null)) { gio.soGioTangCa = lanTangCa.thoiGianTangCa; gio.ngayDuyet = lanTangCa.ngayDuyet; lanTangCa.gioCong = gio; } ObjectSpace.CommitChanges(); ObjectSpace.Refresh(); View.Refresh(); }
private void FilterLots() { CriteriaOperatorCollection lotViewCriteria = new CriteriaOperatorCollection(); if (fromLocationLookUpEdit.EditValue != null) { lotViewCriteria.Add(new BinaryOperator(LocationInventoryByLot.Fields.Location.Oid.PropertyName, Convert.ToInt32(fromLocationLookUpEdit.EditValue), BinaryOperatorType.Equal)); } autochange = true; lotViewCriteria.Add(new BinaryOperator(LocationInventoryByLot.Fields.LPNNumber.PropertyName, transferDetailsGridView.GetFocusedRowCellValue(fullLpnNumberGridColumn), BinaryOperatorType.Equal)); LotXpView.Criteria = CriteriaOperator.And(lotViewCriteria); LotXpView.Reload(); if (LotXpView.Count == 1) { transferDetailsGridView.SetFocusedRowCellValue(colTransferLot, LotXpView[0]["Lot"]); } autochange = false; }
public bool checkTaxIsExistInItemTax(Session session, string code, out string relatedItemCode) { try { ItemTax itemtax = session.FindObject <ItemTax>(CriteriaOperator.And( new BinaryOperator("TaxId.Code", code, BinaryOperatorType.Equal), new BinaryOperator("RowStatus", 0, BinaryOperatorType.Equal)) ); if (itemtax != null) { relatedItemCode = itemtax.ItemId.Code; return(true); } relatedItemCode = string.Empty; return(false); } catch (Exception) { throw; } }
protected override void ApplyCriteriaCore(CriteriaOperator criteria) { var s = source as XPBaseCollection; if (s != null) { s.Filter = SourceCriteria; if (!object.Equals(criteria, null)) { if (object.Equals(s.Filter, null)) { s.Filter = criteria; } else { s.Filter = CriteriaOperator.And(criteria, s.Filter); } } } }
public CurrencyType get_currencyTypeId(Session session, string CurrencyTypeId, bool IsMaster, short RowStatus) { try { CurrencyType currencyType_ID = session.FindObject <CurrencyType>( CriteriaOperator.And( new BinaryOperator("CurrencyTypeId", CurrencyTypeId, BinaryOperatorType.Equal), new BinaryOperator("IsMaster", IsMaster, BinaryOperatorType.Equal), new BinaryOperator("RowStatus", RowStatus, BinaryOperatorType.Equal) )); if (currencyType_ID != null) { return(currencyType_ID); } return(null); } catch (Exception) { throw; } }
public bool CodeRuleDefinifionEditingNumberData_CRUD() { //Set data to input control //Guid selectedCodeRuleDataTypeId = Guid.Parse(cbCodeRuleDataType.SelectedItem.Value.ToString()); //CodeRuleNumberData codeRuleNumberData = // (CodeRuleNumberData)codeRuleDataBO.GetCodeRuleData(session, CodeRuleDefinitionId, selectedCodeRuleDataTypeId); //if (codeRuleNumberData != null) //{ // cbCodeRuleDataType.Value = // codeRuleNumberData.CodeRuleDataFormatId.CodeRuleDataTypeId.CodeRuleDataTypeId.ToString(); // SetCodeRuleDataFormatCriteria(); // spinBeginNumberValue.Number = codeRuleNumberData.BeginNumberValue; // spinStep.Number = codeRuleNumberData.Step; // spinEndNumberValue.Number = codeRuleNumberData.EndNumberValue; // cbCodeRuleDataFormat.Value = // codeRuleNumberData.CodeRuleDataFormatId.CodeRuleDataFormatId.ToString(); // cbRuleRepeaterType.Value = // codeRuleNumberData.RuleRepeaterTypeId.RuleRepeaterTypeId.ToString(); //} //else //{ // SetCodeRuleDataFormatCriteria(); //} SetCodeRuleDataFormatCriteria(); dsCodeRuleData.TypeName = typeof(CodeRuleNumberData).FullName; CriteriaOperator criteria = CriteriaOperator.And( new BinaryOperator("CodeRuleDataId", CodeRuleDataId), new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE) ); dsCodeRuleData.Criteria = criteria.ToString(); formlayoutCodeRuleDefinitionEditingForm.DataBind(); return(true); }
public string GetArtifactCode(Guid artifactCodeRuleId, bool isUpdateLastestWhenIsNumber) { UnitOfWork uow = null; string artifactCode = String.Empty; try { uow = XpoHelper.GetNewUnitOfWork(); CriteriaOperator criteria = CriteriaOperator.And( new BinaryOperator("ArtifactCodeRuleId.ArtifactCodeRuleId", artifactCodeRuleId), new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE), new UnaryOperator(UnaryOperatorType.IsNull, "ParentCodeRuleDefinitionId") ); XPCollection <CodeRuleDefinition> codeRuleDefinitions = new XPCollection <CodeRuleDefinition>(PersistentCriteriaEvaluationBehavior.InTransaction, uow, criteria, false); CodeRuleDefinition rootDefinition = codeRuleDefinitions.FirstOrDefault(); if (rootDefinition == null) { return(String.Empty); } else { artifactCode = GetCodeDefinition(uow, rootDefinition, isUpdateLastestWhenIsNumber); } uow.CommitChanges(); return(artifactCode); } catch (Exception) { throw; } finally { if (uow != null) { uow.Dispose(); } } }
protected void cboSupplierColumn_OnItemsRequestedByFilterCondition_SQL(object source, ListEditItemsRequestedByFilterConditionEventArgs e) { ASPxComboBox comboBox = (ASPxComboBox)source; //if (comboBox.IsCallback) { //Get SUPPLIER trading type //2013-11-03 ERP-872 Khoa.Truong MOD START TradingCategory supplierTradingCategory = NAS.DAL.Util.getXPCollection <TradingCategory>(session, "Code", "SUPPLIER").FirstOrDefault(); //XPCollection<NAS.DAL.Nomenclature.Organization.SupplierOrg> collection = new XPCollection<NAS.DAL.Nomenclature.Organization.SupplierOrg>(session); XPCollection <NAS.DAL.Nomenclature.Organization.Organization> collection = new XPCollection <NAS.DAL.Nomenclature.Organization.Organization>(session); collection.SkipReturnedObjects = e.BeginIndex; collection.TopReturnedObjects = e.EndIndex - e.BeginIndex + 1; //collection.Criteria = CriteriaOperator.Or( // new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like), // new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like) //); collection.Criteria = CriteriaOperator.And( CriteriaOperator.Or( new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like), new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like) ), new ContainsOperator("OrganizationCategories", CriteriaOperator.And( new BinaryOperator("TradingCategoryId.TradingCategoryId", supplierTradingCategory.TradingCategoryId), new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE) ) ), new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE) ); //2013-11-03 ERP-872 Khoa.Truong MOD END collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending)); comboBox.DataSource = collection; comboBox.DataBindItems(); //} }
public bool checkIsExistInItemUnit(Session session, Guid UnitId) { try { CriteriaOperator criteria = CriteriaOperator.And( new BinaryOperator("UnitId.UnitId", UnitId, BinaryOperatorType.Equal), new BinaryOperator("RowStatus", 0, BinaryOperatorType.Greater), new BinaryOperator("ItemId.RowStatus", 0, BinaryOperatorType.Greater) ); XPCollection <ItemUnit> itemUnit = new XPCollection <ItemUnit>(session, criteria); if (itemUnit == null || itemUnit.Count == 0) { return(false); } return(true); } catch (Exception) { throw; } }