Exemplo n.º 1
0
        private void PreparePermissionsGrid()
        {
            GridEXColumn colLevel = gridExUserPermissions.RootTable.Columns["Poziom"];

            colLevel.HasValueList = true;

            GridEXValueListItemCollection valuesCboLevel = colLevel.ValueList;

            valuesCboLevel.Add(0, "Brak");
            valuesCboLevel.Add(1, "Tylko odczyt");
            valuesCboLevel.Add(2, "Pełne");
        }
Exemplo n.º 2
0
        /// <summary>
        /// Load all villages from all polygons
        /// </summary>
        private void LoadPolygonData_Click(object sender, System.EventArgs e)
        {
            List <Polygon> polygons = World.Default.Map.Manipulators.PolygonManipulator.GetAllPolygons().ToList();

            if (!polygons.Any())
            {
                World.Default.Map.Manipulators.SetManipulator(ManipulatorManagerTypes.Polygon);
                MessageBox.Show(ControlsRes.PolygonControl_StartHelp, ControlsRes.PolygonControl_StartHelpTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            if (ModusPolygon.Enabled)
            {
                // BBCode export: load villages
                GridExVillage.RemoveFilters();
                World.Default.Map.EventPublisher.ActivatePolygon(this, polygons);
            }
            else
            {
                // Polygon management
                IEnumerable <string> groups = polygons.Select(x => x.Group).Distinct().OrderBy(x => x);
                var valueList = new GridEXValueListItemCollection();
                foreach (string group in groups)
                {
                    valueList.Add(group, group);
                }
                GridExPolygon.RootTable.Columns["GROUP"].EditValueList = valueList;

                GridExPolygon.DataSource = polygons;
                GridExPolygon.MoveFirst();
            }
        }
Exemplo n.º 3
0
        private void LoadScheduleTab()
        {
            GridEXColumn colCurrency = gridExSchedule.RootTable.Columns["WalutaId"];

            colCurrency.HasValueList = true;

            GridEXValueListItemCollection valuesCboCurrency = colCurrency.ValueList;

            List <Currency> lstCurrencies = CurrenciesRepo.GetAll();

            foreach (var currency in lstCurrencies)
            {
                valuesCboCurrency.Add(currency.Id, currency.Name);
            }

            colCurrency.EditType             = Janus.Windows.GridEX.EditType.DropDownList;
            colCurrency.CompareTarget        = Janus.Windows.GridEX.ColumnCompareTarget.Text;
            colCurrency.DefaultGroupInterval = Janus.Windows.GridEX.GroupInterval.Text;

            this.gridScheduleRepo.BindDataSet(gridExSchedule, agreement.Id);
        }
Exemplo n.º 4
0
        private void LoadLicensorsTab()
        {
            GridEXColumn colLicensor       = gridExLicensors.RootTable.Columns["LicencjodawcaId"];
            GridEXColumn colLicensorCareOf = gridExLicensors.RootTable.Columns["LicencjodawcaIdCareOf"];

            colLicensor.HasValueList       = true;
            colLicensorCareOf.HasValueList = true;

            GridEXValueListItemCollection valuesCboLicensor       = colLicensor.ValueList;
            GridEXValueListItemCollection valuesCboLicensorCareOf = colLicensorCareOf.ValueList;

            List <Licensor> lstLicensors = LicensorsRepo.GetAllForCombo();

            foreach (var licensor in lstLicensors)
            {
                valuesCboLicensor.Add(licensor.Id, licensor.Name);
                valuesCboLicensorCareOf.Add(licensor.Id, licensor.Name);
            }

            this.gridLicensorsRepo.BindDataSet(gridExLicensors, agreement.Id);
        }
Exemplo n.º 5
0
        private void FillCategoriesValueList()
        {
            //Get the CategoryID column
            GridEXColumn column = gridEX1.RootTable.Columns["CustomerID"];

            //Set HasValueList property equal to true in order to be able to use the ValueList property
            column.HasValueList = true;
            //Get the ValueList collection associated to this column
            GridEXValueListItemCollection valueList = column.ValueList;

            //Fill the ValueList
            //valueList.PopulateValueList(northwindDataSet.Customers.DefaultView,"CustomerID", "CompanyName");

            //An alternative way to fill the value list is using the Add method as follows:


            DataView view = northwindDataSet.Customers.DefaultView;

            foreach (DataRowView row in view)
            {
                valueList.Add(row["CustomerID"], (string)row["CompanyName"]);
            }



            //Setting other column related properties

            //When using a value list you could use DropDownList and Combo EditType
            //in the column and the values for the dropdown list will be the values
            //in the ValueList collection
            column.EditType = EditType.DropDownList;
            //To be able to sort using the replaced value and not the value in the
            //CategoryID field change the CompareTarget property to Text instead of value
            column.CompareTarget = ColumnCompareTarget.Text;

            //Likewise, to group by the replaced text do:
            column.DefaultGroupInterval = GroupInterval.Text;
        }
Exemplo n.º 6
0
        public static void LoadQuanHeGDText(GridEXValueListItemCollection vl, bool includeVoChong)
        {
            Dictionary <int, string> dicQH = Memory.GetQuanHeList(includeVoChong);

            foreach (var item in dicQH)
            {
                vl.Add(item.Key, item.Value);
            }

            /*
             * if (isLoadChaMe)
             * {
             *  vl.Add(0, "Chồng");
             *  vl.Add(1, "Vợ");
             * }
             * vl.Add(2, "Con");
             * vl.Add(3, "Cháu");
             * vl.Add(4, "Cha");
             * vl.Add(5, "Mẹ");
             * vl.Add(6, "Ông");
             * vl.Add(7, "Bà");
             * vl.Add(8, "Anh");
             * vl.Add(17, "Chị");
             * vl.Add(18, "Em");
             * vl.Add(19, "Dâu");
             * vl.Add(20, "Rể");
             * vl.Add(9, "Cô");
             * vl.Add(10, "Chú");
             * vl.Add(11, "Bác");
             * vl.Add(12, "Cậu");
             * vl.Add(13, "Dì");
             * vl.Add(14, "Mợ");
             * vl.Add(15, "Thím");
             * vl.Add(16, "Dượng");
             * vl.Add(100, "Chưa rõ");
             * */
        }
Exemplo n.º 7
0
        /// <summary>
        /// Load all villages from all polygons
        /// </summary>
        private void LoadPolygonData_Click(object sender, System.EventArgs e)
        {
            List<Polygon> polygons = World.Default.Map.Manipulators.PolygonManipulator.GetAllPolygons().ToList();
            if (!polygons.Any())
            {
                World.Default.Map.Manipulators.SetManipulator(ManipulatorManagerTypes.Polygon);
                MessageBox.Show(@"You have not yet defined any clusters.
            I have activated cluster drawing for you, you can go back to the main map and create some now!

            Click and hold left mouse button to start drawing!
            Or... Right click on the map for more help.", "No clusters!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            if (ModusPolygon.Enabled)
            {
                // BBCode export: load villages
                GridExVillage.RemoveFilters();
                World.Default.Map.EventPublisher.ActivatePolygon(this, polygons);
            }
            else
            {
                // Polygon management
                IEnumerable<string> groups = polygons.Select(x => x.Group).Distinct().OrderBy(x => x);
                var valueList = new GridEXValueListItemCollection();
                foreach (string group in groups)
                {
                    valueList.Add(group, group);
                }
                GridExPolygon.RootTable.Columns["GROUP"].EditValueList = valueList;

                GridExPolygon.DataSource = polygons;
                GridExPolygon.MoveFirst();
            }
        }
Exemplo n.º 8
0
 public static void LoadQuanHeGDText(GridEXValueListItemCollection vl, bool isLoadChaMe)
 {
     if (isLoadChaMe)
     {
         vl.Add(0, "Chồng");
         vl.Add(1, "Vợ");
     }
     vl.Add(2, "Con");
     vl.Add(3, "Cháu");
     vl.Add(4, "Cha");
     vl.Add(5, "Mẹ");
     vl.Add(6, "Ông");
     vl.Add(7, "Bà");
     vl.Add(8, "Anh");
     vl.Add(17, "Chị");
     vl.Add(18, "Em");
     vl.Add(19, "Dâu");
     vl.Add(20, "Rể");
     vl.Add(9, "Cô");
     vl.Add(10, "Chú");
     vl.Add(11, "Bác");
     vl.Add(12, "Cậu");
     vl.Add(13, "Dì");
     vl.Add(14, "Mợ");
     vl.Add(15, "Thím");
     vl.Add(16, "Dượng");
     vl.Add(100, "Chưa rõ");
 }