protected void PatientListGridView_CellEditorInitialize(object sender, DevExpress.Web.ASPxGridViewEditorEventArgs e)
 {
     try
     {
         e.Editor.ReadOnly = false;
         if (e.Column.Name == "colPrimaryPhysician")
         {
             ASPxComboBox cmb = e.Editor as ASPxComboBox;
             if (Session["PhysicianDS"] != null)
             {
                 cmb.DataSource = Session["PhysicianDS"];
                 cmb.DataBindItems();
             }
             else
             {
                 GetPhysicianList();
                 cmb.DataSource = Session["PhysicianDS"];
                 cmb.DataBindItems();
             }
         }
     }
     catch (Exception ex)
     {
         CommonHelpers.writeLogToFile("PatientListGridView_CellEditorInitialize: PatientList.aspx", ex.Message);
     }
 }
 protected void gvAssignedQuestionnaire_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e)
 {
     try
     {
         e.Editor.ReadOnly = false;
         if (e.Column.Name == "colQuestionnaireName")
         {
             ASPxComboBox cmb = e.Editor as ASPxComboBox;
             if (Session["QuestionnaireDS"] != null)
             {
                 cmb.DataSource = Session["QuestionnaireDS"];
                 cmb.DataBindItems();
             }
             else
             {
                 GetQuestionnaireList();
                 cmb.DataSource = Session["QuestionnaireDS"];
                 cmb.DataBindItems();
             }
         }
     }
     catch (Exception ex)
     {
         CommonHelpers.writeLogToFile("gvAssignedQuestionnaire_CellEditorInitialize: PatientList.aspx", ex.Message);
     }
 }
Ejemplo n.º 3
0
    protected void dxcbocompany_ItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e)
    {
        ASPxComboBox _combo = (ASPxComboBox)source;

        Int32 _id = 0;

        //if (Page.Session["user"] != null) //if publiship user allow filter to be used otherwise filter null
        //{
        //    Int32 _companyid = wwi_func.vint(((UserClass)Page.Session["user"]).CompanyId.ToString());
        //    if (_companyid == -1)
        //    {
        if (e.Value != null)
        {
            _id = wwi_func.vint(e.Value.ToString());
        }

        //use datareaders - much faster than loading into collections
        string[] _cols = { "CompanyID, CompanyName", "Address1", "Address2", "Address3", "CountryName", "TelNo", "Customer", "CountryID" };

        //SubSonic.SqlQuery _query = DAL.Logistics.DB.Select(_cols).From(DAL.Logistics.Tables.NameAndAddressBook).WhereExpression("CompanyID").IsEqualTo(_id);
        SubSonic.SqlQuery _query = DAL.Logistics.DB.Select(_cols).From("view_delivery_address").WhereExpression("CompanyID").IsEqualTo(_id);

        IDataReader _rd = _query.ExecuteReader();

        _combo.DataSource = _rd;
        _combo.ValueField = "CompanyID";
        _combo.ValueType  = typeof(int);
        _combo.TextField  = "CompanyName";
        _combo.DataBindItems();
        //  }
        //}
    }
Ejemplo n.º 4
0
    protected void bind_destination_controller(int countryId)
    {
        ASPxComboBox _combo = (ASPxComboBox)this.fmvAddresses.FindControl("dxcboDestinationPortControllerIDEdit");

        if (_combo != null)
        {
            string[] _cols  = { "EmployeesTable.EmployeeID, EmployeesTable.Name", "EmployeesTable.DepartmentID", "OfficeTable.OfficeID" };
            string[] _order = { "Name" };
            //don't need nameandaddressbook as get countryid from officetable
            //SqlQuery _qry = new Select(_cols).From(DAL.Logistics.Tables.EmployeesTable).
            //    InnerJoin(DAL.Logistics.OfficeTable.OfficeIDColumn, DAL.Logistics.EmployeesTable.OfficeIDColumn).
            //    InnerJoin(DAL.Logistics.NameAndAddressBook.CountryIDColumn, DAL.Logistics.OfficeTable.CountryIDColumn);
            SqlQuery _qry = new Select(_cols).From(DAL.Logistics.Tables.EmployeesTable).
                            InnerJoin(DAL.Logistics.OfficeTable.OfficeIDColumn, DAL.Logistics.EmployeesTable.OfficeIDColumn);

            if (countryId > 0)
            {
                _qry.Where("CountryID").IsEqualTo(countryId);
            }

            _qry.And(DAL.Logistics.EmployeesTable.LiveColumn).IsEqualTo(1).OrderAsc(_order);
            //string _q = _qry.ToString(); //fo testing
            //DataTable _dt = _qry.ExecuteDataSet().Tables[0];  //for testing

            IDataReader _rd1 = _qry.ExecuteReader();
            _combo.DataSource = _rd1;
            _combo.ValueField = "EmployeeID";
            _combo.ValueType  = typeof(int);
            _combo.TextField  = "Name";
            _combo.DataBindItems();
        }
    }
Ejemplo n.º 5
0
        protected void comboPerson_ItemsRequestedByFilterCondition(object source, ListEditItemsRequestedByFilterConditionEventArgs e)
        {
            ASPxComboBox          combo      = source as ASPxComboBox;
            XPCollection <Person> collection = new XPCollection <Person>(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),
                CriteriaOperator.Or(
                    //find code contains the filter
                    new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like),
                    //find name contains the filter
                    new BinaryOperator("Name", 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();
        }
 protected void Comuna(ASPxComboBox combo, int IdProvincia)
 {
     combo.DataSourceID = "dsComunaPor";
     dsComunaPor.SelectParameters["IdCiudad"].DefaultValue = IdProvincia.ToString();
     combo.DataBindItems();
     combo.Items.Insert(0, new ListEditItem("", null));
 }
Ejemplo n.º 7
0
        protected void cboLot_ItemsRequestedByFilterCondition(object source, ListEditItemsRequestedByFilterConditionEventArgs e)
        {
            int editRowIndex = grdSalesInvoice.EditingRowVisibleIndex;

            if (editRowIndex >= 0)
            {
                editItemUnitId = Guid.Parse(grdSalesInvoice.GetRowValues(editRowIndex, "ItemUnitId!Key").ToString());
            }

            ASPxComboBox       comboItemUnit = source as ASPxComboBox;
            XPCollection <Lot> collection    = new XPCollection <Lot>(session);

            collection.SkipReturnedObjects = e.BeginIndex;
            collection.TopReturnedObjects  = e.EndIndex - e.BeginIndex + 1;

            CriteriaOperator criteria = new GroupOperator(GroupOperatorType.Or, new CriteriaOperator[] {
                new GroupOperator(GroupOperatorType.And, new CriteriaOperator[] {
                    new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like),
                    new BinaryOperator("RowStatus", -1, BinaryOperatorType.Greater)
                }),
                new BinaryOperator("ItemUnitId.ItemUnitId", editItemUnitId, BinaryOperatorType.Equal)
            });

            collection.Criteria = criteria;
            collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending));

            comboItemUnit.DataSource = collection;
            comboItemUnit.DataBindItems();
        }
Ejemplo n.º 8
0
        void AccountItemsRequestedByFilterCondition(object source, ListEditItemsRequestedByFilterConditionEventArgs e)
        {
            ASPxComboBox comboItemUnit = source as ASPxComboBox;

            CriteriaOperator filter = new BinaryOperator("Code", "0", BinaryOperatorType.Equal);
            XPCollection <NAS.DAL.Accounting.AccountChart.Account> collection = new XPCollection <NAS.DAL.Accounting.AccountChart.Account>(session, filter);

            foreach (NAS.DAL.Accounting.AccountChart.Account account in AccountingBO.getNotParentAccountList(session))
            {
                collection.Add(account);
            }

            //collection.SkipReturnedObjects = e.BeginIndex;
            //collection.TopReturnedObjects = e.EndIndex - e.BeginIndex + 1;

            //CriteriaOperator 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 = criteria;
            //collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending));

            comboItemUnit.DataSource = collection;
            comboItemUnit.DataBindItems();
        }
Ejemplo n.º 9
0
    //end bind fcl lcl dll
    protected void bind_package_type()
    {
        try
        {
            string[] _cols  = { "PackageTypeID, PackageType" };
            string[] _order = { "PackageType" };
            SqlQuery _qry   = new Select(_cols).From(DAL.Logistics.Tables.PackageTypeTable).OrderAsc(_order);

            //order controller
            ASPxComboBox _cb = (ASPxComboBox)this.fmvShipment.FindControl("dxcboPackageTypeID");
            if (_cb != null)
            {
                IDataReader _rd1 = _qry.ExecuteReader();
                _cb.DataSource = _rd1;
                _cb.ValueType  = typeof(int);
                _cb.ValueField = "PackageTypeID";
                _cb.TextField  = "PackageType";
                _cb.DataBindItems();
            }
        }
        catch (Exception ex)
        {
            string _err = ex.Message.ToString();
            this.dxlblErr.Text          = _err;
            this.dxpnlErr.ClientVisible = true;
        }
    }
Ejemplo n.º 10
0
    /// <summary>
    /// make sure VALUETYPE is defined for all dll's or they will display value rather than text
    /// </summary>
    protected void bind_fcl_lcl()
    {
        string _path = AppDomain.CurrentDomain.BaseDirectory;

        _path += "xml\\ddl_items.xml";

        // pass _qryFilter to have keyword-filter RSS Feed
        // i.e. _qryFilter = XML -> entries with XML will be returned
        DataSet _ds = new DataSet();

        _ds.ReadXml(_path);
        DataView _dv = _ds.Tables[0].DefaultView;

        _dv.RowFilter = "ddls ='FCLLCL'";

        //Run time population of GridViewDataComboBoxColumn column with data
        ASPxComboBox _cb = (ASPxComboBox)this.fmvShipment.FindControl("dxcboFCLLCL");

        if (_cb != null)
        {
            _cb.DataSource = _dv;
            _cb.ValueType  = typeof(int);
            _cb.TextField  = "name";
            _cb.ValueField = "value";
            _cb.DataBindItems();
        }
    }
Ejemplo n.º 11
0
    protected void FillCombo_OLD_SYSTEM(ASPxComboBox cmb, string SYS_CODE)
    {
        try
        {
            if (string.IsNullOrEmpty(SYS_CODE)) return;
            string SQL = "";
            SQL = " SELECT  CTLT_SYS_USER_RIGHT.USER_RIGHT ROLE_ID";
            SQL += " ,SYS_CODE";
            SQL += " ,CTLT_USER_RIGHT.USER_RIGHT_DESC ROLE_NAME";
            SQL += " FROM CTLT_SYS_USER_RIGHT ";
            SQL += " LEFT JOIN CTLT_USER_RIGHT ON CTLT_USER_RIGHT.USER_RIGHT = CTLT_SYS_USER_RIGHT.USER_RIGHT";
            SQL += " WHERE SYS_CODE='" + SYS_CODE + "'";

            //string SQL = string.Format("select ROLE_ID,ROLE_NAME from ODS_SYSTEM_ROLE WHERE SYS_CODE='{0}' ORDER BY [ROLE_NAME]", SYS_CODE);
            SqlDataAdapter DA = new SqlDataAdapter(SQL, OPM_BL.DefaultConnectionString);
            DataTable DTRole = new DataTable();
            DA.Fill(DTRole);
            cmb.DataSource = DTRole;
            cmb.ValueField = "ROLE_ID";
            cmb.TextField = "ROLE_NAME";
            cmb.DataBindItems();

            //AccessDataSource2.FilterExpression = "  SYS_CODE='" + SYS_CODE + "'";
            //DataView dv = (DataView)AccessDataSource2.Select(DataSourceSelectArguments.Empty);
            //DataTable DT = dv.ToTable();
        }
        catch (Exception ex)
        {

        }
    }
        public override void ItemsRequestedByFilterCondition(DevExpress.Xpo.Session session, object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e)
        {
            ASPxComboBox combo = source as ASPxComboBox;
            XPCollection <InventoryCommand> collection = new XPCollection <InventoryCommand>(session);

            collection.SkipReturnedObjects = e.BeginIndex;
            collection.TopReturnedObjects  = e.EndIndex - e.BeginIndex + 1;

            //Get SUPPLIER trading type
            //TradingCategory supplierTradingCategory =
            //    session.FindObject<TradingCategory>(new BinaryOperator("Code", "SUPPLIER"));

            CriteriaOperator criteria = CriteriaOperator.And(
                //row status is active
                //CriteriaOperator.Or(
                new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE),
                //    new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_BOOKED_ENTRY)
                //),
                CriteriaOperator.Or(
                    //find code contains the filter
                    new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like),
                    //find name contains the filter
                    new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like)
                    ),
                new BinaryOperator("CommandType", 'I', BinaryOperatorType.Equal)
                );

            collection.Criteria = criteria;
            collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending));

            combo.DataSource = collection;
            combo.DataBindItems();
        }
Ejemplo n.º 13
0
        void comboItem_ItemsRequestedByFilterCondition(object source, ListEditItemsRequestedByFilterConditionEventArgs e)
        {
            UnitOfWork          uow        = XpoHelper.GetNewUnitOfWork();
            ASPxComboBox        comboItem  = source as ASPxComboBox;
            XPCollection <Item> collection = new XPCollection <Item>(uow);

            collection.SkipReturnedObjects = e.BeginIndex;
            collection.TopReturnedObjects  = e.EndIndex - e.BeginIndex + 1;

            CriteriaOperator criteria = null;

            criteria = CriteriaOperator.And(
                new ContainsOperator("ItemCustomTypes", new BinaryOperator("ObjectTypeId.Name",
                                                                           "PRODUCT")),
                new BinaryOperator("RowStatus", 0, BinaryOperatorType.Greater),
                CriteriaOperator.Or(
                    new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like),
                    new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like)));

            collection.Criteria = criteria;
            collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending));

            comboItem.DataSource = collection;
            comboItem.DataBindItems();
        }
Ejemplo n.º 14
0
        protected void dxGridColaborador_CellEditorInitialize(object sender, DevExpress.Web.ASPxGridViewEditorEventArgs e)
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("idCargo");
            dt.Columns.Add("cargo");


            ServicioColaborador.ServicioColaboradorClient sercivio_colaborador = new ServicioColaborador.ServicioColaboradorClient();



            DataTable dt2 = new DataTable();

            dt2.Columns.Add("idCargo");
            dt2.Columns.Add("cargo");

            if (e.Column.FieldName == "idCargo")
            {
                ASPxComboBox request = e.Editor as ASPxComboBox;
                request.ValueField = "idCargo";
                request.TextField  = "cargo";
                request.ValueType  = typeof(System.Int32);

                request.DataSource = sercivio_colaborador.ObtenerCargos();
                request.DataBindItems();
            }
        }
Ejemplo n.º 15
0
    protected void FillCombo(ASPxComboBox cmb, string SYS_CODE)
    {
        try
        {
            if (string.IsNullOrEmpty(SYS_CODE)) return;
            //AccessDataSource2.SelectParameters.Clear();
            ////string SQL = AccessDataSource2.SelectCommand;
            //AccessDataSource2.SelectCommand = " select SYS_CODE ,ROLE_ID,ROLE_NAME from ODS_SYSTEM_ROLE  ";
            //AccessDataSource2.SelectCommand = SQL;

            string SQL = string.Format("select ROLE_ID,ROLE_NAME from ODS_SYSTEM_ROLE WHERE SYS_CODE='{0}' ORDER BY [ROLE_NAME]", SYS_CODE);
            SqlDataAdapter DA = new SqlDataAdapter(SQL, OPM_BL.DefaultConnectionString);
            DataTable DTRole = new DataTable();
            DA.Fill(DTRole);
            cmb.DataSource = DTRole;
            cmb.ValueField = "ROLE_ID";
            cmb.TextField = "ROLE_NAME";
            cmb.DataBindItems();

            //AccessDataSource2.FilterExpression = "  SYS_CODE='" + SYS_CODE + "'";
            //DataView dv = (DataView)AccessDataSource2.Select(DataSourceSelectArguments.Empty);
            //DataTable DT = dv.ToTable();
        }
        catch (Exception ex)
        {

        }
    }
Ejemplo n.º 16
0
    /// <summary>
    /// destinatiobn controller
    /// </summary>
    /// <param name="source"></param>
    /// <param name="e"></param>
    protected void dxcboDestControl_ItemRequestedByValue(object source, ListEditItemRequestedByValueEventArgs e)
    {
        ASPxComboBox _combo            = (ASPxComboBox)source;
        ASPxComboBox _destinationagent = (ASPxComboBox)this.fmvAddresses.FindControl("dxcboAgentAtDestinationIDEdit");

        if (_combo != null)
        {
            string[] _cols  = { "EmployeesTable.EmployeeID, EmployeesTable.Name", "EmployeesTable.DepartmentID", "OfficeTable.OfficeID", " NameAndAddressBook.CompanyID" };
            string[] _order = { "Name" };
            SqlQuery _qry   = new Select(_cols).From(DAL.Logistics.Tables.EmployeesTable).
                              InnerJoin(DAL.Logistics.OfficeTable.OfficeIDColumn, DAL.Logistics.EmployeesTable.OfficeIDColumn).
                              InnerJoin(DAL.Logistics.NameAndAddressBook.CountryIDColumn, DAL.Logistics.OfficeTable.CountryIDColumn);

            if (_destinationagent != null && _destinationagent.SelectedItem != null && _destinationagent.Value != null)
            {
                int _filter = wwi_func.vint(_destinationagent.SelectedItem.GetValue("CountryID").ToString());
                if (_filter > 0)
                {
                    _qry.Where("CountryID").IsEqualTo(_filter);
                }
            }

            _qry.And(DAL.Logistics.EmployeesTable.LiveColumn).IsEqualTo(true).OrderAsc(_order);

            DataTable   _dt  = _qry.ExecuteDataSet().Tables[0];
            IDataReader _rd1 = _qry.ExecuteReader();
            _combo.DataSource = _rd1;
            _combo.ValueField = "EmployeeID";
            _combo.ValueType  = typeof(int);
            _combo.TextField  = "Name";
            _combo.DataBindItems();
        }
    }
Ejemplo n.º 17
0
        protected void cboLegalInvoiceArtifactType_ItemsRequestedByFilterCondition(object source, ListEditItemsRequestedByFilterConditionEventArgs e)
        {
            try
            {
                ASPxComboBox comboItemUnit = source as ASPxComboBox;
                XPCollection <NAS.DAL.Accounting.LegalInvoice.LegalInvoiceArtifactType> collection = new XPCollection <NAS.DAL.Accounting.LegalInvoice.LegalInvoiceArtifactType>(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("Description", "F", BinaryOperatorType.NotEqual),
                    new BinaryOperator("RowStatus", 1, BinaryOperatorType.GreaterOrEqual),
                    new BinaryOperator("Category", m_VatType, BinaryOperatorType.Equal));


                collection.Criteria = criteria;
                collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending));

                comboItemUnit.DataSource = collection;
                comboItemUnit.DataBindItems();
            }
            catch
            {
            }
        }
Ejemplo n.º 18
0
        public void ItemsRequestedByFilterCondition(Session session, object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e)
        {
            ASPxComboBox combo = source as ASPxComboBox;
            XPCollection <Department> collection = new XPCollection <Department>(session);

            collection.SkipReturnedObjects = e.BeginIndex;
            collection.TopReturnedObjects  = e.EndIndex - e.BeginIndex + 1;

            CriteriaOperator criteria = CriteriaOperator.And(
                //row status is active
                new BinaryOperator("OrganizationId.OrganizationId", Utility.CurrentSession.Instance.AccessingOrganizationId),
                new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE),
                CriteriaOperator.Or(
                    //find code contains the filter
                    new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like),
                    //find name contains the filter
                    new BinaryOperator("Name", 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();
        }
Ejemplo n.º 19
0
    /// <summary>
    /// rebind contact list when company is changed
    /// </summary>
    /// <param name="companyID">passed from comapny combo</param>
    protected void bind_client_contact(string companyID)
    {
        //must have a filter or display nothing
        if (!string.IsNullOrEmpty(companyID))
        {
            ASPxComboBox _dxcboContact = (ASPxComboBox)this.dxgrdCourier.FindEditFormTemplateControl("dxcboClientContact");
            if (_dxcboContact != null)
            {
                string[] _cols  = { "ContactID, ContactName", "Email" };
                string[] _order = { "ContactName" };
                SqlQuery _qry   = new Select(_cols).From(DAL.Logistics.Tables.ContactTable).OrderAsc(_order);

                int _filter = -1;
                if (!string.IsNullOrEmpty(companyID))
                {
                    _filter = wwi_func.vint(companyID);
                    if (_filter > 0)
                    {
                        _qry.Where("CompanyID").IsEqualTo(_filter);
                    }
                }

                IDataReader _rd1 = _qry.ExecuteReader();
                _dxcboContact.DataSource = _rd1;
                _dxcboContact.ValueField = "ContactID";
                _dxcboContact.TextField  = "ContactName";
                _dxcboContact.DataBindItems();
            }
        }
    }
Ejemplo n.º 20
0
        protected void cboItem_ItemsRequestedByFilterCondition(object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e)
        {
            try
            {
                ASPxComboBox            comboItemUnit = source as ASPxComboBox;
                XPCollection <BillItem> collection    = new XPCollection <BillItem>(session);

                collection.SkipReturnedObjects = e.BeginIndex;
                collection.TopReturnedObjects  = e.EndIndex - e.BeginIndex + 1;

                CriteriaOperator criteria = CriteriaOperator.And(
                    CriteriaOperator.Or(
                        new BinaryOperator("ItemUnitId.ItemId.Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like),
                        new BinaryOperator("ItemUnitId.ItemId.Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like)
                        ),
                    new BinaryOperator("BillId.BillId", bill.BillId, BinaryOperatorType.Equal));


                collection.Criteria = criteria;
                collection.Sorting.Add(new SortProperty("ItemUnitId.ItemId.Code", DevExpress.Xpo.DB.SortingDirection.Ascending));

                comboItemUnit.DataSource = collection;
                comboItemUnit.DataBindItems();
            }
            catch
            {
            }
        }
 protected void Concepto(ASPxComboBox combo, int DescDetalle)
 {
     combo.DataSourceID = "dsConceptoPagoPor";
     dsConceptoPagoPor.SelectParameters["IdDetalle"].DefaultValue = DescDetalle.ToString();
     combo.DataBindItems();
     combo.Items.Insert(0, new ListEditItem("", null));
 }
        public override void ComboBoxItem_ItemsRequestedByFilterCondition(DevExpress.Xpo.Session session, object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e)
        {
            ASPxComboBox        combo      = source as ASPxComboBox;
            XPCollection <Item> collection = new XPCollection <Item>(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),
                CriteriaOperator.Or(
                    //find code contains the filter
                    new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like),
                    //find name contains the filter
                    new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like)
                    ),
                new ContainsOperator("ItemCustomTypes",
                                     new BinaryOperator("ObjectTypeId", ObjectType.GetDefault(session, ObjectTypeEnum.FIXED_ASSETS)))
                );

            collection.Criteria = criteria;
            collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending));

            combo.DataSource = collection;
            combo.DataBindItems();
        }
Ejemplo n.º 23
0
        protected void cboAccountPeriod_ItemsRequestedByFilterCondition(object source, ListEditItemsRequestedByFilterConditionEventArgs e)
        {
            ASPxComboBox combo = source as ASPxComboBox;
            XPCollection <AccountingPeriod> collection = new XPCollection <AccountingPeriod>(session);

            collection.SkipReturnedObjects = e.BeginIndex;
            collection.TopReturnedObjects  = e.EndIndex - e.BeginIndex + 1;

            AccountingPeriodTypeBO typeBO = new AccountingPeriodTypeBO();
            AccountingPeriodType   minAccountingPeriodType = typeBO.GetMinAccountingPeriodType(session);

            CriteriaOperator criteria_RowStatus = new BinaryOperator("RowStatus", Constant.ROWSTATUS_ACTIVE, BinaryOperatorType.GreaterOrEqual);
            CriteriaOperator criteria_IsActive  = new BinaryOperator("IsActive", true, BinaryOperatorType.Equal);
            CriteriaOperator criteria_Type      = new BinaryOperator("AccountingPeriodTypeId", minAccountingPeriodType, BinaryOperatorType.Equal);
            CriteriaOperator criteria           = CriteriaOperator.And(criteria_IsActive, criteria_RowStatus, criteria_Type);
            XPCollection <AccountingPeriod> AccountingPeriodCol = new XPCollection <AccountingPeriod>(session, criteria);

            criteria = CriteriaOperator.And(
                CriteriaOperator.Or(
                    new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like),
                    new BinaryOperator("Description", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like)
                    ),
                new BinaryOperator("RowStatus", 1, BinaryOperatorType.GreaterOrEqual),
                new InOperator("this", AccountingPeriodCol)
                );

            collection.Criteria = criteria;
            collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending));

            combo.DataSource = collection;
            combo.DataBindItems();
        }
Ejemplo n.º 24
0
        protected void cboBalanceInitAccount_ItemsRequestedByFilterCondition(object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e)
        {
            ASPxComboBox           comboItemUnit = source as ASPxComboBox;
            XPCollection <Account> collection    = new XPCollection <Account>(session);

            collection.SkipReturnedObjects = e.BeginIndex;
            collection.TopReturnedObjects  = e.EndIndex - e.BeginIndex + 1;

            XPCollection <Account> _childAccount = AccountingBO.getNotParentAccountCollection(session);
            CriteriaOperator       _filter       = CriteriaOperator.Or(
                new BinaryOperator("AccountTypeId.AccountCategoryId.AccountCategoryId", Guid.Parse("A5FD76BB-F0D8-40F5-ADF8-6648804BDC62"), BinaryOperatorType.Equal),
                new BinaryOperator("AccountTypeId.AccountCategoryId.AccountCategoryId", Guid.Parse("387208A7-8D9E-49DA-8131-A83BA97B9D6B"), BinaryOperatorType.Equal),
                new BinaryOperator("AccountTypeId.AccountCategoryId.AccountCategoryId", Guid.Parse("FF561A7E-00D8-4596-B46A-29064BCB09D2"), BinaryOperatorType.Equal),
                new BinaryOperator("AccountTypeId.AccountCategoryId.AccountCategoryId", Guid.Parse("C1EC8F33-C4F6-4312-AE4A-6F8FD3A1F5DB"), BinaryOperatorType.Equal));

            _childAccount.Filter = _filter;

            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),
                new InOperator("this", _childAccount)
                );

            collection.Criteria = criteria;
            collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending));

            comboItemUnit.DataSource = collection;
            comboItemUnit.DataBindItems();
        }
Ejemplo n.º 25
0
    /// <summary>
    /// destination port combo filtered by VoyageID
    /// </summary>
    /// <param name="voyageid">from voyage combobox int</param>
    protected void bind_destination_port(int voyageId)
    {
        ASPxComboBox _combo = (ASPxComboBox)this.fmvBol.FindControl("dxcboDestinationPort");

        if (_combo != null)
        {
            IDataReader _rd = null;

            if (voyageId > 0)
            {
                string[] _cols  = { "PortTable.PortID", "PortTable.PortName", "VoyageETASubTable.ETA" };
                string[] _order = { "PortName" };

                SqlQuery _qry = new Select(_cols).From(DAL.Logistics.Tables.VoyageTable).
                                InnerJoin(DAL.Logistics.VoyageETASubTable.VoyageIDColumn, DAL.Logistics.VoyageTable.VoyageIDColumn).
                                InnerJoin(DAL.Logistics.PortTable.PortIDColumn, DAL.Logistics.VoyageETASubTable.DestinationPortIDColumn);


                _qry.Where(DAL.Logistics.VoyageTable.VoyageIDColumn).IsEqualTo(voyageId);
                _rd = _qry.ExecuteReader();
            }
            //rebind dest ports
            _combo.DataSource = _rd;
            _combo.ValueField = "PortID";
            _combo.ValueType  = typeof(int);
            _combo.TextField  = "PortName";
            _combo.DataBindItems();
        }
    }
Ejemplo n.º 26
0
        protected void grdGeneralJournal_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e)
        {
            if (e.Column.FieldName.Equals("Description"))
            {
                e.Editor.Focus();
            }
            else if (e.Column.FieldName.Equals("AccountId!Key"))
            {
                ASPxComboBox accountComboBox = (ASPxComboBox)e.Editor;
                if (accountComboBox != null)
                {
                    var accountList = AccountingBO.getNotParentAccountList(session);
                    accountComboBox.DataSource = accountList;
                    accountComboBox.DataBindItems();
                }
            }
            //if (e.Column.FieldName.Equals("AccountId!Key"))
            //{
            //    try
            //    {
            //        ASPxComboBox accountCombobox = e.Editor as ASPxComboBox;
            //        if (accountCombobox != null)
            //        {
            //            accountCombobox.ItemsRequestedByFilterCondition += new ListEditItemsRequestedByFilterConditionEventHandler(accountCombobox_ItemsRequestedByFilterCondition);
            //            accountCombobox.ItemRequestedByValue += new ListEditItemRequestedByValueEventHandler(accountCombobox_ItemRequestedByValue);
            //        }
            //    }
            //    catch (Exception ex)
            //    {

            //    }
            //}
        }
Ejemplo n.º 27
0
    protected void bind_permission_levels()
    {
        string _path = AppDomain.CurrentDomain.BaseDirectory;

        _path += "xml\\ddl_items.xml";

        // pass _qryFilter to have keyword-filter RSS Feed
        // i.e. _qryFilter = XML -> entries with XML will be returned
        DataSet _ds = new DataSet();

        _ds.ReadXml(_path);
        DataView _dv = _ds.Tables[0].DefaultView;

        _dv.RowFilter = "ddls ='contact_permission'";

        ASPxComboBox _cbo = (ASPxComboBox)this.fmvContact.FindControl("dxcboPermission");

        if (_cbo != null)
        {
            _cbo.DataSource = _dv;
            _cbo.ValueType  = typeof(int);
            _cbo.TextField  = "name";
            _cbo.ValueField = "value";
            _cbo.DataBindItems(); //use datbibditems rather than databind when binding to dataview
        }
    }
        public static ASPxComboBox ApplyDataSource(this ASPxComboBox source, IEnumerable dataSource)
        {
            source.DataSource = dataSource;
            source.DataBindItems();

            return(source);
        }
        public static ASPxComboBox ApplyCBDataSource <T>(this ASPxComboBox source, IEnumerable <T> dataSource) where T : class
        {
            source.SetComboBoxDataSource(dataSource);
            source.DataBindItems();

            return(source);
        }
Ejemplo n.º 30
0
 protected void FillSectionCombo(ASPxComboBox cmb, string SiteID)
 {
     if (SiteID == "0") return;
     cmb.DataSourceID = "ObjectDataSourceSection";
     ObjectDataSourceSection.SelectParameters[0].DefaultValue = SiteID;
     cmb.DataBindItems();
     cmb.Items.Insert(0, new ListEditItem("", null)); // Null Item
 }
Ejemplo n.º 31
0
    void cmbChild_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
    {
        ASPxComboBox     cmbChild = (ASPxComboBox)sender;
        AccessDataSource cmbChildAccessDataSource = (AccessDataSource)cmbChild.NamingContainer.FindControl("asdChild");

        cmbChildAccessDataSource.SelectParameters[0].DefaultValue = e.Parameter;
        cmbChild.DataBindItems();
    }
Ejemplo n.º 32
0
    protected void FillCitiesComboBox(ASPxComboBox combo, int countryID)
    {
        combo.DataSourceID = "Cities";
        Cities.SelectParameters["CountryID"].DefaultValue = countryID.ToString();
        combo.DataBindItems();

        combo.Items.Insert(0, new ListEditItem("", null)); // Null Item
    }
 private void comboboxAllocation_DataBind(ASPxComboBox combobox)
 {
     if (AllocationGetter == null)
     {
         throw new Exception("Please use SetAllocationGetter method to set AllocationGetter");
     }
     combobox.DataSource = AllocationGetter.GetAllocationCollection(session);
     combobox.DataBindItems();
 }
Ejemplo n.º 34
0
        /// <summary>
        /// Binds the DataTable to ComboBox list with given value and text fields
        /// </summary>
        /// <param name="cmbBox">Name of the ComboBox list to process</param>
        /// <param name="dt">DataTable to Bind</param>
        /// <param name="strValue">Value field name as string</param>
        /// <param name="strText">Text fiels name as string</param>
        public static void BindDropDown(ASPxComboBox cmbBox, DataTable dt, string strValue, string strText)
        {
            // clsDataFunctionsBAL objFunctions = null;

            try
            {
                if (DataTableHasRows(dt))
                {
                    cmbBox.DataSource = dt;
                    cmbBox.ValueField = strValue;
                    cmbBox.TextField = strText;
                    cmbBox.DataBindItems();
                }
            }
            catch (Exception ex)
            {
                //objFunctions = new clsDataFunctionsBAL();
                //objFunctions.SaveErrorLog(ex.Message, m_strModule, MethodBase.GetCurrentMethod().Name);
            }
            finally
            {
               // objFunctions = null;
            }
        }