Beispiel #1
0
 private void InitializeComponent()
 {
     this.grid = new SmGridControl();
     this.view = new SmGridView();
     this.rschkSel = new RepositoryItemCheckEdit();
     this.bgLoadDataWorker = new BackgroundWorker();
     this.grid.BeginInit();
     this.view.BeginInit();
     this.rschkSel.BeginInit();
     base.SuspendLayout();
     this.grid.Dock = DockStyle.Fill;
     this.grid.EmbeddedNavigator.Name = "";
     this.grid.Location = new Point(0, 0);
     this.grid.MainView = this.view;
     this.grid.Name = "grid";
     this.grid.RepositoryItems.AddRange(new RepositoryItem[] { this.rschkSel });
     this.grid.Size = new Size(480, 0x1b0);
     this.grid.TabIndex = 4;
     this.grid.ViewCollection.AddRange(new BaseView[] { this.view });
     this.view.GridControl = this.grid;
     this.view.Name = "view";
     this.view.OptionsMenu.EnableColumnMenu = false;
     this.view.OptionsMenu.EnableFooterMenu = false;
     this.view.OptionsMenu.EnableGroupPanelMenu = false;
     this.view.OptionsView.EnableAppearanceEvenRow = true;
     this.view.OptionsView.EnableAppearanceOddRow = true;
     this.view.PaintStyleName = "Skin";
     this.view.DoubleClick += new EventHandler(this.ViewDoubleClick);
     this.rschkSel.AutoHeight = false;
     this.rschkSel.Name = "rschkSel";
     this.rschkSel.NullStyle = StyleIndeterminate.Unchecked;
     this.rschkSel.EditValueChanged += new EventHandler(this.rschkSel_EditValueChanged);
     this.bgLoadDataWorker.DoWork += new DoWorkEventHandler(this.LoadDataAsync);
     this.bgLoadDataWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.OnLoadDataCompleted);
     base.Controls.Add(this.grid);
     base.Name = "WfAbstractBox";
     base.Size = new Size(480, 0x1b0);
     this.grid.EndInit();
     this.view.EndInit();
     this.rschkSel.EndInit();
     base.ResumeLayout(false);
 }
Beispiel #2
0
 private void InitializeComponent()
 {
     this.grid = new SmGridControl();
     this.view = new SmGridView();
     this.grid.BeginInit();
     this.view.BeginInit();
     base.SuspendLayout();
     this.grid.Dock = DockStyle.Fill;
     this.grid.EmbeddedNavigator.Name = "";
     this.grid.ImeMode = ImeMode.On;
     this.grid.Location = new Point(2, 2);
     this.grid.MainView = this.view;
     this.grid.Name = "grid";
     this.grid.Size = new Size(0x18c, 340);
     this.grid.TabIndex = 0;
     this.grid.ViewCollection.AddRange(new BaseView[] { this.view });
     this.view.Appearance.EvenRow.BackColor = Color.LightSkyBlue;
     this.view.Appearance.EvenRow.BackColor2 = Color.GhostWhite;
     this.view.Appearance.EvenRow.GradientMode = LinearGradientMode.ForwardDiagonal;
     this.view.Appearance.EvenRow.Options.UseBackColor = true;
     this.view.Appearance.EvenRow.Options.UseFont = true;
     this.view.Appearance.OddRow.BackColor = Color.NavajoWhite;
     this.view.Appearance.OddRow.BackColor2 = Color.White;
     this.view.Appearance.OddRow.GradientMode = LinearGradientMode.BackwardDiagonal;
     this.view.Appearance.OddRow.Options.UseBackColor = true;
     this.view.Appearance.OddRow.Options.UseFont = true;
     this.view.GridControl = this.grid;
     this.view.HorzScrollVisibility = ScrollVisibility.Always;
     this.view.Name = "view";
     this.view.OptionsMenu.EnableColumnMenu = false;
     this.view.OptionsMenu.EnableFooterMenu = false;
     this.view.OptionsMenu.EnableGroupPanelMenu = false;
     this.view.OptionsView.EnableAppearanceEvenRow = true;
     this.view.OptionsView.EnableAppearanceOddRow = true;
     this.view.PaintStyleName = "Skin";
     this.view.VertScrollVisibility = ScrollVisibility.Always;
     this.view.FocusedRowChanged += new FocusedRowChangedEventHandler(this.view_FocusedRowChanged);
     this.view.DoubleClick += new EventHandler(this.view_DoubleClick);
     this.view.CustomRowCellEdit += new CustomRowCellEditEventHandler(this.view_CustomRowCellEdit);
     base.Controls.Add(this.grid);
     base.Name = "AdjunctEdit";
     base.Padding = new Padding(2);
     base.Size = new Size(400, 0x158);
     this.grid.EndInit();
     this.view.EndInit();
     base.ResumeLayout(false);
 }
Beispiel #3
0
 private void InitializeComponent()
 {
     this.grid = new SmGridControl();
     this.view = new SmCardView();
     this.grid.BeginInit();
     this.view.BeginInit();
     base.SuspendLayout();
     this.grid.Dock = DockStyle.Fill;
     this.grid.EmbeddedNavigator.Buttons.Append.Visible = false;
     this.grid.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
     this.grid.EmbeddedNavigator.Buttons.Edit.Visible = false;
     this.grid.EmbeddedNavigator.Buttons.EndEdit.Visible = false;
     this.grid.EmbeddedNavigator.Buttons.Remove.Visible = false;
     this.grid.EmbeddedNavigator.Name = "";
     this.grid.Location = new Point(2, 2);
     this.grid.MainView = this.view;
     this.grid.Name = "grid";
     this.grid.Size = new Size(0x18c, 420);
     this.grid.TabIndex = 0;
     this.grid.UseEmbeddedNavigator = true;
     this.grid.ViewCollection.AddRange(new BaseView[] { this.view });
     this.view.Appearance.FieldCaption.BackColor = Color.GhostWhite;
     this.view.Appearance.FieldCaption.Font = new Font("宋体", 9f, FontStyle.Bold);
     this.view.Appearance.FieldCaption.ForeColor = Color.BlueViolet;
     this.view.Appearance.FieldCaption.Options.UseFont = true;
     this.view.Appearance.FieldCaption.TextOptions.VAlignment = VertAlignment.Center;
     this.view.Appearance.FieldValue.TextOptions.WordWrap = WordWrap.Wrap;
     this.view.CardInterval = 4;
     this.view.FocusedCardTopFieldIndex = 0;
     this.view.GridControl = this.grid;
     this.view.MaximumCardColumns = 1;
     this.view.Name = "view";
     this.view.OptionsBehavior.AutoFocusNewCard = true;
     this.view.OptionsBehavior.AutoHorzWidth = true;
     this.view.OptionsBehavior.FieldAutoHeight = true;
     this.view.FocusedRowChanged += new FocusedRowChangedEventHandler(this.view_FocusedRowChanged);
     this.view.CellValueChanged += new CellValueChangedEventHandler(this.view_CellValueChanged);
     base.Controls.Add(this.grid);
     base.Name = "StaffNotion";
     base.Padding = new Padding(2, 2, 2, 2);
     base.Size = new Size(400, 0x1a8);
     this.grid.EndInit();
     this.view.EndInit();
     base.ResumeLayout(false);
 }
Beispiel #4
0
        /// <summary>
        /// 自动计算并填表
        /// </summary>
        /// <param name="smgrid"></param>
        /// <param name="type"></param>
        /// <param name="rjllx"></param>
        /// <param name="from"></param>
        /// <param name="to"></param>
        private void SzRule(SmGridControl smgrid, string type, int rjllx, double from, double to)
        {
            ArrayList result = null;// = new ArrayList();
            ArrayList name = null;//=  new ArrayList();
            ArrayList colname = new ArrayList();
            try
            {
                #region 得到返回结果
                CaluFj(type, ref result, ref name);
                #endregion
                string tmp;
                DataTable dt = ((System.Data.DataView)(smgrid.DataSource)).Table;
                colname.Clear();
                #region 得到表中的所有列名
                foreach (DataColumn dc in dt.Columns)
                {

                    tmp = dc.ColumnName.ToString();
                    if (type.IndexOf("容积率修正") >= 0)
                    {
                        if (tmp.IndexOf("_") >= 0)
                        {
                            colname.Add(tmp.Replace("_", "."));
                        }
                        else
                        {
                            colname.Add(tmp);
                        }
                    }
                    else if (type.IndexOf("楼龄修正") >= 0)
                    {
                        if (tmp.IndexOf("年") >= 0)
                        {
                            colname.Add(tmp.Replace("年", ""));
                        }
                        else
                        {
                            colname.Add(tmp);
                        }
                    }
                    else if (type.IndexOf("结构类型修正") >= 0)
                    {
                        colname.Add(tmp);
                    }

                    tmp = "";
                }
                #endregion
                if (dt != null)
                {
                    DataRow dr = dt.NewRow();
                    ///容积率修正
                    if (type.IndexOf("容积率修正") >= 0)
                    {
                        dr["容积类型"] = rjllx;
                    }
                    else if (type.IndexOf("楼龄修正") >= 0)
                    {
                        dr["结构类型"] = rjllx;
                    }
                    dr["PROJECT_ID"] = projectid;
                    for (int i = 0; i < name.Count; i++)
                    {
                        if (type.IndexOf("容积率修正") >= 0)
                        {
                            if (Convert.ToDouble(name[i].ToString()) >= from && Convert.ToDouble(name[i]) <= to)
                            {
                                if (colname.Contains(name[i]))
                                {
                                    if (name[i].ToString().IndexOf(".") >= 0)
                                    {
                                        dr[name[i].ToString().Replace(".", "_")] = result[i].ToString();
                                    }
                                    else
                                    {
                                        dr[name[i].ToString()] = result[i].ToString();
                                    }
                                }
                            }
                        }
                        else if (type.IndexOf("楼龄修正") >= 0)
                        {
                            #region 20100521 lhm
                            if (double.Parse(result[0].ToString()) == -9999)
                            {
                                MessageBox.Show("请检查数据输入是否有误!", "提示:");
                                return;
                            }

                            for (int ii = 1; ii < result.Count; ii++)
                            {
                                if (double.Parse(result[ii].ToString()) == -9999)
                                {
                                    result[ii] = result[ii - 1];
                                }
                            }
                            #endregion
                            if (Convert.ToDouble(name[i].ToString()) >= from && Convert.ToDouble(name[i]) <= to)
                            {
                                if (colname.Contains(name[i]))
                                {
                                    if (name[i].ToString().IndexOf("年") >= 0)
                                    {
                                        dr[name[i].ToString()] = result[i].ToString();
                                    }
                                    else
                                    {
                                        dr[string.Format("{0}年", name[i].ToString())] = result[i].ToString();
                                    }
                                }
                            }
                        }
                        else if (type.IndexOf("结构类型修正") >= 0)
                        {
                            if (colname.Contains(name[i]))
                            {
                                dr[name[i].ToString()] = result[i].ToString();
                            }
                        }
                    }
                    dt.Rows.Add(dr);
                }
            }
            catch
            {

            }
        }
Beispiel #5
0
 private void SzRule(SmGridControl smgrid, string type)
 {
     SzRule(smgrid, type, 0, 0, 0);
 }
 private void InitializeComponent()
 {
     this.components = new Container();
     ComponentResourceManager manager = new ComponentResourceManager(typeof(fSelectParticipant));
     this.imageList1 = new ImageList(this.components);
     this.panel1 = new Panel();
     this.btnCancel = new Button();
     this.btnOK = new Button();
     this.grid = new SmGridControl();
     this.view = new SmGridView();
     this.panel1.SuspendLayout();
     this.grid.BeginInit();
     this.view.BeginInit();
     base.SuspendLayout();
     this.imageList1.ImageStream = (ImageListStreamer) manager.GetObject("imageList1.ImageStream");
     this.imageList1.TransparentColor = Color.Fuchsia;
     this.imageList1.Images.SetKeyName(0, "");
     this.imageList1.Images.SetKeyName(1, "");
     this.imageList1.Images.SetKeyName(2, "");
     this.panel1.Controls.Add(this.btnCancel);
     this.panel1.Controls.Add(this.btnOK);
     this.panel1.Dock = DockStyle.Bottom;
     this.panel1.Location = new Point(0, 0x1a6);
     this.panel1.Name = "panel1";
     this.panel1.Size = new Size(0x21e, 0x33);
     this.panel1.TabIndex = 11;
     this.btnCancel.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
     this.btnCancel.Location = new Point(460, 12);
     this.btnCancel.Name = "btnCancel";
     this.btnCancel.Size = new Size(0x48, 0x1a);
     this.btnCancel.TabIndex = 12;
     this.btnCancel.Text = "取消";
     this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
     this.btnOK.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
     this.btnOK.Location = new Point(0x174, 12);
     this.btnOK.Name = "btnOK";
     this.btnOK.Size = new Size(80, 0x1a);
     this.btnOK.TabIndex = 11;
     this.btnOK.Text = "确定";
     this.btnOK.Click += new EventHandler(this.btnOK_Click);
     this.grid.Dock = DockStyle.Fill;
     this.grid.EmbeddedNavigator.Name = "";
     this.grid.ImeMode = ImeMode.NoControl;
     this.grid.Location = new Point(0, 0);
     this.grid.MainView = this.view;
     this.grid.Name = "grid";
     this.grid.Size = new Size(0x21e, 0x1a6);
     this.grid.TabIndex = 12;
     this.grid.ViewCollection.AddRange(new BaseView[] { this.view });
     this.view.GridControl = this.grid;
     this.view.HorzScrollVisibility = ScrollVisibility.Always;
     this.view.Name = "view";
     this.view.OptionsMenu.EnableColumnMenu = false;
     this.view.OptionsMenu.EnableFooterMenu = false;
     this.view.OptionsMenu.EnableGroupPanelMenu = false;
     this.view.OptionsView.EnableAppearanceEvenRow = true;
     this.view.OptionsView.EnableAppearanceOddRow = true;
     this.view.PaintStyleName = "Skin";
     this.view.VertScrollVisibility = ScrollVisibility.Always;
     this.AutoScaleBaseSize = new Size(6, 15);
     base.ClientSize = new Size(0x21e, 0x1d9);
     base.ControlBox = false;
     base.Controls.Add(this.grid);
     base.Controls.Add(this.panel1);
     base.LookAndFeel.UseDefaultLookAndFeel = false;
     base.Name = "fSelectParticipant";
     this.Text = "请选择";
     base.Load += new EventHandler(this.fSelectParticipant_Load);
     base.Shown += new EventHandler(this.fSelectParticipant_Shown);
     this.panel1.ResumeLayout(false);
     this.grid.EndInit();
     this.view.EndInit();
     base.ResumeLayout(false);
 }