Exemplo n.º 1
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õ");
 }
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
 public static string findQuanHeText(GridEXValueListItemCollection dicQuanHe, int vaiTro)
 {
     for (int i = 0; i < dicQuanHe.Count; i++)
     {
         if ((int)dicQuanHe[i].Value == vaiTro)
         {
             return(dicQuanHe[i].Text);
         }
     }
     return("");
 }
Exemplo n.º 4
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.º 5
0
        private void WorldEventPublisher_SettingsLoaded(object sender, EventArgs e)
        {
            EnemyMarker.SetMarker(World.Default.Map.MarkerManager.EnemyMarkerSettings);
            AbandonedMarker.SetMarker(World.Default.Map.MarkerManager.AbandonedMarkerSettings);

            var viewsList = new GridEXValueListItemCollection();

            string[] viewItems = World.Default.Views.GetBackgroundViews(false).ToArray();
            viewsList.AddRange(viewItems.Select(x => new GridEXValueListItem(x, x)).ToArray());
            MarkersGrid.RootTable.Columns["View"].EditValueList = viewsList;
            MarkersGrid.RootTable.Columns["View"].DefaultValue  = viewItems.FirstOrDefault();

            SetMarkersGridDataSource();
        }
Exemplo n.º 6
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.º 7
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.º 8
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.º 9
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.º 10
0
 public static void LoadQuanHeGDText(GridEXValueListItemCollection vl)
 {
     LoadQuanHeGDText(vl, false);
 }
Exemplo n.º 11
0
        public static int InSoGiaDinh(int maGiaDinh)
        {
            #region For GiaoXu
            DataTable tblGiaoXu = Memory.GetData(SqlConstants.SELECT_GIAOXU);
            if (Memory.ShowError())
            {
                return(-1);
            }
            if (tblGiaoXu.Rows.Count == 0)
            {
                MessageBox.Show("Không tìm thấy thông tin giáo xứ. Vui lòng nhập thông tin giáo xứ trước khi sử dụng chức năng này.");
                return(-1);
            }
            tblGiaoXu.TableName = GiaoXuConst.TableName;
            #endregion

            #region For GiaDinh
            DataTable tblGiaDinh = Memory.GetData(SqlConstants.SELECT_GIADINH_THEO_ID, new object[] { maGiaDinh });
            if (Memory.ShowError() || tblGiaDinh == null || tblGiaDinh.Rows.Count == 0)
            {
                MessageBox.Show("Không tìm thấy thông tin gia đình.\r\nXuất sổ gia đình thất bại.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(-1);
            }
            if ((bool)tblGiaDinh.Rows[0][GiaDinhConst.DaChuyenXu] == true)
            {
                MessageBox.Show("Gia đình này đã chuyển xứ.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(-1);
            }
            tblGiaDinh.TableName = GiaDinhConst.TableName;
            #endregion

            #region For ThanhVienGiaDinh
            string    sql = string.Format(SqlConstants.SELECT_THANHVIEN_GIADINH, SqlConstants.SELECT_GIAODAN_LIST_CO_GIAOHO);
            DataTable tblThanhVienGiaDinh = Memory.GetData(sql + " AND ThanhVienGiaDinh.MaGiaDinh = ? ORDER BY ThanhVienGiaDinh.VaiTro, GiaoDan.NamSinh", new object[] { maGiaDinh });

            if (Memory.ShowError() || tblThanhVienGiaDinh == null)
            {
                MessageBox.Show("Không lấy được thông tin các thành viên trong gia đình.\r\nXuất sổ gia đình thất bại.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(-1);
            }

            if (tblThanhVienGiaDinh.Rows.Count == 0)
            {
                MessageBox.Show("Gia đình này không có thành viên nào.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return(-1);
            }

            //tblThanhVienGiaDinh.Columns.Add(ReportSoGiaDinhConst.DaQuaDoiR, typeof(string));
            tblThanhVienGiaDinh.Columns.Add(ReportSoGiaDinhConst.QuanHeR, typeof(string));
            tblThanhVienGiaDinh.Columns.Add(HonPhoiConst.NgayHonPhoi, typeof(string));
            tblThanhVienGiaDinh.Columns.Add(HonPhoiConst.NoiHonPhoi, typeof(string));

            tblThanhVienGiaDinh.TableName = GiaoDanConst.TableName;

            GridEXValueListItemCollection dicQuanHe = new GridEXValueListItemCollection();
            LoadQuanHeGDText(dicQuanHe, true);

            foreach (DataRow row in tblThanhVienGiaDinh.Rows)
            {
                //row[ReportSoGiaDinhConst.DaQuaDoiR] = ((bool)row[GiaoDanConst.QuaDoi] == false) ? "" : "X";
                if (((int)row[ThanhVienGiaDinhConst.VaiTro] == 0 || (int)row[ThanhVienGiaDinhConst.VaiTro] == 1) &&
                    (bool)row[ThanhVienGiaDinhConst.ChuHo] == true)
                {
                    row[ReportSoGiaDinhConst.QuanHeR] = "Chủ hộ";
                }
                else
                {
                    row[ReportSoGiaDinhConst.QuanHeR] = findQuanHeText(dicQuanHe, (int)row[ThanhVienGiaDinhConst.VaiTro]);
                }
                if ((bool)row[GiaoDanConst.DaCoGiaDinh])
                {
                    setThongTinHonPhoi(row);
                }
            }
            #endregion

            DataSet DataObj = new DataSet();
            DataObj.Tables.Add(tblGiaoXu);
            DataObj.Tables.Add(tblThanhVienGiaDinh);
            DataObj.Tables.Add(tblGiaDinh);
            ExcelReport.ReportSoGiaDinh.Export(DataObj);
            Memory.ShowError();
            return(0);
        }
Exemplo n.º 12
0
        private void frmGiaDinh_Load(object sender, EventArgs e)
        {
            choNhapMaRieng = (Memory.GetConfig(GxConstants.CF_TUNHAP_MAGIADINH) == GxConstants.CF_TRUE);

            //handle events
            this.txtNguoiChong.OnSelected += new System.EventHandler(this.txtNguoiChong_OnSelected);
            this.txtNguoiVo.OnSelected    += new System.EventHandler(this.txtNguoiVo_OnSelected);

            #region format grid start
            gxGiaoDanList1.FormatGrid();
            gxGiaoDanList1.AllowEdit = InheritableBoolean.True;
            foreach (GridEXColumn col in gxGiaoDanList1.RootTable.Columns)
            {
                col.EditType = EditType.NoEdit;
            }

            GridEXColumn colQuanHe = new GridEXColumn();
            colQuanHe.HasValueList   = true;
            colQuanHe.Width          = 80;
            colQuanHe.EditType       = EditType.DropDownList;
            colQuanHe.FilterEditType = FilterEditType.Combo;
            colQuanHe.BoundMode      = ColumnBoundMode.Bound;
            colQuanHe.DataMember     = ThanhVienGiaDinhConst.VaiTro;
            colQuanHe.Key            = ThanhVienGiaDinhConst.VaiTro;
            colQuanHe.Caption        = "Quan hệ GĐ";
            GridEXValueListItemCollection vl = colQuanHe.ValueList;
            GxGiaDinhList.LoadQuanHeGDText(vl);
            gxGiaoDanList1.RootTable.Columns.Insert(0, colQuanHe);

            gxGiaoDanList1.RootTable.Columns[GiaoDanConst.DienThoai].Visible = false;
            #endregion format grid end

            if (this.operation == GxOperation.ADD)
            {
                id = Memory.Instance.GetNextId(GiaDinhConst.TableName, GiaDinhConst.MaGiaDinh, true);
                gxCommand1.Button1.Visible = false;
            }
            else
            {
                gxCommand1.Button1.Visible = true;
                if (this.Operation == GxOperation.VIEW)
                {
                    gxCommand1.OKButton.Visible     = false;
                    gxCommand1.Button1.Visible      = false;
                    gxGiaoDanList1.AllowEditGiaoDan = false;
                }
            }

            string sql = string.Format(SqlConstants.SELECT_THANHVIEN_GIADINH, SqlConstants.SELECT_GIAODAN_LIST_CO_GIAOHO);
            gxGiaoDanList1.LoadData(sql + " AND ThanhVienGiaDinh.MaGiaDinh = ? AND ThanhVienGiaDinh.VaiTro <> 0 AND ThanhVienGiaDinh.VaiTro <> 1 ORDER BY ThanhVienGiaDinh.VaiTro, GiaoDan.NamSinh", new object[] { id });
            tblChaMe = Memory.GetData(sql + " AND ThanhVienGiaDinh.MaGiaDinh = ? AND ThanhVienGiaDinh.VaiTro <= 1", new object[] { id });
            if (!Memory.ShowError())
            {
                tblChaMe.TableName = ThanhVienGiaDinhConst.TableName;
            }
            txtMaGiaDinh.Text = id.ToString();

            if (choNhapMaRieng)
            {
                txtMaGiaDinh.Visible       = false;
                txtMaGiaDinhRieng.Location = txtMaGiaDinh.Location;
                txtMaGiaDinhRieng.Visible  = true;
            }
            else
            {
                txtMaGiaDinh.Visible      = true;
                txtMaGiaDinhRieng.Visible = false;
            }

            isLoaded = true;
        }
Exemplo n.º 13
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.º 14
0
        private void WorldEventPublisher_SettingsLoaded(object sender, EventArgs e)
        {
            EnemyMarker.SetMarker(World.Default.Map.MarkerManager.EnemyMarkerSettings);
            AbandonedMarker.SetMarker(World.Default.Map.MarkerManager.AbandonedMarkerSettings);

            var viewsList = new GridEXValueListItemCollection();
            string[] viewItems = World.Default.Views.GetBackgroundViews(false).ToArray();
            viewsList.AddRange(viewItems.Select(x => new GridEXValueListItem(x, x)).ToArray());
            MarkersGrid.RootTable.Columns["View"].EditValueList = viewsList;
            MarkersGrid.RootTable.Columns["View"].DefaultValue = viewItems.FirstOrDefault();

            SetMarkersGridDataSource();
        }