Exemplo n.º 1
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;
        }
Exemplo n.º 2
0
        public TableDockingForm(Form pParentForm, DBTableControl dbTables, SQLTable tbl,NavigationButtons.Navigation xnav)
        {
            nav = xnav;
            m_pParentForm = pParentForm;
            InitializeComponent();
            m_DBTables = dbTables;
            m_tbl = tbl;
            m_pTableDockingFormXml = m_DBTables.m_xml.GetTableDockingFormXml(m_tbl.TableName);
            if (m_pTableDockingFormXml == null)
            {
                m_pTableDockingFormXml = new TableDockingFormXml(m_tbl.TableName);
                m_DBTables.m_xml.m_xmldata.Add(m_pTableDockingFormXml);
            }

            m_pTableDockingFormXml.wrect.SetFormPlacement(this);

            this.Icon = Properties.Resources.TableDockingForm_icon;
            this.Text = m_tbl.lngTableName.s;
            SetViews();
        }
Exemplo n.º 3
0
        public void SaveWindowConfigruarion()
        {
            TableDockingFormXml xTableDockingFormXml = m_DBTables.m_xml.GetTableDockingFormXml(m_tbl.TableName);
            if (xTableDockingFormXml == null)
            {
                xTableDockingFormXml = new TableDockingFormXml();
                xTableDockingFormXml.TableName = m_tbl.TableName;

            }

            m_DBTables.m_xml.Set_wRect(xTableDockingFormXml.wrect, this);

            if (m_EditTable_Form != null)
            {
                if (xTableDockingFormXml.m_EditTableFormXml == null)
                {
                    xTableDockingFormXml.m_EditTableFormXml = new EditTableFormXml();
                }

                m_DBTables.m_xml.Set_wRect(xTableDockingFormXml.m_EditTableFormXml.wrect, m_EditTable_Form);

            }
            else
            {
                if (xTableDockingFormXml.m_EditTableFormXml != null)
                {
                    xTableDockingFormXml.m_EditTableFormXml = null;
                }
            }

            if (m_CreateView_Form != null)
            {
                if (xTableDockingFormXml.m_CreateViewFormXml == null)
                {
                    xTableDockingFormXml.m_CreateViewFormXml = new CreateViewFormXml();
                }

                m_DBTables.m_xml.Set_wRect(xTableDockingFormXml.m_CreateViewFormXml.wrect, m_CreateView_Form);
            }
            else
            {
                if (xTableDockingFormXml.m_CreateViewFormXml != null)
                {
                    xTableDockingFormXml.m_CreateViewFormXml = null;
                }
            }

            if (this.m_DataTable_Form != null)
            {
                if (xTableDockingFormXml.m_DataTableFormXml == null)
                {
                    xTableDockingFormXml.m_DataTableFormXml = new DataTableFormXml();
                }

                m_DBTables.m_xml.Set_wRect(xTableDockingFormXml.m_DataTableFormXml.wrect, m_DataTable_Form);

            }
            else
            {
                if (xTableDockingFormXml.m_DataTableFormXml != null)
                {
                    xTableDockingFormXml.m_DataTableFormXml = null;
                }
            }

            int i;
            for (i = 0; i < guid.MaxTableViews; i++)
            {
                if (this.m_TableView_Form[i] != null)
                {
                    if (xTableDockingFormXml.m_TableViewFormXml[i] == null)
                    {
                        xTableDockingFormXml.m_TableViewFormXml[i] = new TableViewFormXml();
                    }
                    m_DBTables.m_xml.Set_wRect(xTableDockingFormXml.m_TableViewFormXml[i].wrect, m_TableView_Form[i]);
                }
                else
                {
                    if (xTableDockingFormXml.m_TableViewFormXml[i] != null)
                    {
                        xTableDockingFormXml.m_TableViewFormXml[i] = null;
                    }
                }
            }

            m_DBTables.m_xml.Set_wRect(m_DBTables.m_xml.wrect, m_pParentForm);

            m_DBTables.m_xml.Save();
        }
Exemplo n.º 4
0
 internal TableDockingFormXml Create_pTableDockingFormXml(string TableName)
 {
     TableDockingFormXml xTableDockingFormXml = new TableDockingFormXml(TableName);
     return xTableDockingFormXml;
 }
Exemplo n.º 5
0
 internal ViewXml CreateView(string tablename)
 {
     TableDockingFormXml xTableDockingFormXml = GetTableDockingFormXml(tablename);
     if (xTableDockingFormXml == null)
     {
         xTableDockingFormXml = new TableDockingFormXml(tablename);
     }
     ViewXml xViewXml= new ViewXml();
     xTableDockingFormXml.m_ViewXml.Add(xViewXml);
     return xViewXml;
 }
Exemplo n.º 6
0
        public bool Load(ref string csError)
        {
            bool bRes = true;
            XmlDocument xmlDoc = new XmlDocument();
            if (File.Exists(StaticXml.m_XMLFile))
            {
                if (ReadXmlFile(xmlDoc))
                {
                    XmlNode root = xmlDoc.DocumentElement;
                    {
                        if (root.Name.Equals(const_Root))
                        {

                            XmlAttributeCollection attrcollection = root.Attributes;
                            StaticXml.Get_wRect(ref wrect, attrcollection);

                            if (root.ChildNodes.Count > 0)
                            {
                                foreach (XmlNode node in root.ChildNodes)
                                {
                                    if (node.Name.Equals(const_TableDockingForm))
                                    {
                                        TableDockingFormXml xTableDockingFormXml = new TableDockingFormXml();
                                        xTableDockingFormXml.Parse(node, ref bRes);
                                        m_xmldata.Add(xTableDockingFormXml);
                                    }
                                    else
                                    {
                                        csError = lngRPM.s_Error.s + ":" + lngRPM.s_File.s + "=" + StaticXml.m_XMLFile + ":" + lngRPM.s_XmlIlegalNode.s + " \"" + node.Name + "\"." + lngRPM.s_Expected.s + "=\"" + const_TableDockingForm + "\"";
                                        bRes = false;
                                    }
                                }
                            }
                            else
                            {
                                csError = lngRPM.s_Error.s + ":" + lngRPM.s_File.s + "=" + StaticXml.m_XMLFile + ":" + lngRPM.s_XmlNodeNotFound.s + " \"" + const_TableDockingForm + "\"";
                                bRes = false;
                            }
                        }
                        else
                        {
                            csError = lngRPM.s_Error.s + ":" + lngRPM.s_File.s + "=" + StaticXml.m_XMLFile + ":" + lngRPM.s_XmlRootNotFound.s + lngRPM.s_Expected.s + "\"" + const_Root + "\"";
                            bRes = false;
                        }
                    }
                }
                else
                {
                    csError = lngRPM.s_Error.s + ":" + lngRPM.s_File.s + "=" + StaticXml.m_XMLFile + ":" + lngRPM.s_XmlFileNotLoadedInXmlDocument.s;
                    bRes = false;
                }
            }
            else
            {
                csError = lngRPM.s_Warning.s + ":" + lngRPM.s_File.s + "=" + StaticXml.m_XMLFile + ":" + lngRPM.s_DoesNotExist.s;
                bRes = false;
            }
            return bRes;
        }