Example #1
0
 public frmReport(string ReportPath)
 {
     InitializeComponent();
     __Table         = (_Table)this.Tag;
     this.Text       = __Table.Description;
     this.ReportPath = ReportPath;
 }
Example #2
0
 private void AddTable(Document d, _Table table)
 {
     try {
         object oEndOfDoc = "\\endofdoc";
         Range  wrdRng    = d.Bookmarks.get_Item(ref oEndOfDoc).Range;
         var    table1    = d.Tables.Add(wrdRng, table.RowCount, table.ColumnCount, ref missing, ref missing);
         //table1.Borders.Shadow = true;
         Data.ForEach(table.GetTable(), (cell, i, j) => {
             if (cell == null)
             {
                 return;
             }
             var range = table1.Cell(i + 1, j + 1).Range;
             table1.Cell(i + 1, j + 1).TopPadding = 10;
             range.Text = cell == null ? "" : cell.Text;
             ApplyStyle(range.Font, cell == null ? new ParagraphStyle() : cell.ParagraphStyle);
             SetStyles(d, range, cell == null ? new List <TextStyle>() : cell.Styles);
             range.ParagraphFormat.Alignment   = cell.ParagraphStyle.Alignment;
             range.ParagraphFormat.LineSpacing = cell.ParagraphStyle.LineSpacing;
         });
         try {
             if (table.HasBorders)
             {
                 table1.Borders.InsideLineStyle  = WdLineStyle.wdLineStyleSingle;
                 table1.Borders.OutsideLineStyle = WdLineStyle.wdLineStyleSingle;
                 //table1.Borders.Shadow = true;
             }
         } catch (Exception ex) {
             System.Windows.MessageBox.Show(ex.Message, "Erro in table border");
         }
     } catch (Exception ex) {
         System.Windows.MessageBox.Show(ex.Message, "Error in table instance.");
     }
 }
Example #3
0
 private void frmUser_Load(object sender, EventArgs e)
 {
     __Table         = (_Table)this.Tag;
     lblCaption.Text = __Table.Description;
     __Table.SetField();
     pCCL.SetButton(tsToolStrip, __Table.PK_TableCode);
     pCCL.SetDataPanelView(gbDetails, ttToolTip, __Table);
     SetDataSource();
     pCCL.SetDataGridView(dgvDataGridView, __Table);
 }
Example #4
0
 private void frmBase_Load(object sender, EventArgs e)
 {
     __Table               = (_Table)this.Tag;
     lblCaption.Text       = __Table.Description;
     tsbPermission.Visible = (__Table.TableName == "_WorkGroup") ? true : false;
     __Table.SetField();
     pCCL.SetButton(gbDetails, ttToolTip);
     pCCL.SetButton(this.tsToolStrip, __Table);
     pCCL.SetDataPanelView(gbDetails, ttToolTip, __Table);
     pCCL.SetControlEvent(gbDetails);
     SetDataSource();
     pCCL.SetDataGridView(dgvDataGridView, __Table);
 }
Example #5
0
 private void frmProduct_Load(object sender, EventArgs e)
 {
     __Table         = (_Table)this.Tag;
     lblCaption.Text = __Table.Description;
     __Table.SetField();
     __Table._Field.SetDataField(2);
     pCCL.SetButton(gbDetails, ttToolTip);
     pCCL.SetButton(tsToolStrip, __Table);
     pCCL.SetDataPanelView(gbDetails, ttToolTip, __Table);
     gbDetails.Tag = __Table;
     pCCL.SetControlEvent(gbDetails);
     SetDataSource();
     pCCL.SetDataGridView(dgvDataGridView, __Table);
 }
Example #6
0
 private void frmTree_Load(object sender, EventArgs e)
 {
     __Table         = (_Table)this.Tag;
     lblCaption.Text = __Table.Description;
     __Table.SetField();
     __Table._Field.SetDataField("FK_PartnerTypeCode");
     ptPartnerType = (PartnerType)Convert.ToInt32(__Table._Field.DefaultValue);
     pCCL.SetButton(gbDetails, ttToolTip);
     pCCL.SetButton(tsToolStrip, __Table);
     pCCL.SetDataPanelView(gbDetails, ttToolTip, __Table);
     gbDetails.Tag = __Table;
     pCCL.SetControlEvent(gbDetails);
     SetDataSource();
     pCCL.SetDataGridView(dgvDataGridView, __Table);
 }
Example #7
0
 private void frmVersion_Load(object sender, EventArgs e)
 {
     __Table         = (_Table)this.Tag;
     lblCaption.Text = __Table.Description;
     __Table.SetField();
     pCCL.SetDataPanelView(gbDetails, ttToolTip, __Table);
     pCCL.SetDataPanelView(gbCompany, ttToolTip, __Table);
     if (pBFL.GetDataTable(ref dtDataTable, __Table.Alias, __Table.Filter, __Table.Order) == null)
     {
         pCCL.SetGroupBox(gbDetails, __Table, dtDataTable.Rows[0]);
         pCCL.SetGroupBox(gbCompany, __Table, dtDataTable.Rows[0]);
     }
     else
     {
         this.Close();
     }
     lblWorkStationValue.Text = User.WorkStation;
 }
Example #8
0
        private void CreateMenuStrip(MenuStrip msMenuStrip, ToolStripMenuItem tsmiToolStripItem, DataTable dtDataTable, int intTableCode, Boolean HasSubMenu)
        {
            DataRow[]         drDataRow          = dtDataTable.Select("Visible = 1 AND PK_TableCode <> " + intTableCode.ToString() + " AND FK_ParentTableCode = " + intTableCode.ToString() + " AND (FK_TableTypeCode NOT IN (" + Convert.ToInt16(TableType.ttRelation).ToString() + ", " + Convert.ToInt16(TableType.ttSubTable).ToString() + ", " + Convert.ToInt16(TableType.ttButton).ToString() + "))", "Rank ASC");
            ToolStripMenuItem tsmi               = null;
            Boolean           IsVisibleSeperator = false;

            for (int RootIndex = 0; (RootIndex < drDataRow.Length); RootIndex++)
            {
                _Table __Table = new _Table(drDataRow[RootIndex]);
                if (tsmiToolStripItem == null)
                {
                    if (__Table.getPermission(Macro.Action.aSelect) == true)
                    {
                        tsmi     = (ToolStripMenuItem)msMenuStrip.Items.Add(drDataRow[RootIndex]["Description"].ToString(), null, tsmiToolStripMenuItem_Click);
                        tsmi.Tag = __Table;
                    }
                }
                else
                if ((TableType)Convert.ToInt16(drDataRow[RootIndex]["FK_TableTypeCode"]) == TableType.ttSeperator)
                {
                    if ((tsmiToolStripItem.DropDownItems.Count > 0) && (!(tsmiToolStripItem.DropDownItems[tsmiToolStripItem.DropDownItems.Count - 1] is ToolStripSeparator)))
                    {
                        IsVisibleSeperator = true;
                    }
                }
                else
                if (__Table.getPermission(Macro.Action.aSelect) == true)
                {
                    if (IsVisibleSeperator == true)
                    {
                        tsmiToolStripItem.DropDownItems.Add(new ToolStripSeparator());
                        IsVisibleSeperator = false;
                    }
                    tsmi     = (ToolStripMenuItem)tsmiToolStripItem.DropDownItems.Add(drDataRow[RootIndex]["Description"].ToString(), null, tsmiToolStripMenuItem_Click);
                    tsmi.Tag = __Table;
                }
                if (HasSubMenu == true)
                {
                    CreateMenuStrip(msMenuStrip, tsmi, dtDataTable, Convert.ToInt16(drDataRow[RootIndex]["PK_TableCode"]), true);
                }
            }
            return;
        }
Example #9
0
        private void tsmiToolStripMenuItem_Click(System.Object sender, System.EventArgs e)
        {
            ToolStripMenuItem tsmi    = sender as ToolStripMenuItem;
            _Table            __Table = (_Table)tsmi.Tag;

            Application.DoEvents();
            this.Cursor = Cursors.WaitCursor;
            switch (__Table.TableName)
            {
            case "o_UserInterChange": sUserChange(); break;

            case "o_PasswordChange": sPasswordChange(); break;

            case "o_Quit": this.Close(); break;

            default:
            {
                if ((TableType)__Table.FK_TableTypeCode == TableType.ttReport)
                {
                    frmReport frm = new frmReport(__Table.LinkPage);
                    frm.Tag = tsmi.Tag;
                    frm.ShowDialog();
                }
                else if (__Table.LinkPage.Trim() != string.Empty)
                {
                    try
                    {
                        Form frm = __Table.LinkPageForm();
                        frm.Tag = tsmi.Tag;
                        frm.ShowDialog();
                    }
                    catch (Exception eException)
                    {
                        System.Windows.Forms.MessageBox.Show(eException.Message);
                    }
                }
            }
            break;
            }
            this.Cursor = Cursors.Default;
        }