Example #1
0
 public EditTable_Form(DBTableControl dbTables, SQLTable tbl, TableDockingForm dtF,Globals.delegate_SetControls xSetControls, bool bReadOnly,NavigationButtons.Navigation xnav)
 {
     m_TableDockingForm = dtF;
     this.Icon = Properties.Resources.SmallEditIcon;
     InitializeComponent();
     this.Text = lngRPM.s_EditTable.s + tbl.lngTableName.s + " (" + tbl.TableName + ")";
     usrc_EditRow.Init(dbTables, tbl, xSetControls, bReadOnly,xnav);
 }
Example #2
0
        public DataTable_Form(DBTableControl dbTables, SQLTable tbl, DataTable_Form_ENUM eMode, TableDockingForm pForm)
        {
            //m_DB = pDB;
            m_DBTables = dbTables;
            m_Mode = eMode;
            m_tbl = tbl;

            m_TableDockingForm = pForm;

            this.Icon = Properties.Resources.table;
            InitializeComponent();
            SetControls(m_tbl);
        }
Example #3
0
        public CreateView_Form(DBTableControl dbTables, SQLTable tbl, TableDockingForm dtF, NavigationButtons.Navigation xnav)
        {
            nav = xnav;
            this.Visible = false;
            bFormCreated = false;
            m_TableDockingForm = dtF;
            m_DBTables = dbTables;
            m_tbl = tbl;
            this.Icon=Properties.Resources.DataView_FormIcon;
            InitializeComponent();
            nmUpDn_Limit.Minimum = 0;
            nmUpDn_Limit.Maximum = 1000000000;
            chk_Limit.Checked = Properties.Settings.Default.bLimit;
            nmUpDn_Limit.Value = Convert.ToDecimal(Properties.Settings.Default.iLimitNumber);
            chk_Descending.Checked = Properties.Settings.Default.b_order_by_ID_desc;

            this.flowLayoutPanel1.Tag = 1;
            this.flowLayoutPanel1.FlowDirection = FlowDirection.LeftToRight;
            this.flowLayoutPanel2.Tag = 2;
            this.flowLayoutPanel2.FlowDirection = FlowDirection.TopDown;

            PictureBox pictureBox_MoveRight = new PictureBox();
            pictureBox_MoveRight.Image = Properties.Resources.MoveRightIcon.ToBitmap();
            pictureBox_MoveRight.Parent = this;
            pictureBox_MoveRight.Left = flowLayoutPanel2.Left + flowLayoutPanel2.Width + 3;
            pictureBox_MoveRight.Top = flowLayoutPanel2.Top + flowLayoutPanel2.Height / 4;
            pictureBox_MoveRight.Width = pictureBox_MoveRight.Image.Size.Width + 6;
            pictureBox_MoveRight.Height = pictureBox_MoveRight.Image.Size.Height + 6;
            pictureBox_MoveRight.Visible = true;
            //pictureBox_MoveRight.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;

            PictureBox pictureBox_MoveLeft = new PictureBox();
            pictureBox_MoveLeft.Image = Properties.Resources.MoveLeftIcon.ToBitmap();
            pictureBox_MoveLeft.Parent = this;
            pictureBox_MoveLeft.Left = flowLayoutPanel2.Left + flowLayoutPanel2.Width + 3;
            pictureBox_MoveLeft.Top = flowLayoutPanel2.Top + flowLayoutPanel2.Height/4 + 30;
            pictureBox_MoveLeft.Width = pictureBox_MoveLeft.Image.Size.Width + 6;
            pictureBox_MoveLeft.Height = pictureBox_MoveLeft.Image.Size.Height + 6;
            pictureBox_MoveLeft.Visible = true;
            //pictureBox_MoveLeft.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
            //this.pictureBox2.Image = Properties.Resources.MoveLeftIcon.ToBitmap();

            this.flowLayoutPanel1.DragEnter += new DragEventHandler(flowLayoutPanel1_DragEnter);
            this.flowLayoutPanel1.DragDrop += new DragEventHandler(flowLayoutPanel1_DragDrop);
            this.flowLayoutPanel2.DragEnter += new DragEventHandler(flowLayoutPanel1_DragEnter);
            this.flowLayoutPanel2.DragDrop += new DragEventHandler(flowLayoutPanel1_DragDrop);

            if (!bFormCreated)
            {

                int iCtrl = 1;
                m_pTableDockingFormXml = m_DBTables.m_xml.GetTableDockingFormXml(m_tbl.TableName);
                if (m_pTableDockingFormXml == null)
                {
                    m_pTableDockingFormXml = m_DBTables.m_xml.Create_pTableDockingFormXml(m_tbl.TableName);
                    m_DBTables.m_xml.m_xmldata.Add(m_pTableDockingFormXml);
                }
                if (m_pTableDockingFormXml.m_CreateViewFormXml == null)
                {
                    m_pTableDockingFormXml.Create_pCreateViewFormXml();
                }

                m_pTableDockingFormXml.m_CreateViewFormXml.wrect.SetFormPlacement(this);

                // Create DefineView_InputControls with no binding to xml data !
                m_tbl.Create_DefineView_InputControls(null, "", ref m_tbl.DefineView_inpCtrlList, this, this, ref iCtrl);

                //this.DynamicCreateControls(m_DBTables.m_xml.GetCreateViewFormDefaultView(m_tbl.TableName));

                this.DynamicCreateControls(m_pTableDockingFormXml.m_CreateViewFormXml.m_DefaultViewXml);

                bFormCreated = true;
            }
            this.Text = lngRPM.s_DataView_Form.s + m_tbl.lngTableName.s + " (" + m_tbl.TableName + ")";
            tsmi_CreateNew.Text = lngRPM.s_CreateNewView.s;
            tsmi_Select_View.Text = lngRPM.s_SelectView.s;
            tsmi_DeleteView.Text = lngRPM.s_DeleteView.s;
            tsmi_Save.Text =  lngRPM.s_Save.s;
            tsmi_Show.Text = lngRPM.s_Show.s;
            label_PrimaryView.Text = lngRPM.s_PrimaryView.s;
            chk_Limit.Text = lngRPM.s_Limit.s;
            chk_Descending.Text = lngRPM.s_Descending.s;
            grb_ShowLimits.Text = lngRPM.s_View.s;
        }
Example #4
0
        /// <summary>
        /// Create test form
        /// </summary>
        /// <param name="identifier">form identifier</param>
        /// <returns>test form</returns>
        /// 
        private static Form CreateDockForm(Guid identifier, DBTableControl dbTables, SQLTable x_tbl, TableDockingForm pParentForm, wRect wrect, ViewXml xViewXml,NavigationButtons.Navigation xnav)
        {
            if (identifier == new Guid(guid.gDocking_TableGrid_Form.ToByteArray()))
            {
                DataTable_Form result = new DataTable_Form(dbTables, x_tbl, DataTable_Form.DataTable_Form_ENUM.EDIT_OR_DELETE, pParentForm);
                result.Bounds = new Rectangle(wrect.Left, wrect.Top, wrect.Width, wrect.Height);
                return result;
            }
            else if (identifier == new Guid(guid.gDocking_EditTable_Form.ToByteArray()))
            {
                EditTable_Form result = new EditTable_Form(dbTables, x_tbl, pParentForm,SetControls,false,xnav);
                result.Bounds = new Rectangle(wrect.Left, wrect.Top, wrect.Width, wrect.Height);
                return result;
            }
            else if (identifier == new Guid(guid.gDocking_CreateView_Form.ToByteArray()))
            {
                CreateView_Form result = new CreateView_Form(dbTables, x_tbl, pParentForm, xnav);
                result.Bounds = new Rectangle(wrect.Left, wrect.Top, wrect.Width, wrect.Height);
                return result;
            }
            else
            {
                for (int i = 0; i < guid.MaxTableViews; i++)
                {
                    if (identifier == new Guid(guid.gDocking_TableView_Form[i].ToByteArray()))
                    {
                        TableView_Form result = new TableView_Form(i, dbTables, x_tbl, pParentForm, xViewXml);
                        result.Bounds = new Rectangle(wrect.Left, wrect.Top, wrect.Width, wrect.Height);
                        return result;
                    }
                }
            }

            throw new InvalidOperationException();
        }