public void bindchildgrd()
 {
     Grd.DataSource = ViewState["dt"] as DataTable;
     Grd.DataBind();
     Grd1.DataSource = ViewState["dt1"] as DataTable;
     Grd1.DataBind();
 }
Пример #2
0
 protected void btnThem_Click(object sender, EventArgs e)
 {
     Grd.AddNewRow();
     //cmbOrganization.TextField = "";
     //pcAddRoles.ShowOnPageLoad = true;
     //BindCMBOrganization();
 }
Пример #3
0
        protected void Grd_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            SYS_RoleOfUser sysRoleOfUser = new SYS_RoleOfUser();
            SYS_Roles      roles         = new SYS_Roles();

            roles.Name           = e.NewValues["Name"] + "";
            roles.IDOrganization = int.Parse(e.NewValues["IDOrganization"] + "");
            if (CheckRole(roles.Name))
            {
                throw new Exception(string.Format("Trùng tên đơn vị! Vui lòng chọn lại."));
            }
            try
            {
                if (CheckRole(roles.Name) == false)
                {
                    int RoleID = _ISYS_RolesService.InsertSYS_Roles(roles);
                    //sysRoleOfUser.RoleId = RoleID;
                    //sysRoleOfUser.UserId = (int)Session["UserId"];
                    //isyRoleOfUserService.InsertSYS_RoleOfUser(sysRoleOfUser);
                    _DataBind();
                    e.Cancel = true;
                    Grd.CancelEdit();
                    //WriteLog("Insert " + e.NewValues["Name"], Action.Create);
                }
                else
                {
                    throw new Exception(string.Format("Trùng tên! Vui lòng nhập lại."));
                }
            }
            catch (Exception)
            {
                throw new Exception("Trùng tên! Vui lòng nhập lại.");
            }
        }
Пример #4
0
        protected void btnEdit_Click(object sender, EventArgs e)
        {
            pcAddRoles.ShowOnPageLoad = true;

            BindCMBOrganization();
            if (Grd.FocusedRowIndex > -1)
            {
                SYS_Roles sysRoles = (SYS_Roles)Grd.GetRow(Grd.FocusedRowIndex);
                txtTenNhomQuyen.Text          = sysRoles.Name;
                cmbOrganization.SelectedIndex = sysRoles.IDOrganization;

                //txtUserName.Text = sysUser.UserName;
                //txtPhone.Text = sysUser.NumberPhone;
                //txtPassword.Text = sysUser.Password;
                //txtMidName.Text = sysUser.MidName;
                //txtLastName.Text = sysUser.LastName;
                //txtFistName.Text = sysUser.FirstName;
                //txtEmail.Text = sysUser.Email;
                //cbxNhomQuyen.Text = sysUser.RoleGroup;
                //cbxActive.Checked = sysUser.IsActive;
                //Session["SYSUser"] = sysUser;
                //pcAddUser.ShowOnPageLoad = true;
            }
            //LoadCBXNhomQuyen();
        }
Пример #5
0
        protected void Grd_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            Entity.SYS_Roles roles = new Entity.SYS_Roles();
            roles.ID             = (int)e.Keys["ID"];
            roles.Name           = e.NewValues["Name"] + "";
            roles.IDOrganization = int.Parse(e.NewValues["IDOrganization"] + "");
            if ((int)e.NewValues["IDOrganization"] != (int)e.OldValues["IDOrganization"])
            {
                if (CheckIDOrganization(roles.IDOrganization))
                {
                    throw new Exception(string.Format("Trùng tên đơn vị! Vui lòng chọn lại."));
                }
            }

            if (e.OldValues["Name"] + "" != e.NewValues["Name"] + "")
            {
                if (CheckRole(roles.Name))
                {
                    throw new Exception(string.Format("Trùng tên nhóm quyền! Vui lòng nhập lại."));
                }
            }

            _ISYS_RolesService.UpdateSYS_Roles(roles);
            _DataBind();
            e.Cancel = true;
            Grd.CancelEdit();
            //WriteLog("Update " + e.NewValues["Name"],Action.Update);
        }
Пример #6
0
        static void Run(Options options)
        {
            Dir.RequireDirectory(options.OutputDir);
            var floodVisOutput = $"{options.OutputDir}/flood_vis";

            Dir.RequireClearDirectory(floodVisOutput);
            var floodseries = FloodseriesZip.Read(options.FloodSeriesPath, options.StartDay, options.EndDay);
            var floodmap    = floodseries.CombineToFloodmap();

            DrawFloodSeries(floodseries, floodVisOutput);
            DrawFloodMap(floodmap, $"{options.OutputDir}/floodmap.png");
            Grd.Write($"{options.OutputDir}/floodmap.grd", floodmap);
        }
Пример #7
0
        static void Run(Options options)
        {
            var targetMap  = Grd.Read(options.TargetMapPath);
            var targetMask = Grd.Read(options.TargetMaskPath);
            var floodmap1  = Grd.Read(options.Floodmap1Path);
            var floodmap2  = Grd.Read(options.Floodmap2Path);

            var diff   = GetDiffBetween(floodmap1, floodmap2, targetMap, targetMask, options.TargetValue);
            var bitmap = DrawDiffMap(diff);
            var report = PrepareReport(diff);

            bitmap.Save($"{options.OutputDir}/diff.png");
            File.WriteAllText($"{options.OutputDir}/report.txt", report);
        }
Пример #8
0
        private static void Run(Options options)
        {
            var relief      = Grd.Read(options.ReliefFile);
            var targetMap   = Grd.Read(options.TargetMapFile);
            var floodSeries = FloodseriesZip.Read(options.FloodSeriesFile, options.StartDay, options.EndDay);
            var channels    = CgInteraction.ReadChannelsTreeFromCg(options.ChannelsGraphFile);

            var drawingsDir = $"{options.OutputDir}/vis";
            var mapsDir     = $"{options.OutputDir}/maps";

            Dir.RequireClearDirectory(drawingsDir);
            Dir.RequireClearDirectory(mapsDir);

            var floodMap = DrawFloodMapWithTargets(floodSeries, targetMap, options.TargetValue);

            floodMap.Save($"{options.OutputDir}/floodmap.png");

            var strategies = new[]
Пример #9
0
        public void PaintCurrent()
        {
            foreach (var str in DnsServers)
            {
                ((Button)Grd.FindName(str.Key)).ClearValue(Button.BackgroundProperty);
            }

            var adresses = GetDnsAdress();

            foreach (var ip in adresses)
            {
                var selectedServers = MainWindow.DnsServers
                                      .Where(f => f.Value != null && f.Value.Contains(ip.ToString())).Select(f => f.Key);

                foreach (var server in selectedServers)
                {
                    ((Button)Grd.FindName(server)).Background
                        = new SolidColorBrush((Color)ColorConverter.ConvertFromString("LightGreen"));
                }
            }

            string auto;

            if (IsAutoDns())
            {
                Otomatik.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("LightGreen"));
                auto = "\nOtomatik ";
            }
            else
            {
                auto = "";
            }


            lbl.Text = $"Þu an: {auto}\n{string.Join("\n", adresses)}";
        }
Пример #10
0
        private void UnitFill(string filePath,int decimals)
        {
            try
            {
                Grd grd = new Grd(filePath);
                double intervalX = (grd.maxx - grd.minx) / grdX.Children.Count;
                for (int i = 0; i < grdX.Children.Count; i++)
                {
                    ((TextBlock)grdX.Children[i]).Text = (Math.Round((grd.minx + intervalX * i), decimals)).ToString("f" + decimals);
                }

                double intervalY = (grd.maxy - grd.miny) / grdY.Children.Count;
                for (int i = 0; i < grdY.Children.Count; i++)
                {
                    ((TextBlock)grdY.Children[i]).Text = (Math.Round((grd.miny + intervalY * i), decimals)).ToString("f" + decimals);
                }

                double intervalZ = (grd.max - grd.min) / grdZ.Children.Count;
                for (int i = 0; i < grdZ.Children.Count; i++)
                {
                    ((TextBlock)grdZ.Children[i]).Text = (grd.max - intervalZ * i).ToString("0.000");
                }
            }
            catch
            {
                MessageWindow.Show(this, "数据填充失败,暂不支持此数据内容。");
            }
        }
Пример #11
0
 private void GRDDrawing(string filePath,string colorMapPath,int colors)
 {
     try
     {
         this.Cursor = Cursors.Wait;
         Grd grd = new Grd(filePath);
         WriteableBitmap wb = grd.GrdImage(new ColorMap(colorMapPath, colors));
         grdImage.Source = wb;
         colorRect.Fill = SelectColorItem.ColorBrush(colorMapPath);
         grdOutGrid.Visibility = Visibility.Visible;
         this.Cursor = Cursors.Arrow;
     }
     catch
     {
         MessageWindow.Show(this, "绘图失败,暂不支持此数据内容。");
         this.Cursor = Cursors.Arrow;
     }
 }
Пример #12
0
 private void _DataBind()
 {
     _lst           = _ISYS_RolesService.SelectAllSYS_Roles();
     Grd.DataSource = _lst;
     Grd.DataBind();
 }