コード例 #1
1
ファイル: Table.cs プロジェクト: jstangroome/CodedUITable
 protected Table(HtmlTable htmlTable, int headerRowCount, int footerRowCount)
 {
     Animate = _defaultAnimate;
     _htmlTable = htmlTable;
     _headerRowCount = headerRowCount;
     _footerRowCount = footerRowCount;
 }
コード例 #2
0
ファイル: Default.aspx.cs プロジェクト: PhilTheAir/Aspnet
 public void ContHTML()
 {
     for (int i = 0; i < ContListName.Count; i ++ )
     {
         name[i] = ContListName[i] + "<span onclick=ContDelId('" + ContListIdType[i] + "')>" + "</span>";
         img[i] = "<input type=image onserverclick=Del_ServerClick src=\\ICBCDynamicSite\\site\\Fund\\Bmp\\FundCompare\\button_delete_off.gif />";
         ShowAlert(name[i]);
         ShowAlert(img[i]);
     }
     HtmlTable table = new HtmlTable();
     table.Border = 0;
     table.CellPadding = 0;
     for (int rowcount = 0; rowcount < name.Length; rowcount ++ )
     {
         HtmlTableRow row = new HtmlTableRow();
         HtmlTableCell cell1 = new HtmlTableCell();
         HtmlTableCell cell2 = new HtmlTableCell();
         cell1.ColSpan = 2;
         cell1.Align = "Left";
         cell2.Align = "Right";
         cell1.Controls.Add(new LiteralControl(name[rowcount]));
         cell2.Controls.Add(new LiteralControl(name[rowcount]));
         row.Cells.Add(cell1);
         row.Cells.Add(cell2);
         table.Rows.Add(row);
     }
     Place.Controls.Clear();
     Place.Controls.Add(table);
 }
コード例 #3
0
    protected override void OnInit(EventArgs e)
    {
        string filename = Server.MapPath("settings.xml");
        XPathDocument document = new XPathDocument(filename);
        XPathNavigator navigator = document.CreateNavigator();
        XPathExpression expression = navigator.Compile("/appSettings/*");
        XPathNodeIterator iterator = navigator.Select(expression);

        HtmlTable table = new HtmlTable();
        HtmlTableRow row = new HtmlTableRow();
        HtmlTableCell cell = new HtmlTableCell();
        string tooltip = "";
        try
        {
            while (iterator.MoveNext())
            {
                tooltip = "";
                row = new HtmlTableRow();
                cell = new HtmlTableCell();

                XPathNavigator navigator2 = iterator.Current.Clone();
                Label label = new Label();
                label.ID = navigator2.Name + "Label";
                label.Text = navigator2.GetAttribute("name", navigator2.NamespaceURI);
                tooltip = navigator2.GetAttribute("description", navigator2.NamespaceURI);

                Control c = null;

                if (label.ID != "")
                {
                    c = new TextBox();
                    c.ID = navigator2.GetAttribute("name", navigator2.NamespaceURI) + "Textbox";
                    (c as TextBox).Text = navigator2.Value;
                    (c as TextBox).ToolTip = tooltip;
                    (c as TextBox).Width = 700;
                    (c as TextBox).TextMode = TextBoxMode.MultiLine;
                    label.ToolTip = tooltip;
                }

                cell.Controls.Add(label);
                row.Cells.Add(cell);

                cell = new HtmlTableCell();
                cell.Controls.Add(c);
                row.Cells.Add(cell);
                controls.Add(new ControlListItem(navigator2.Name, c.ID));

                table.Rows.Add(row);
            }
        }
        catch (Exception ex)
        {
            FormMessage.ForeColor = Color.Red;
            FormMessage.Text = ex.Message;
        }

        ControlsPanel.Controls.Add(table);

        base.OnInit(e);
    }
コード例 #4
0
ファイル: Default.aspx.cs プロジェクト: AJLoveChina/workAtQmm
 protected void Page_Load(object sender, EventArgs e)
 {
     //首先创建一个HtmlTable对象
     HtmlTable table1 = new HtmlTable();
     //设置HtmlTable的格式属性
     table1.Border = 1;
     table1.CellPadding = 1;
     table1.CellSpacing = 1;
     table1.BorderColor = "red";
     //下面的代码向HtmlTable添加内容
     HtmlTableRow row;
     HtmlTableCell cell;
     for (int i = 1; i <= 5; i++)
     {
         // 创建一个新的行,并设置其背景色属性
         row = new HtmlTableRow();
         row.BgColor = (i % 2 == 0 ? "lightyellow" : "lightcyan");
         for (int j = 1; j <= 4; j++)
         {
             //创建一个新的列,为其设置文本
             cell = new HtmlTableCell();
             cell.InnerHtml = "行: " + i.ToString() +
             "<br />列: " + j.ToString();
             //添加列对象到当前的行
             row.Cells.Add(cell);
         }
         //添加行对象到当前的Htmltable
         table1.Rows.Add(row);
     }
     //添加HtmlTable到当前页的控件集合中
     this.Controls.Add(table1);
 }
コード例 #5
0
ファイル: archive.aspx.cs プロジェクト: bpanjavan/Blog
    private static void CreateTableRow(HtmlTable table, Post post)
    {
        HtmlTableRow row = new HtmlTableRow();

        HtmlTableCell date = new HtmlTableCell();
        date.InnerHtml = post.DateCreated.ToString("yyyy-MM-dd");
        date.Attributes.Add("class", "date");
        row.Cells.Add(date);

        HtmlTableCell title = new HtmlTableCell();
        title.InnerHtml = string.Format("<a href=\"{0}\">{1}</a>", post.RelativeLink, post.Title);
        title.Attributes.Add("class", "title");
        row.Cells.Add(title);

        if (BlogSettings.Instance.IsCommentsEnabled)
        {
            HtmlTableCell comments = new HtmlTableCell();
            comments.InnerHtml = post.ApprovedComments.Count.ToString();
            comments.Attributes.Add("class", "comments");
            row.Cells.Add(comments);
        }

        if (BlogSettings.Instance.EnableRating)
        {
            HtmlTableCell rating = new HtmlTableCell();
            rating.InnerHtml = post.Raters == 0 ? "None" : Math.Round(post.Rating, 1).ToString();
            rating.Attributes.Add("class", "rating");
            row.Cells.Add(rating);
        }

        table.Rows.Add(row);
    }
コード例 #6
0
ファイル: JobPage.aspx.cs プロジェクト: TCarmack/Brentwood
    public HtmlTable CreateForm(int JobID, HttpServerUtility server)
    {
        List<JobInfo> info = Brentwood.ListJobInfoByJob(JobID);
        List<JobAsset> assets = Brentwood.ListJobAssetsByJobID(JobID);

        HtmlTable table = new HtmlTable();

        foreach (JobInfo item in info)
        {
            table.Rows.Add(CreateRow(item));
        }

        foreach (JobAsset item in assets)
        {
            table.Rows.Add(CreateAssetRow(item, server));
        }

        Job job = Brentwood.GetJob(JobID);
        List<HtmlTableRow> rows = AddAdditionalInfo(job);

        foreach(HtmlTableRow item in rows)
            table.Rows.Add(item);

        return table;
    }
コード例 #7
0
 protected void AddRowIconClassName(string icon, HtmlTable table, HtmlTableRow row)
 {
     HtmlTableCell cell1 = new HtmlTableCell();
     cell1.InnerHtml = icon;
     row.Cells.Add(cell1);
     table.Rows.Add(row);
 }
コード例 #8
0
    public string RenderAccounts(TransitAccount[] accounts)
    {
        HtmlTable table = new HtmlTable();
        table.Border = 0;
        table.BorderColor = "White";
        HtmlTableRow row = new HtmlTableRow();
        table.Rows.Add(row);
        foreach (TransitAccount ta in accounts)
        {
            HtmlTableCell cell = new HtmlTableCell();
            cell.Controls.Add(new LiteralControl(string.Format(
                "<div><a href='AccountView.aspx?id={0}'>" +
                "<img border=0 style='width: 50%;' src='AccountPictureThumbnail.aspx?id={1}'></a></div>" +
                "<div class=sncore_link><a href='AccountView.aspx?id={0}'>{2}</a>", ta.Id, ta.PictureId, Render(ta.Name))));
            row.Cells.Add(cell);
            if (row.Cells.Count % 4 == 0)
            {
                row = new HtmlTableRow();
                table.Rows.Add(row);
            }
        }

        StringBuilder sb = new StringBuilder();
        StringWriter sw = new StringWriter(sb);
        table.RenderControl(new HtmlTextWriter(sw));
        return sb.ToString();
    }
コード例 #9
0
	protected void Page_Init(object sender, EventArgs e)
	{
		string query = Request.QueryString["query"];
		WikiID = Request.QueryString["wikiid"];
		WikiNumber = Request.QueryString["wikinumber"];
		CategoryID = Request.QueryString["categoryID"];
		ProductID = Request.QueryString["productID"];
		OrderID = Request.QueryString["orderID"];
		imgMessage = PXFormView1.FindControl("imgMessage") as Image;
		lblMessage = PXFormView1.FindControl("lblMessage") as Label;
		lblResults = PXFormView1.FindControl("lblResults") as Label;
		txtSearch = PXFormView1.FindControl("txtSearch") as PXTextEdit;
		chkSearchReplace = PXFormView1.FindControl("chkSearchReplace") as PXCheckBox;
		txtReplace = PXFormView1.FindControl("txtReplace") as PXTextEdit;
		SearchCaption = PXFormView1.FindControl("SearchCaption") as PXDropDown;
		SearchCaptionCategory = PXFormView1.FindControl("SearchCaptionCategory") as PXDropDown;		
		SearchCaptionProduct = PXFormView1.FindControl("SearchCaptionProduct") as PXDropDown;
		OrderCaption = PXFormView1.FindControl("OrderCaption") as PXDropDown;
		Go = PXFormView1.FindControl("btnSearch") as PXButton;

		mainContentTable = CreateMainTable();
		pager = CreatePager(query);
		PXFormView1.TemplateContainer.Controls.Add(MainContentTable);
		SetEditBoxAttrributes();
		FullText = true;

		if (this.searchType == SearchType.Wiki)
		{
			this.txtSearch.ToolTip = PXMessages.LocalizeNoPrefix(Messages.ttipHelpSearch);
		}
		else if (this.searchType == SearchType.Files)
		{
			this.txtSearch.ToolTip = PXMessages.LocalizeNoPrefix(Messages.ttipFileSearch);
		}
		else if (this.searchType == SearchType.Entity)
		{
			this.txtSearch.ToolTip = PXMessages.LocalizeNoPrefix(Messages.ttipEntitySearch);
		}
		else if (this.searchType == SearchType.Notes)
		{
			this.txtSearch.ToolTip = PXMessages.LocalizeNoPrefix(Messages.ttipNoteSearch);
		}
		FormatSearchCaption();
		RegisterThisId();
		imgMessage.ImageUrl = ResolveUrl("~/App_Themes/Default/Images/Message/information.gif");

		if (query == null || string.IsNullOrEmpty(query.Trim()))
		{
			imgMessage.Visible = true;
			lblMessage.Visible = true;
			lblResults.Visible = false;
			lblMessage.Text = PXMessages.LocalizeNoPrefix(Messages.SpecifySearchRequest);
			return;
		}

		imgMessage.Visible = false;
		lblMessage.Visible = false;
		lblResults.Visible = true;
	}
コード例 #10
0
ファイル: WebUtils.cs プロジェクト: TCarmack/Brentwood
    public static HtmlTable CreateTable(int jobID)
    {
        HtmlTable table = new HtmlTable();
        List<JobControl_Get_Result> results = Brentwood.ListJobControlByJobType(jobID);

        foreach (JobControl_Get_Result r in results)
            table.Rows.Add(AddRow(r));

        table = AddStandardControls(table);

        return table;
    }
コード例 #11
0
ファイル: General.cs プロジェクト: ranyaof/gismaster
 public static HtmlTable BuildDefaultCopies()
 {
     HtmlTable oTable = new HtmlTable()
     {
         Width = "30%",
         Align = "right"
     };
     oTable.Style.Add("font-family", "Arial (Hebrew)");
     oTable.Style.Add("font-size", "11pt");
     oTable.Style.Add("font-style", "normal");
     HtmlTableRow oRow = new HtmlTableRow();
     HtmlTableCell oCell = new HtmlTableCell();
     oCell.Attributes.Add("class", "clsUnderLineText");
     oCell.InnerHtml = "העתקים:";
     oRow.Cells.Add(oCell);
     oTable.Rows.Add(oRow);
     return oTable;
 }
コード例 #12
0
ファイル: web.cs プロジェクト: cody82/spacewar-arena
        public override void Execute(IDictionary<string, string> Parameters, Stream Output, TextWriter Text, BinaryWriter Bin)
        {
            Text.WriteLine("<html><head>");
            Text.WriteLine("<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">");
            Text.WriteLine("</head><body class=\"main\">");

            Config c = Root.Instance.ResourceManager.LoadConfig("config/global.config");

            HtmlTable t = new HtmlTable();

            foreach (DictionaryEntry kv in c.Table)
            {
                t.Rows.Add(new object[] { kv.Key.ToString(), kv.Value.ToString() });
            }
            Text.Write(t.ToString());

            Text.WriteLine("</body></html>");
        }
コード例 #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlTable myTable = new HtmlTable();
        myTable.Border = 1;
        myTable.CellPadding = 3;
        myTable.CellSpacing = 3;        

        for (int i = 0; i < 3; i++)
        {
            HtmlTableRow myRow = new HtmlTableRow();
            for (int j = 0; j < 4; j++)
            {
                HtmlTableCell myCell = new HtmlTableCell();
                myCell.InnerHtml = i + ", " + j;
                myRow.Cells.Add(myCell);                
            }
            myTable.Rows.Add(myRow);
        }
        Page.Controls.Add(myTable);
    }
コード例 #14
0
    public HtmlTable CreateForm(int JobID, HttpServerUtility server)
    {
        Job job = Brentwood.GetJob(JobID);
        List<JobInfo> info = Brentwood.ListJobInfoByJob(JobID);
        List<JobAsset> assets = Brentwood.ListJobAssetsByJobID(JobID);

        HtmlTable table = new HtmlTable();

        table.Rows.Add(CreateRow("Order ID No:", job.JobID.ToString()));

        foreach (JobInfo item in info)
            table.Rows.Add(CreateRow(item));

        table.Rows.Add(CreateRow("Estimated Delivery Date:", ((DateTime)job.PromiseDate).ToString("dd MMM yyyy hh:mm tt")));

        foreach (JobAsset item in assets)
            table.Rows.Add(CreateAssetRow(item, server));

        return table;
    }
コード例 #15
0
    protected void AddRadToggleButtonWithIcon(string ID, string IconName, string Skin, int? Height, int? Top, HtmlTable table, HtmlTableRow row)
    {
        HtmlTableCell cell = new HtmlTableCell();
        RadToggleButton RadToggleButton1 = new RadToggleButton()
        {
            ID = "RadToggleButton1" + ID,
            Text = IconName,
            Skin = Skin,
        };
        if (Height != null)
            RadToggleButton1.Height = Unit.Pixel((int)Height);

        RadToggleButton1.Icon.CssClass = IconName;
        if (Top != null)
            RadToggleButton1.Icon.Top = Unit.Pixel((int)Top);

        cell.Controls.Add(RadToggleButton1);
        row.Cells.Add(cell);
        table.Rows.Add(row);
    }
コード例 #16
0
ファイル: TableRow.cs プロジェクト: jstangroome/CodedUITable
        public void Initialize(HtmlTable htmlTable, HtmlCell[] htmlCells)
        {
            if (_htmlTable != null)
            {
                throw new InvalidOperationException("Row is already initialized.");
            }

            if (htmlCells.Select(c => c.RowIndex).Distinct().Count() != 1)
            {
                throw new ArgumentException("All cells must have the same RowIndex.", "htmlCells");
            }

            _htmlTable = htmlTable;
            RowIndex = htmlCells[0].RowIndex;

            ResetCache();
            foreach (var htmlCell in htmlCells)
            {
                _htmlCellCache.Set(htmlCell.ColumnIndex, htmlCell);
            }
        }
コード例 #17
0
    //抬頭
    private string GetRptHead()
    {
        string strTemp = "";
        HtmlTable table = new HtmlTable();
        HtmlTableRow row;
        HtmlTableCell cell;
        CssStyleCollection css;

        FontSize = "14px";
        table.Border = 0;
        table.CellPadding = 0;
        table.CellSpacing = 0;
        table.Align = "center";
        css = table.Style;
        css.Add("font-size", "12px");
        css.Add("font-family", "標楷體");
        css.Add("width", "100%");

        //--------------------------------------------
        row = new HtmlTableRow();
        cell = new HtmlTableCell();
        strTemp = "103年熱線志工班表  第一季 ";
        cell.InnerHtml = strTemp == "" ? "&nbsp" : strTemp;
        css = cell.Style;
        css.Add("text-align", "center");
        css.Add("font-size", "24px");
        css.Add("font-family", "標楷體");
        css.Add("border-style", "none");
        css.Add("font-weight", "bold");
        //cell.ColSpan = 11;
        row.Cells.Add(cell);
        table.Rows.Add(row);
        //--------------------------------------------
        //轉成 html 碼
        StringWriter sw = new StringWriter();
        HtmlTextWriter htw = new HtmlTextWriter(sw);
        table.RenderControl(htw);

        return htw.InnerWriter.ToString();
    }
コード例 #18
0
    protected override void OnLoad(EventArgs e)
    {
        HtmlTable table = new HtmlTable();
        Controls.Add(table);

        for (int r=0; r<500; r++)
        {
            HtmlTableRow row = new HtmlTableRow();
            table.Rows.Add(row);

            HtmlTableCell firstCell = new HtmlTableCell();
            firstCell.InnerText = r.ToString();
            row.Cells.Add(firstCell);

            for(int c=0; c<9; c++)
            {
                HtmlTableCell cell = new HtmlTableCell();
                cell.InnerText = "data";
                row.Cells.Add(cell);
            }
        }
    }
コード例 #19
0
ファイル: DynamicTable.aspx.cs プロジェクト: Helen1987/edu
	protected void Page_Load(object sender, System.EventArgs e)
	{
		// Create a new HtmlTable object.
		HtmlTable table1 = new HtmlTable();

		// Set the table's formatting-related properties.
		table1.Border = 1;
		table1.CellPadding = 3;
		table1.CellSpacing = 3;
		table1.BorderColor = "red";

		// Start adding content to the table.
		HtmlTableRow row;
		HtmlTableCell cell;
		for (int i = 1; i <= 5; i++)
		{
			// Create a new row and set its background color.
			row = new HtmlTableRow();
			row.BgColor = (i % 2 == 0 ? "lightyellow" : "lightcyan");

			for (int j = 1; j <= 4; j++)
			{
				// Create a cell and set its text.
				cell = new HtmlTableCell();
				cell.InnerHtml = "Row: " + i.ToString() +
				  "<br>Cell: " + j.ToString();

				// Add the cell to the current row.
				row.Cells.Add(cell);
			}

			// Add the row to the table.
			table1.Rows.Add(row);
		}

		// Add the table to the page.
		this.Controls.Add(table1);
	}
コード例 #20
0
ファイル: WebUtils.cs プロジェクト: TCarmack/Brentwood
    private static HtmlTable AddStandardControls(HtmlTable table)
    {
        HtmlTableRow row = new HtmlTableRow();
        row.Cells.Add(AddLabel("Quantity"));
        row.Cells.Add(AddControl(JobControl_Get_Result.CreateJobControl_Get_Result(500, "QuantityTextbox", "TextBox")));
        table.Rows.Add(row);

        row = new HtmlTableRow();
        row.Cells.Add(AddLabel("Special Instructions"));
        TextBox box = new TextBox();
        box.ID = "501TextBoxSpecialInstructionsTextbox";
        box.TextMode = TextBoxMode.MultiLine;
        HtmlTableCell cell = new HtmlTableCell();
        cell.Controls.Add(box);
        row.Cells.Add(cell);
        table.Rows.Add(row);

        row = new HtmlTableRow();
        row.Cells.Add(AddLabel("Delivery?"));
        row.Cells.Add(AddControl(JobControl_Get_Result.CreateJobControl_Get_Result(502, "DeliveryCheckbox", "CheckBox")));
        table.Rows.Add(row);

        return table;
    }
コード例 #21
0
ファイル: Default3.aspx.cs プロジェクト: Chunting/Projects
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlTable table1 = new HtmlTable();
        table1.Border = 1;
        table1.CellPadding = 3;
        table1.CellSpacing = 3;
        table1.BorderColor = "red";

        HtmlTableRow row;
        HtmlTableCell cell;
        for (int i = 1; i <= 5; i++)
        {
            row = new HtmlTableRow();
            row.BgColor=(i%2==0?"lightyellow":"lightcyan");
            for (int j = 1; j <= 4; j++)
            {
                cell = new HtmlTableCell();
                cell.InnerHtml = "Row: " + i.ToString() + "<br />Cell: " + j.ToString();
                row.Cells.Add(cell);
            }
            table1.Rows.Add(row);
        }
        this.Controls.Add(table1);
    }
コード例 #22
0
    private void calculdetail()
    {
        LabelErreur.Attributes.Add("style", "color:red;");
        LabelErreur.Text      = "";
        TextBoxMResultat.Text = "";
        verifMontantt();
        verifMontantta();
        verifDuree();
        verifMontant();

        if ((flagMontantta == true) & (flagMontantt == true) & (flagMontantm == true) & (flagMontantd == true))
        {
            Double taux      = Convert.ToDouble(TextBoxMTaux.Text);
            Double Montantta = Convert.ToDouble(TextBoxMTauxAssu.Text);
            Double credit    = Convert.ToDouble(TextBoxMMontant.Text);
            Double duree     = Convert.ToDouble(DropDownList1.SelectedIndex) * 12;
            Double Tp        = ((taux / 100) / 12);
            Double Tpx       = 1 + Tp;
            Double reste     = credit;
            Double capital   = 0; // Le capital du crédit
            Double interet   = 0; // Intérêt du crédit
            Double assurance = credit * Montantta / 1200;
            assurance = Math.Round(assurance, 0);
            Tpx       = (Double)Math.Pow(Tpx, duree);
            Double mensualite  = (credit * Tpx * Tp) / (Tpx - 1); // Le montant de l'échéache
            Double mensualiteR = Math.Round(mensualite + assurance, 0);
            TextBoxMResultat.Text = mensualiteR.ToString("### ### ### ###") + " euros";
            //tableau();
            // Create the HtmlTable control.
            HtmlTable table = new HtmlTable();
            table.Border      = 1;
            table.CellPadding = 5;



            int           rowcount  = 0;
            int           cellcount = 0;
            double        sommeint  = 0;
            HtmlTableRow  row;
            HtmlTableCell cell;
            for (rowcount = 0; rowcount < (DropDownList1.SelectedIndex * 12); rowcount++)
            {
                row = new HtmlTableRow();
                // Create the cells of a row.



                if ((rowcount % 12) == 0)
                {
                    if ((rowcount != 0))
                    {
                        for (cellcount = 0; cellcount <= 5; cellcount++)
                        {
                            // Create the text for the cell.

                            cell       = new HtmlTableCell("th");
                            cell.Align = "right";
                            switch (cellcount)
                            {
                            case 0:
                                cell.Controls.Add(new LiteralControl("Total"));
                                break;

                            case 1:
                                Double resteR = Math.Round(reste, 0);
                                if (resteR == 0)
                                {
                                    cell.Controls.Add(new LiteralControl("0"));
                                }
                                else
                                {
                                    cell.Controls.Add(new LiteralControl(resteR.ToString("### ### ### ###")));
                                }
                                break;

                            case 2:
                                Double capitalR = Math.Round(capital, 0);
                                if (capitalR == 0)
                                {
                                    cell.Controls.Add(new LiteralControl("0"));
                                }
                                else
                                {
                                    cell.Controls.Add(new LiteralControl(capitalR.ToString("### ### ### ###")));
                                    //cell.Controls.Add(new LiteralControl(Convert.ToString(calcula(rowcount))));
                                }
                                break;

                            case 3:
                                Double sommeintR = Math.Round((sommeint), 0);
                                if (sommeintR == 0)
                                {
                                    cell.Controls.Add(new LiteralControl("0"));
                                }
                                else
                                {
                                    cell.Controls.Add(new LiteralControl(sommeintR.ToString("### ### ### ###")));
                                    // Add the cell to the Cells collection of a row.
                                }
                                break;

                            case 4:
                                if (assurance == 0)
                                {
                                    cell.Controls.Add(new LiteralControl("0"));
                                }
                                else
                                {
                                    cell.Controls.Add(new LiteralControl((assurance * 12).ToString("### ### ### ###")));
                                }
                                break;

                            case 5:
                                if (mensualiteR == 0)
                                {
                                    cell.Controls.Add(new LiteralControl("0"));
                                }
                                else
                                {
                                    cell.Controls.Add(new LiteralControl((mensualiteR * 12).ToString("### ### ### ###")));
                                }
                                break;
                            }
                            row.Cells.Add(cell);
                        }
                        sommeint = 0;
                        table.Rows.Add(row);
                        row = new HtmlTableRow();
                    }

                    cell       = new HtmlTableCell("th");
                    cell.Align = "left";
                    cell.Controls.Add(new LiteralControl("Année " + ((rowcount / 12) + 1).ToString("### ### ### ###")));
                    row.Cells.Add(cell);
                    table.Rows.Add(row);


                    row        = new HtmlTableRow();
                    cellcount  = 0;
                    cell       = new HtmlTableCell("th");
                    cell.Align = "left";
                    // Create the text for the cell.
                    cell.Controls.Add(new LiteralControl("Mois"));
                    // Add the cell to the Cells collection of a row.
                    row.Cells.Add(cell);

                    cellcount = 1;
                    //HtmlTableCell cell;
                    cell       = new HtmlTableCell("th");
                    cell.Align = "left";
                    // Create the text for the cell.
                    cell.Controls.Add(new LiteralControl("Capital restant dû"));
                    // Add the cell to the Cells collection of a row.
                    row.Cells.Add(cell);

                    cellcount = 2;
                    //HtmlTableCell cell;
                    cell = new HtmlTableCell("th");
                    // Create the text for the cell.
                    cell.Align = "left";
                    cell.Controls.Add(new LiteralControl("Capital amorti"));
                    // Add the cell to the Cells collection of a row.
                    row.Cells.Add(cell);

                    cellcount = 3;
                    //HtmlTableCell cell;
                    cell       = new HtmlTableCell("th");
                    cell.Align = "left";
                    // Create the text for the cell.
                    cell.Controls.Add(new LiteralControl("Intérêts"));
                    // Add the cell to the Cells collection of a row.
                    row.Cells.Add(cell);

                    cellcount = 4;
                    //HtmlTableCell cell;
                    cell       = new HtmlTableCell("th");
                    cell.Align = "left";
                    // Create the text for the cell.
                    cell.Controls.Add(new LiteralControl("Assurance"));
                    // Add the cell to the Cells collection of a row.
                    row.Cells.Add(cell);

                    cellcount = 5;
                    //HtmlTableCell cell;
                    cell       = new HtmlTableCell("th");
                    cell.Align = "left";
                    // Create the text for the cell.
                    cell.Controls.Add(new LiteralControl("Mensualité"));
                    // Add the cell to the Cells collection of a row.
                    row.Cells.Add(cell);
                    table.Rows.Add(row);
                    row = new HtmlTableRow();
                }


                interet  = ((reste * (taux / 100)) / 12);
                capital += mensualite - interet;
                sommeint = sommeint + interet;
                reste    = credit - capital;

                for (cellcount = 0; cellcount <= 5; cellcount++)
                {
                    // Create the text for the cell.

                    cell       = new HtmlTableCell();
                    cell.Align = "right";

                    switch (cellcount)
                    {
                    case 0:
                        cell.Controls.Add(new LiteralControl((rowcount + 1).ToString("### ### ### ###")));
                        break;

                    case 1:
                        Double resteR = Math.Round(reste, 0);

                        if (resteR == 0)
                        {
                            cell.Controls.Add(new LiteralControl("0"));
                        }
                        else
                        {
                            cell.Controls.Add(new LiteralControl(resteR.ToString("### ### ### ###")));
                        }
                        break;

                    case 2:
                        Double capitalR = Math.Round(capital, 0);
                        if (capitalR == 0)
                        {
                            cell.Controls.Add(new LiteralControl("0"));
                        }
                        else
                        {
                            cell.Controls.Add(new LiteralControl(capitalR.ToString("### ### ### ###")));
                        }     //cell.Controls.Add(new LiteralControl(Convert.ToString(calcula(rowcount))));
                        break;

                    case 3:
                        Double interetR = Math.Round(interet, 0);
                        if (interetR == 0)
                        {
                            cell.Controls.Add(new LiteralControl("0"));
                        }
                        else
                        {
                            cell.Controls.Add(new LiteralControl(interetR.ToString("### ### ### ###")));
                        }     // Add the cell to the Cells collection of a row.
                        break;

                    case 4:
                        if (assurance == 0)
                        {
                            cell.Controls.Add(new LiteralControl("0"));
                        }
                        else
                        {
                            cell.Controls.Add(new LiteralControl(assurance.ToString("### ### ### ###")));
                        }
                        break;

                    case 5:
                        if (mensualiteR == 0)
                        {
                            cell.Controls.Add(new LiteralControl("0"));
                        }
                        else
                        {
                            cell.Controls.Add(new LiteralControl(mensualiteR.ToString("### ### ### ###")));
                        }
                        break;
                    }
                    row.Cells.Add(cell);
                }
                table.Rows.Add(row);
            }

            row = new HtmlTableRow();
            for (cellcount = 0; cellcount <= 5; cellcount++)
            {
                // Create the text for the cell.

                cell       = new HtmlTableCell("th");
                cell.Align = "right";

                switch (cellcount)
                {
                case 0:
                    cell.Controls.Add(new LiteralControl("Total"));
                    break;

                case 1:
                    Double resteR = Math.Round(reste, 0);
                    if (resteR == 0)
                    {
                        cell.Controls.Add(new LiteralControl("0"));
                    }
                    else
                    {
                        cell.Controls.Add(new LiteralControl(resteR.ToString("### ### ### ###")));
                    }
                    break;

                case 2:
                    Double capitalR = Math.Round(capital, 0);
                    if (capitalR == 0)
                    {
                        cell.Controls.Add(new LiteralControl("0"));
                    }
                    else
                    {
                        cell.Controls.Add(new LiteralControl(capitalR.ToString("### ### ### ###")));
                    }
                    //cell.Controls.Add(new LiteralControl(Convert.ToString(calcula(rowcount))));
                    break;

                case 3:
                    Double sommeintR = Math.Round((sommeint), 0);
                    if (sommeintR == 0)
                    {
                        cell.Controls.Add(new LiteralControl("0"));
                    }
                    else
                    {
                        cell.Controls.Add(new LiteralControl(sommeintR.ToString("### ### ### ###")));
                        // Add the cell to the Cells collection of a row.
                    } break;

                case 4:
                    if (assurance == 0)
                    {
                        cell.Controls.Add(new LiteralControl("0"));
                    }
                    else
                    {
                        cell.Controls.Add(new LiteralControl((assurance * 12).ToString("### ### ### ###")));
                    }
                    break;

                case 5:
                    if (mensualiteR == 0)
                    {
                        cell.Controls.Add(new LiteralControl("0"));
                    }
                    else
                    {
                        cell.Controls.Add(new LiteralControl((mensualiteR * 12).ToString("### ### ### ###")));
                    }
                    break;
                }

                row.Cells.Add(cell);
            }
            sommeint = 0;
            table.Rows.Add(row);


            // Add the row to the Rows collection of the table.
            LabelErreur.Attributes.Add("style", "color:black;");
            LabelErreur.Controls.Clear();
            LabelErreur.Controls.Add(table);
        }
    }
コード例 #23
0
        private void CreateHierarchy(short AxisOrdinal, HtmlTable hostTable, Hierarchy hier, byte TreeDepth)
        {
            //string hierIdentifier=_contr.IdentifierFromHierarchy(hier);
            bool             hierIsAggregated = false;
            bool             hierIsMeasures   = (hier.UniqueName == "[Measures]");
            MembersAggregate aggr             = hier.FilterMember as MembersAggregate;

            if (aggr != null)
            {
                hierIsAggregated = true;
            }

            HtmlTableRow  tr = new HtmlTableRow();
            HtmlTableCell td;

            System.Web.UI.WebControls.Button btn;

            // --- node contr col--
            tr = new HtmlTableRow();
            td = new HtmlTableCell();
            if (AxisOrdinal != 2)
            {
                btn          = new System.Web.UI.WebControls.Button();
                btn.ToolTip  = "Move To Filter";
                btn.ID       = "sel_del:" + hier.UniqueName;        //hierIdentifier;
                btn.CssClass = "sel_del";
                td.Controls.Add(btn);

                btn          = new System.Web.UI.WebControls.Button();
                btn.ToolTip  = "Move Up";
                btn.ID       = "sel_up:" + hier.UniqueName;       //hierIdentifier;
                btn.CssClass = "sel_up";
                td.Controls.Add(btn);

                btn          = new System.Web.UI.WebControls.Button();
                btn.ToolTip  = "Move Down";
                btn.ID       = "sel_down:" + hier.UniqueName;       //hierIdentifier;
                btn.CssClass = "sel_down";
                td.Controls.Add(btn);
            }
            else
            {
                btn          = new System.Web.UI.WebControls.Button();
                btn.ToolTip  = "Move To Row";
                btn.ID       = "sel_torow:" + hier.UniqueName;       //hierIdentifier;
                btn.CssClass = "sel_torow";
                td.Controls.Add(btn);

                btn          = new System.Web.UI.WebControls.Button();
                btn.ToolTip  = "Move To Column";
                btn.ID       = "sel_tocol:" + hier.UniqueName;       //hierIdentifier;
                btn.CssClass = "sel_tocol";
                td.Controls.Add(btn);
            }

            td.Attributes.Add("class", "sel_C1");
            td.NoWrap = true;
            tr.Cells.Add(td);

            // --- node name col--
            td = new HtmlTableCell();

            Literal lit = new Literal();

            for (int i = 0; i < TreeDepth; i++)
            {
                lit.Text = lit.Text + "&nbsp;&nbsp;";
            }
            td.Controls.Add(lit);

            btn = new System.Web.UI.WebControls.Button();
            if (hier.IsOpen)
            {
                btn.ToolTip  = "Close";
                btn.ID       = "sel_hclose:" + hier.UniqueName;       //hierIdentifier;
                btn.CssClass = "sel_close";
            }
            else
            {
                btn.ToolTip  = "Open";
                btn.ID       = "sel_hopen:" + hier.UniqueName;       //hierIdentifier;
                btn.CssClass = "sel_open";
            }
            td.Controls.Add(btn);

            lit      = new Literal();
            lit.Text = hier.DisplayName;
            td.Controls.Add(lit);
            td.Attributes.Add("class", "sel_C");
            td.NoWrap = true;
            tr.Cells.Add(td);


            // --- node select col--
            td = new HtmlTableCell();

            if (AxisOrdinal != 2 && hier.IsOpen && !hierIsMeasures)
            {
                btn          = new System.Web.UI.WebControls.Button();
                btn.ToolTip  = "Select Children";
                btn.ID       = "sel_hselall:" + hier.UniqueName;       //hierIdentifier;
                btn.CssClass = "sel_selall";
                td.Controls.Add(btn);

                btn          = new System.Web.UI.WebControls.Button();
                btn.ToolTip  = "Deselect All Children";
                btn.ID       = "sel_hdeselall:" + hier.UniqueName;       //hierIdentifier;
                btn.CssClass = "sel_deselall";
                td.Controls.Add(btn);
            }
            else if (AxisOrdinal == 2 && !hierIsMeasures)
            {
                btn = new System.Web.UI.WebControls.Button();
                if (hierIsAggregated)
                {
                    btn.ToolTip  = "Set Aggregate Off";
                    btn.ID       = "sel_aggr_off:" + hier.UniqueName;           //hierIdentifier;
                    btn.CssClass = "sel_aggr_on";
                }
                else
                {
                    btn.ToolTip  = "Set Aggregate On";
                    btn.ID       = "sel_aggr_on:" + hier.UniqueName;           //hierIdentifier;
                    btn.CssClass = "sel_aggr_off";
                }
                td.Controls.Add(btn);
            }

            td.Attributes.Add("class", "sel_C2");
            td.NoWrap = true;
            tr.Cells.Add(td);



            hostTable.Rows.Add(tr);



            if (hier.IsOpen == false)
            {
                return;
            }


            TreeDepth++;
            // data members level depth=0
            for (int j = 0; j < hier.SchemaMembers.Count; j++)
            {
                CreateMemHierarchy(AxisOrdinal, hostTable, hier.SchemaMembers[j], hierIsAggregated, TreeDepth, false);
            }

            // calc members
            for (int j = 0; j < hier.CalculatedMembers.Count; j++)
            {
                CreateMemHierarchy(AxisOrdinal, hostTable, hier.CalculatedMembers[j], hierIsAggregated, 0, false);
            }
        }
    /// <summary>
    /// Load Hour &&minuts
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void RptSegmentosReg_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        //clsCache cCache = new csCache().cCache();
        //if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem) return;

        DataTable   dtNewvalue = null;
        DataRowView drv        = (DataRowView)(e.Item.DataItem);
        string      IdFly      = drv.Row["FlightNumber"].ToString();
        TimeSpan    dHour;
        RadioButton rb     = (RadioButton)e.Item.FindControl("rbtnSel");
        string      script = "SetUniqueRadioButton('RptSegmentosReg.*', '" + rb.ClientID + "')";

        rb.Attributes.Add("onclick", script);

        var       lblOdeId = ((Label)e.Item.FindControl("lblOdeId")).Text;
        HtmlTable tblIda   = ((HtmlTable)e.Item.FindControl("tblVuelta"));

        //Hide tbale when exist in teh current datalist
        //NoShowSegmnet(sender, IdFly, tblIda);
        try
        {
            dtNewvalue = getRealArrival(lblOdeId.ToString(), "R");
        }
        catch { }
        //if (IdFly.Equals("2582"))
        //{
        //    int i = 9;
        //}
        int IndicadorFila = 0;

        for (int i = 0; i < dtNewvalue.Rows.Count; i++)
        {
            if (dtNewvalue.Rows[i]["strDepartureAirport"].ToString().Equals(cCache.AeropuertoDestino.SCodigo))
            {
                IndicadorFila = i;
            }
        }

        ((Label)e.Item.FindControl("lblTimeFly")).Text = ((Label)e.Item.FindControl("lblTimeFly")).Text + "Min";
        if (dtNewvalue != null && dtNewvalue.Rows.Count > 1)
        {
            ((Label)e.Item.FindControl("lblCiudadLlegada")).Text    = dtNewvalue.Rows[dtNewvalue.Rows.Count - 1]["strCiudad_LLegada"].ToString();
            ((LinkButton)e.Item.FindControl("lblHeder")).Text       = (dtNewvalue.Rows.Count - 1).ToString() + " Paradas";//dtNewvalue.Rows[dtNewvalue.Rows.Count - 1]["strParadas"].ToString() + "Paradas";
            ((Label)e.Item.FindControl("lblHourArrival")).Text      = Convert.ToDateTime(dtNewvalue.Rows[dtNewvalue.Rows.Count - 1]["dtmFechaLlegada"]).ToString("HH:mm:ss");
            ((Label)e.Item.FindControl("lblCiudadLlegadaCod")).Text = dtNewvalue.Rows[dtNewvalue.Rows.Count - 1]["strArrivalAirport"].ToString();

            dHour = Convert.ToDateTime((dtNewvalue.Rows[dtNewvalue.Rows.Count - 1]["dtmFechaLlegada"])).Subtract(Convert.ToDateTime(((Label)e.Item.FindControl("lblHourTotal")).Text));

            ((Label)e.Item.FindControl("lblTimeFly")).Text = dHour.Minutes.ToString() + " Min";
            if (dHour.TotalMinutes >= 60)
            {
                int iHora   = Convert.ToInt16((dHour.TotalHours));
                int iMinuts = dHour.Minutes;
                //INT iMinuts = Math.Round(iHora - (Convert.ToInt32(iHora)),2);
                ((Label)e.Item.FindControl("lblTimeFly")).Text = iHora.ToString() + " Hr " + iMinuts.ToString() + " Min";
            }
        }
        else
        {
            dHour = Convert.ToDateTime((dtNewvalue.Rows[dtNewvalue.Rows.Count - 1]["dtmFechaLlegada"])).Subtract(Convert.ToDateTime(((Label)e.Item.FindControl("lblHourTotal")).Text));

            ((Label)e.Item.FindControl("lblTimeFly")).Text = dHour.Minutes.ToString() + " Min";
            if (dHour.TotalMinutes >= 60)
            {
                int iHora   = (dHour.Hours);
                int iMinuts = dHour.Minutes;
                //INT iMinuts = Math.Round(iHora - (Convert.ToInt32(iHora)),2);
                ((Label)e.Item.FindControl("lblTimeFly")).Text = iHora.ToString() + " Hr " + iMinuts.ToString() + " Min";
            }
            try
            {
                if (Convert.ToInt16(((LinkButton)e.Item.FindControl("lblHeder")).Text) > 0)
                {
                    ((LinkButton)e.Item.FindControl("lblHeder")).Text = ((LinkButton)e.Item.FindControl("lblHeder")).Text + " Parada";
                }
            }
            catch { }
        }
        //Hide tbale when exist in teh current datalist
        string HoraSalida = Convert.ToDateTime(drv.Row["dtmFechaSalida"]).ToString("HH:mm:ss");

        try
        {
            NoShowSegmnet(sender, IdFly, tblIda, HoraSalida, ((Label)e.Item.FindControl("lblHourArrival")).Text, false, dtNewvalue.Rows[IndicadorFila]["strDepartureAirport"].ToString());
        }
        catch { }
    }
コード例 #25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        bool ClientIsValid = false;

        if (Request.QueryString["subdomain"] != null)
        {
            Subdomain = Request.QueryString["subdomain"].ToString();
        }
        else
        {
            Subdomain = "nosubdomain";
        }
        ClientIsValid = Authentication.Utility.ClientIsValid(Request.Url, Subdomain);
        //Client Check

        if (ClientIsValid)
        {
            int clientid = 0;
            Authentication.Utility.DomainAttributes dm = Authentication.Utility.GetClient(Request.Url, Subdomain);
            Authentication.Utility.SessionVariable  sv = new Authentication.Utility.SessionVariable();
            RossSoft.Utility.AppConfig app             = RossSoft.Utility.AppSettings();


            if (dm.IsMultidomain)
            {
                Page.Title          = dm.DmName;
                OrgTitle.InnerHtml  = dm.DmName;
                Subclient.InnerHtml = "<static>Online Application for</static><br/>" + "<client>" + dm.SubDmName + "</client>";
                sv.Customer_id      = dm.DmID;
                sv.SubClient_id     = dm.SubDmID;
                clientid            = dm.SubDmID;
            }
            else
            {
                Page.Title          = dm.DmName; OrgTitle.InnerHtml = dm.DmName; sv.Customer_id = dm.DmID;
                clientid            = dm.DmID;
                Subclient.InnerHtml = "<static>Online Application</static>";
            }
            Authentication.Utility.checklogo(dm.DmID, OrgTitle, logo);


            Session["Appsettings"]    = app;
            Session["Clientsettings"] = dm;
            Session["SV"]             = sv;


            // string listcontent = "";
            //  HtmlGenericControl listcontent = new HtmlGenericControl("div");

            DataSet ds = Authentication.Utility.Splashpage(clientid);
            if (ds.Tables[0].Rows.Count > 0)
            {
                HtmlGenericControl accordion = new HtmlGenericControl("div");
                accordion.Attributes.Add("id", "accordion");


                //AppInstructions
                HtmlGenericControl title1 = new HtmlGenericControl("h3");
                title1.InnerHtml = "<a href='#'>Instructions</a>";
                accordion.Controls.Add(title1);

                HtmlGenericControl Instruction = new HtmlGenericControl("div");
                Instruction.InnerHtml = ds.Tables[0].Rows[0]["AppInstructions"].ToString();
                accordion.Controls.Add(Instruction);


                //OfflineApp Instructions

                if (Convert.ToBoolean(ds.Tables[0].Rows[0]["OfflineApp"].ToString()))
                {
                    HtmlTable     tb     = new HtmlTable();
                    HtmlTableRow  tr1    = new HtmlTableRow();
                    HtmlTableRow  tr2    = new HtmlTableRow();
                    HtmlTableCell c1     = new HtmlTableCell();
                    HtmlTableCell c2     = new HtmlTableCell();
                    ImageButton   imgbtn = new ImageButton();
                    imgbtn.Click        += new ImageClickEventHandler(Downloadbtn_Click);
                    imgbtn.ImageUrl      = "~/Code/menu/pdf_icon.png";
                    imgbtn.Width         = 42;
                    imgbtn.Height        = 42;
                    imgbtn.AlternateText = clientid.ToString();
                    c1.Controls.Add(imgbtn);
                    c2.InnerHtml = "Application.pdf";
                    tr1.Controls.Add(c1);
                    c1.Align = "Center";
                    tr2.Controls.Add(c2);
                    tb.Controls.Add(tr1);
                    tb.Controls.Add(tr2);
                    HtmlGenericControl Instruction2 = new HtmlGenericControl("span");
                    Instruction2.InnerHtml +=
                        "<b>Application</b><br/>" +
                        ds.Tables[0].Rows[0]["OfflineAppInstructions"].ToString();

                    //"<table><tr><td style='text-align:center;' >" +
                    //"<input type='image' name='ctl00$Content$imgbtn' alt='"+clientid+"' width='42px' Height='42px' id='ctl00_Content_imgbtn' src='Code/menu/pdf_icon.png' onclick='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$Content$imgbtn&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))' style='border-width:0px;'><a href='Assets/OfflineApp/" + clientid + "/Application.pdf'><img src='Code/menu/pdf_icon.png' width='42px' Height='42px' /></a></td></tr> " +
                    //"<tr><td>Application.pdf</td></tr></table>";
                    Instruction.Controls.Add(Instruction2);
                    Instruction.Controls.Add(tb);
                }


                //BrowserInstructions
                HtmlGenericControl title2 = new HtmlGenericControl("h3");
                title2.InnerHtml = "<a href='#'>Browser Instructions</a>";
                accordion.Controls.Add(title2);
                HtmlGenericControl BrowserInstruction = new HtmlGenericControl("div");
                BrowserInstruction.InnerHtml = ds.Tables[0].Rows[0]["BrowserInstructions"].ToString();


                accordion.Controls.Add(BrowserInstruction);
                list.Controls.Add(accordion);

                //Online app
                if (ds.Tables[0].Rows[0]["OnlineApp"].ToString() != "1")
                {
                    recaptchablk.Visible = false;
                }
            }


            //Application Type
            switch (dm.App_Type)
            {
            case 1:
                RedirectUrl = "~/Index.aspx";
                break;

            case 2:
                RedirectUrl = "~/mIndex.aspx";
                break;

            case 3:
                RedirectUrl = "~/nIndex.aspx";
                break;
            }

            if (Subdomain != "nosubdomain")
            {
                RedirectUrl += "?subdomain=" + Subdomain;
            }
        }
    }
コード例 #26
0
    /// <summary>
    /// Cria uma tabela HTML contendo a legenda das cores utilizadas
    /// </summary>
    private void CriaTabelaLegenda()
    {
        HtmlTable     tabelalegenda = new HtmlTable();
        HtmlTableCell cell;

        HtmlTableRow row1 = new HtmlTableRow();

        // configura célula
        cell = new HtmlTableCell {
            BgColor = CorInicioAnoLetivo, Height = "15px", Width = "25px"
        };

        // insere célula na linha
        row1.Cells.Add(cell);

        // configura célula
        cell = new HtmlTableCell {
            InnerText = "Início/Fim ano letivo"
        };

        // insere célula na linha
        row1.Cells.Add(cell);

        HtmlTableRow row2 = new HtmlTableRow();

        // configura célula
        cell = new HtmlTableCell {
            BgColor = CorPeriodosEventos, Height = "15px", Width = "25px"
        };

        // insere célula na linha
        row2.Cells.Add(cell);

        // configura célula
        cell = new HtmlTableCell {
            InnerText = "Períodos/Eventos"
        };

        // insere célula na linha
        row2.Cells.Add(cell);

        HtmlTableRow row3 = new HtmlTableRow();

        // configura célula
        cell = new HtmlTableCell {
            BgColor = CorDiasNaoUteis, Height = "15px", Width = "25px"
        };

        // insere célula na linha
        row3.Cells.Add(cell);

        // configura célula
        cell = new HtmlTableCell {
            InnerText = "Dias não úteis"
        };

        // insere célula na linha
        row3.Cells.Add(cell);

        HtmlTableRow row4 = new HtmlTableRow();

        // configura célula
        cell = new HtmlTableCell {
            BgColor = CorDiasSemAtividadeDiscente, Height = "15px", Width = "25px"
        };

        // insere célula na linha
        row4.Cells.Add(cell);

        // configura célula
        cell = new HtmlTableCell {
            InnerText = "Dias sem atividade discente"
        };

        // insere célula na linha
        row4.Cells.Add(cell);

        // insere as linhas na tabela
        tabelalegenda.Rows.Add(row1);
        tabelalegenda.Rows.Add(row2);
        tabelalegenda.Rows.Add(row3);
        tabelalegenda.Rows.Add(row4);

        // adiciona tabela na div
        divLegenda.Controls.Add(tabelalegenda);
    }
コード例 #27
0
ファイル: FormPanel.cs プロジェクト: magogoba/mixerp
        private void AddFormFooter(Panel p)
        {
            using (var htmlTable = new HtmlTable())
            {
                using (var row = new HtmlTableRow())
                {
                    using (var labelCell = new HtmlTableCell())
                    {
                        labelCell.Attributes.Add("class", "label-cell");

                        row.Cells.Add(labelCell);
                    }

                    using (var controlCell = new HtmlTableCell())
                    {
                        controlCell.Attributes.Add("class", "control-cell");

                        if (this.IsModal())
                        {
                            this.useButton               = new Button();
                            this.useButton.ID            = "UseButton";
                            this.useButton.Text          = Titles.Use;
                            this.useButton.OnClientClick = "scrudAdjustSpinnerSize();";

                            this.useButton.Click += this.UseButton_Click;

                            this.useButton.CssClass = this.GetButtonCssClass();

                            controlCell.Controls.Add(this.useButton);
                        }

                        this.saveButton               = new Button();
                        this.saveButton.ID            = "SaveButton";
                        this.saveButton.Text          = Titles.Save;
                        this.saveButton.OnClientClick = "scrudAdjustSpinnerSize();";

                        this.saveButton.Click += this.SaveButton_Click;

                        this.saveButton.CssClass = this.GetSaveButtonCssClass();

                        controlCell.Controls.Add(this.saveButton);

                        this.cancelButton                  = new Button();
                        this.cancelButton.ID               = "CancelButton";
                        this.cancelButton.Text             = Titles.Cancel;
                        this.cancelButton.CausesValidation = false;
                        this.cancelButton.OnClientClick    = "$('#FormPanel').hide(500); $('#GridPanel').show(500);";
                        this.cancelButton.Click           += this.CancelButton_Click;
                        this.cancelButton.CssClass         = this.GetButtonCssClass();

                        controlCell.Controls.Add(this.cancelButton);

                        using (var resetButton = new HtmlInputReset())
                        {
                            resetButton.Value = Titles.Reset;
                            resetButton.Attributes.Add("class", this.GetButtonCssClass());

                            controlCell.Controls.Add(resetButton);
                        }

                        row.Cells.Add(controlCell);

                        htmlTable.Rows.Add(row);
                        p.Controls.Add(htmlTable);
                    }
                }
            }
        }
コード例 #28
0
        public static void RenderControls(Control container, EntityFieldDef[] fields, FieldBehavior[] behaviors, string validationGroup)
        {
            if (fields == null || fields.Length == 0)
            {
                return;
            }
            if (behaviors == null || behaviors.Length == 0)
            {
                behaviors = new FieldBehavior[fields.Length];
                for (int i = 0; i < fields.Length; i++)
                {
                    behaviors[i] = CreateDefaultBehavior(fields[i]);
                }
                RenderControls(container, fields, behaviors, validationGroup);
                return;
            }
            HtmlTable tbl = new HtmlTable();

            container.Controls.Add(tbl);
            foreach (FieldBehavior behavior in behaviors)
            {
                EntityFieldDef field = null;
                foreach (EntityFieldDef tempField in fields)
                {
                    if (string.Compare(tempField.Name, behavior.FieldName, true) == 0)
                    {
                        field = tempField;
                        break;
                    }
                }
                if (field == null)
                {
                    continue;
                }
                HtmlTableRow row = new HtmlTableRow();
                tbl.Rows.Add(row);
                HtmlTableCell cell = new HtmlTableCell();

                //label
                cell.Width = string.Format("{0}px", _labelWidth);
                cell.Align = "right";
                row.Controls.Add(cell);
                Label lblControl = new Label();
                lblControl.Text = field.Caption;
                cell.Controls.Add(lblControl);

                //seperator:
                cell           = new HtmlTableCell();
                cell.InnerText = ":";
                row.Controls.Add(cell);

                //control
                cell = new HtmlTableCell();
                row.Controls.Add(cell);
                WebControl control = DataModelControlHelper.CreateControl(field, behavior);
                cell.Controls.Add(control);

                //add validators
                cell = new HtmlTableCell();
                row.Controls.Add(cell);
                BaseValidator[] validators = DataModelControlHelper.GetValidators(field, validationGroup);
                foreach (BaseValidator validator in validators)
                {
                    validator.ControlToValidate = control.ID.ToString();
                    cell.Controls.Add(validator);
                }
            }
        }
コード例 #29
0
	private HtmlTable CreateTable(string name)
	{
		HtmlTable table = new HtmlTable();
		table.Attributes.Add("summary", name);

		HtmlTableRow header = new HtmlTableRow();

		HtmlTableCell date = new HtmlTableCell("th");
        date.InnerHtml = Utils.Translate("date");
		header.Cells.Add(date);

		HtmlTableCell title = new HtmlTableCell("th");
        title.InnerHtml = Utils.Translate("title");
		header.Cells.Add(title);

		if (BlogSettings.Instance.IsCommentsEnabled)
		{
			HtmlTableCell comments = new HtmlTableCell("th");
			comments.InnerHtml = Utils.Translate("comments");
			comments.Attributes.Add("class", "comments");
			header.Cells.Add(comments);
		}

		if (BlogSettings.Instance.EnableRating)
		{
			HtmlTableCell rating = new HtmlTableCell("th");
            rating.InnerHtml = Utils.Translate("rating");
			rating.Attributes.Add("class", "rating");
			header.Cells.Add(rating);
		}

		table.Rows.Add(header);

		return table;
	}
コード例 #30
0
ファイル: JCBWH.aspx.cs プロジェクト: SoMeTech/SoMeRegulatory
 private void doEidt(int i)
 {
     int count = this.gvResult.Rows[i].Cells.Count;
     HtmlTable child = new HtmlTable();
     for (int j = 2; j < count; j++)
     {
         HtmlTableRow row = new HtmlTableRow();
         HtmlTableCell cell = new HtmlTableCell();
         Label label = new Label
         {
             Text = this.gvResult.HeaderRow.Cells[j].Text
         };
         cell.Attributes.Add("background-color", "#fff");
         cell.Controls.Add(label);
         HtmlTableCell cell2 = new HtmlTableCell();
         TextBox box = new TextBox();
         if (this.gvResult.Rows[i].Cells[j].Text.ToString() == "&nbsp;")
         {
             box.Text = "";
         }
         else
         {
             box.Text = this.gvResult.Rows[i].Cells[j].Text;
         }
         box.ID = j.ToString();
         box.Style.Add("width", "150px");
         this.divEdit.Controls.Add(box);
         cell2.Controls.Add(box);
         row.Cells.Add(cell);
         row.Cells.Add(cell2);
         child.Rows.Add(row);
     }
     HtmlTableRow row2 = new HtmlTableRow();
     HtmlTableCell cell3 = new HtmlTableCell();
     cell3.Attributes.Add("colspan", "2");
     Button button = new Button();
     int num3 = i + 1;
     button.Attributes.Add("onclick", "getTable(" + num3.ToString() + ")");
     button.Text = "保存";
     cell3.Controls.Add(button);
     row2.Cells.Add(cell3);
     child.Rows.Add(row2);
     child.Attributes.Add("id", "tb");
     child.Attributes.Add("border", "1px");
     child.Attributes.Add("class", "newTable");
     this.divEdit.Controls.Add(child);
 }
コード例 #31
0
        /// <summary>
        /// Selects the cell within the row
        /// Cell number required is passed in as well as the table
        /// </summary>
        private HtmlDiv SelectCellOnPage(int cellNumber, HtmlTable table)
        {
            var cellOnScreen = table.Cells[cellNumber];

            var divWithinCell = cellOnScreen.GetChildren();
            //return the first object found
            return (HtmlDiv)divWithinCell[0];
        }
コード例 #32
0
ファイル: Logs.aspx.cs プロジェクト: cloughin/VoteProject.5
        protected void ButtonRunReport_Click(object sender, EventArgs e)
        {
            try
            {
                #region Textbox Checks

                if (TextBoxLoginUser.Text.Trim() == string.Empty)
                {
                    throw new ApplicationException("The Login Username is empty.");
                }
                if (!Is_Valid_Date(TextBoxFrom.Text.Trim()))
                {
                    throw new ApplicationException("The From Date is not valid.");
                }
                if (!Is_Valid_Date(TextBoxTo.Text.Trim()))
                {
                    throw new ApplicationException("The To Date is not valid.");
                }

                #endregion

                #region Login Username

                LabelUserName.Text = "Login User Name: " + TextBoxLoginUser.Text.Trim() +
                                     " From:" + TextBoxFrom.Text.Trim() + " To: " + TextBoxTo.Text.Trim();

                #endregion

                var userName = TextBoxLoginUser.Text.Trim();

                if (CheckBoxListLogs.Items[0].Selected) //LogLogins
                {
                    TableLogins.Visible = true;

                    #region LogLogins

                    var htmlTable = new HtmlTable();

                    var tr = new HtmlTableRow().AddTo(htmlTable, "trReportDetail");
                    new HtmlTableCell {
                        Align = "center", InnerHtml = "First Login"
                    }.AddTo(
                        tr, "tdReportDetailHeading");
                    new HtmlTableCell {
                        Align = "center", InnerHtml = "Last Login"
                    }.AddTo(
                        tr, "tdReportDetailHeading");
                    new HtmlTableCell {
                        Align = "center", InnerHtml = "Hours"
                    }.AddTo(
                        tr, "tdReportDetailHeading");

                    var date          = Convert.ToDateTime(TextBoxFrom.Text.Trim());
                    var dateEnd       = Convert.ToDateTime(TextBoxTo.Text.Trim());
                    var totalDuration = TimeSpan.MinValue;
                    var days          = 0;
                    var totalHours    = 0;
                    while (dateEnd >= date)
                    {
                        var lowDate    = date;
                        var highDate   = date.AddDays(1);
                        var loginTable = LogLogins.GetDataByUserNameDateStampRange(userName,
                                                                                   lowDate, highDate);
                        if (loginTable.Count > 0)
                        {
                            var firstLogin = loginTable[0].DateStamp;
                            var lastLogin  = loginTable[loginTable.Count - 1].DateStamp;
                            var duration   = lastLogin - firstLogin;
                            var hours      = duration.Hours;
                            tr = new HtmlTableRow().AddTo(htmlTable, "trReportDetail");
                            Add_Td_To_Tr(tr, firstLogin.ToString(CultureInfo.InvariantCulture), "tdReportDetail");
                            Add_Td_To_Tr(tr, lastLogin.ToString(CultureInfo.InvariantCulture), "tdReportDetail");
                            Add_Td_To_Tr(tr, duration.Hours.ToString(CultureInfo.InvariantCulture),
                                         "tdReportDetail");
                            totalDuration = totalDuration + duration;
                            days++;
                            totalHours += hours;
                        }
                        date = date.AddDays(1);
                    }

                    tr = Add_Tr_To_Table_Return_Tr(htmlTable, "trReportDetail");
                    Add_Td_To_Tr(tr, "Total", "tdReportDetail");
                    Add_Td_To_Tr(tr, "Days: " + days, "tdReportDetail");
                    Add_Td_To_Tr(tr, totalHours.ToString(CultureInfo.InvariantCulture), "tdReportDetail");

                    LabelLogins.Text = htmlTable.RenderToString();

                    #endregion
                }

                var beginDate = Convert.ToDateTime(TextBoxFrom.Text.Trim());
                var endDate   = Convert.ToDateTime(TextBoxTo.Text.Trim());
                endDate = endDate.AddDays(1);

                if (CheckBoxListLogs.Items[1].Selected) //LogPoliticianAnswers
                {
                    var table1 =
                        LogPoliticianAnswers.GetBillingDataByUserNameDateStampRange(userName,
                                                                                    beginDate, endDate);
                    var table2 =
                        LogDataChange.GetBillingDataByUserNameTableNameDateStampRange(
                            userName, "Answers", beginDate, endDate);

                    var dateList = table1.Select(row => row.DateStamp.Date)
                                   .Concat(table2.Select(row => row.DateStamp.Date))
                                   .GroupBy(date => date)
                                   .Select(g => new DateCount {
                        DateStamp = g.Key, Count = g.Count()
                    });

                    TablePoliticianAnswers.Visible = true;
                    //Control report = Report(dateList, "Answers", 40);
                    Control report = Report(dateList, "Answers", 30);
                    LabelPoliticianAnswers.Text = report.RenderToString();
                }

                if (CheckBoxListLogs.Items[2].Selected) //LogPoliticianAdds
                {
                    var table =
                        LogPoliticianAdds.GetBillingDataByUserNameDateStampRange(userName,
                                                                                 beginDate, endDate);
                    var dateList = table.GroupBy(row => row.DateStamp.Date)
                                   .Select(
                        group => new DateCount {
                        DateStamp = group.Key, Count = group.Count()
                    });
                    TablePoliticianAdds.Visible = true;
                    Control report = Report(dateList, "Politician Adds", 20);
                    LabelPoliticianAdds.Text = report.RenderToString();
                }

                if (CheckBoxListLogs.Items[3].Selected) //LogPoliticianChanges
                {
                    var table1 =
                        LogPoliticianChanges.GetBillingDataByUserNameDateStampRange(userName,
                                                                                    beginDate, endDate);
                    var table2 =
                        LogDataChange.GetBillingDataByUserNameTableNameDateStampRange(
                            userName, "Politicians", beginDate, endDate);

                    var dateList = table1.Select(row => row.DateStamp.Date)
                                   .Concat(table2.Select(row => row.DateStamp.Date))
                                   .GroupBy(date => date)
                                   .Select(g => new DateCount {
                        DateStamp = g.Key, Count = g.Count()
                    });

                    TablePoliticianChanges.Visible = true;
                    //Control report = Report(dateList, "Politician Changes", 8);
                    Control report = Report(dateList, "Politician Changes", 10);
                    LabelPoliticianChanges.Text = report.RenderToString();
                }

                if (CheckBoxListLogs.Items[4].Selected) //LogElectionPoliticianAddsDeletes
                {
                    var table =
                        LogElectionPoliticianAddsDeletes.GetBillingDataByUserNameDateStampRange
                            (userName, beginDate, endDate);
                    var dateList = table.GroupBy(row => row.DateStamp.Date)
                                   .Select(
                        group => new DateCount {
                        DateStamp = group.Key, Count = group.Count()
                    });
                    TableElectionPoliticianAddsDeletes.Visible = true;
                    Control report = Report(dateList, "Election Politician Adds Deletes", 15);
                    LabelElectionPoliticianAddsDeletes.Text = report.RenderToString();
                }

                if (CheckBoxListLogs.Items[6].Selected) //LogElectionOfficeChanges
                {
                    var table =
                        LogElectionOfficeChanges.GetBillingDataByUserNameDateStampRange(
                            userName, beginDate, endDate);
                    var dateList = table.GroupBy(row => row.DateStamp.Date)
                                   .Select(
                        group => new DateCount {
                        DateStamp = group.Key, Count = group.Count()
                    });
                    TableElectionOfficeChanges.Visible = true;
                    Control report = Report(dateList, "Election Office Changes", 15);
                    LabelElectionOfficeChanges.Text = report.RenderToString();
                }

                if (CheckBoxListLogs.Items[7].Selected) //LogOfficeChanges
                {
                    var table =
                        LogOfficeChanges.GetBillingDataByUserNameDateStampRange(userName,
                                                                                beginDate, endDate);
                    var dateList = table.GroupBy(row => row.DateStamp.Date)
                                   .Select(
                        group => new DateCount {
                        DateStamp = group.Key, Count = group.Count()
                    });
                    TableOfficeChanges.Visible = true;
                    //Control report = Report(dateList, "Office Changes", 8);
                    Control report = Report(dateList, "Office Changes", 10);
                    LabelOfficeChanges.Text = report.RenderToString();
                }

                if (CheckBoxListLogs.Items[8].Selected) //LogOfficeOfficialAddsDeletes
                {
                    var table =
                        LogOfficeOfficialAddsDeletes.GetBillingDataByUserNameDateStampRange(
                            userName, beginDate, endDate);
                    var dateList = table.GroupBy(row => row.DateStamp.Date)
                                   .Select(
                        group => new DateCount {
                        DateStamp = group.Key, Count = group.Count()
                    });
                    TableOfficeOfficialsAdds.Visible = true;
                    Control report = Report(dateList, "Office Official Adds Deletes", 15);
                    LabelOfficeOfficialsAdds.Text = report.RenderToString();
                }

                if (CheckBoxListLogs.Items[9].Selected) //LogOfficeOfficialChanges
                {
                    var table =
                        LogOfficeOfficialChanges.GetBillingDataByUserNameDateStampRange(
                            userName, beginDate, endDate);
                    var dateList = table.GroupBy(row => row.DateStamp.Date)
                                   .Select(
                        group => new DateCount {
                        DateStamp = group.Key, Count = group.Count()
                    });
                    TableOfficeOfficialsChanges.Visible = true;
                    Control report = Report(dateList, "Office Official Changes", 15);
                    LabelOfficeOfficialsChanges.Text = report.RenderToString();
                }

                if (CheckBoxListLogs.Items[10].Selected) //LogPoliticiansImagesOriginal
                {
                    var table1 =
                        LogPoliticiansImagesOriginal.GetBillingDataByUserNameDateStampRange(
                            userName, beginDate, endDate);
                    var table2 =
                        LogDataChange.GetBillingDataByUserNameTableNameDateStampRange(
                            userName, "PoliticiansImagesBlobs", beginDate, endDate);

                    var dateList = table1.Select(row => row.ProfileOriginalDate.Date)
                                   .Concat(table2.Select(row => row.DateStamp.Date))
                                   .GroupBy(date => date)
                                   .Select(g => new DateCount {
                        DateStamp = g.Key, Count = g.Count()
                    });

                    TablePictureUploads.Visible = true;
                    Control report = Report(dateList, "Picture Uploads", 60);
                    LabelPictureUploads.Text = report.RenderToString();
                }

                if (CheckBoxListLogs.Items[11].Selected) //LogAdminData
                {
                    var table = LogAdminData.GetBillingDataByUserNameDateStampRange(
                        userName, beginDate, endDate);
                    var dateList = table.GroupBy(row => row.DateStamp.Date)
                                   .Select(
                        group => new DateCount {
                        DateStamp = group.Key, Count = group.Count()
                    });
                    TableAdminDataUpdates.Visible = true;
                    Control report = Report(dateList, "Admin Data Updates", 20);
                    LabelAdminDataUpdates.Text = report.RenderToString();
                }
            }
            catch (Exception ex)
            {
                Msg.Text = Fail(ex.Message);
                Log_Error_Admin(ex);
            }
        }
コード例 #33
0
ファイル: StlSites.cs プロジェクト: ooyuan1984/cms-1
        private static async Task <string> ParseElementAsync(IParseManager parseManager, ListInfo listInfo, List <KeyValuePair <int, Site> > dataSource)
        {
            var pageInfo = parseManager.PageInfo;

            if (dataSource == null || dataSource.Count == 0)
            {
                return(string.Empty);
            }

            var builder = new StringBuilder();

            if (listInfo.Layout == ListLayout.None)
            {
                if (!string.IsNullOrEmpty(listInfo.HeaderTemplate))
                {
                    builder.Append(listInfo.HeaderTemplate);
                }

                var isAlternative     = false;
                var isSeparator       = false;
                var isSeparatorRepeat = false;
                if (!string.IsNullOrEmpty(listInfo.AlternatingItemTemplate))
                {
                    isAlternative = true;
                }
                if (!string.IsNullOrEmpty(listInfo.SeparatorTemplate))
                {
                    isSeparator = true;
                }
                if (!string.IsNullOrEmpty(listInfo.SeparatorRepeatTemplate))
                {
                    isSeparatorRepeat = true;
                }

                for (var i = 0; i < dataSource.Count; i++)
                {
                    var site = dataSource[i];

                    pageInfo.SiteItems.Push(site);
                    var templateString = isAlternative && i % 2 == 1 ? listInfo.AlternatingItemTemplate : listInfo.ItemTemplate;
                    var parsedString   = await TemplateUtility.GetSitesTemplateStringAsync(templateString, string.Empty, parseManager, ParseType.Site);

                    builder.Append(parsedString);

                    if (isSeparator && i != dataSource.Count - 1)
                    {
                        builder.Append(listInfo.SeparatorTemplate);
                    }

                    if (isSeparatorRepeat && (i + 1) % listInfo.SeparatorRepeat == 0 && i != dataSource.Count - 1)
                    {
                        builder.Append(listInfo.SeparatorRepeatTemplate);
                    }
                }

                if (!string.IsNullOrEmpty(listInfo.FooterTemplate))
                {
                    builder.Append(listInfo.FooterTemplate);
                }
            }
            else
            {
                var isAlternative = !string.IsNullOrEmpty(listInfo.AlternatingItemTemplate);

                var tableAttributes = listInfo.GetTableAttributes();
                var cellAttributes  = listInfo.GetCellAttributes();

                using var table = new HtmlTable(builder, tableAttributes);
                if (!string.IsNullOrEmpty(listInfo.HeaderTemplate))
                {
                    table.StartHead();
                    using (var tHead = table.AddRow())
                    {
                        tHead.AddCell(listInfo.HeaderTemplate, cellAttributes);
                    }
                    table.EndHead();
                }

                table.StartBody();

                var columns   = listInfo.Columns <= 1 ? 1 : listInfo.Columns;
                var itemIndex = 0;

                while (true)
                {
                    using var tr = table.AddRow();
                    for (var cell = 1; cell <= columns; cell++)
                    {
                        var cellHtml = string.Empty;
                        if (itemIndex < dataSource.Count)
                        {
                            var site = dataSource[itemIndex];

                            pageInfo.SiteItems.Push(site);
                            var templateString = isAlternative && itemIndex % 2 == 1 ? listInfo.AlternatingItemTemplate : listInfo.ItemTemplate;
                            cellHtml = await TemplateUtility.GetSitesTemplateStringAsync(templateString, string.Empty, parseManager, ParseType.Site);
                        }
                        tr.AddCell(cellHtml, cellAttributes);
                        itemIndex++;
                    }
                    if (itemIndex >= dataSource.Count)
                    {
                        break;
                    }
                }

                table.EndBody();

                if (!string.IsNullOrEmpty(listInfo.FooterTemplate))
                {
                    table.StartFoot();
                    using (var tFoot = table.AddRow())
                    {
                        tFoot.AddCell(listInfo.FooterTemplate, cellAttributes);
                    }
                    table.EndFoot();
                }
            }

            return(builder.ToString());
        }
コード例 #34
0
        private void LoadSelectTable(HtmlTable hostTable, string Header, short AxisOrdinal)
        {
            HtmlTableRow  tr;
            HtmlTableCell td;

            //header
            tr           = new HtmlTableRow();
            td           = new HtmlTableCell();
            td.InnerText = Header;
            td.ColSpan   = 3;
            td.Attributes.Add("class", "sel_H");
            td.NoWrap = true;
            tr.Cells.Add(td);

            td        = new HtmlTableCell();
            td.NoWrap = true;
            tr.Cells.Add(td);

            td        = new HtmlTableCell();
            td.NoWrap = true;
            tr.Cells.Add(td);
            hostTable.Rows.Add(tr);


            if (AxisOrdinal == 2)
            {
                string      curFolder     = "";
                bool        curFolderOpen = false;
                Hierarchy[] hiers         = _report.Schema.Hierarchies.ToSortedByDisplayPathArray();
                foreach (Hierarchy hier in hiers)
                {
                    if (hier.Axis.Ordinal != AxisOrdinal)
                    {
                        continue;
                    }

                    string folder = hier.DisplayFolder;
                    // if folder is empty, check whther dimesnion name should be displayed as folder
                    if (folder == "" && hier.Dimension.Hierarchies.Count > 1)
                    {
                        folder = hier.Dimension.Name;
                    }
                    bool folderOpen = (folder != "" && _report.Schema.IsNodeOpen(folder));

                    // create folder if needed
                    if (curFolder != folder && folder != "")
                    {
                        CreateFolder(2, hostTable, folder, folderOpen);
                    }
                    curFolder     = folder;
                    curFolderOpen = folderOpen;

                    // create hierarchy if folder is open or there's no folder
                    if (curFolder == "" || curFolderOpen)
                    {
                        byte depth = (byte)(curFolder == "" ? 0 : 1);
                        CreateHierarchy(2, hostTable, hier, depth);
                    }
                }
            }
            else
            {
                for (int i = 0; i < _report.Axes[AxisOrdinal].Hierarchies.Count; i++)
                {
                    Hierarchy hier = _report.Axes[AxisOrdinal].Hierarchies[i];                   //not alph order
                    //hier header
                    CreateHierarchy(AxisOrdinal, hostTable, hier, 0);
                }
            }
        }
コード例 #35
0
        private void CreateMemHierarchy(short AxisOrdinal, HtmlTable hostTable, Member mem, bool HierIsAggregated, byte TreeDepth, bool autoSelect)
        {
            //do not display aggregate, display undlying calc members instead
            if (HierIsAggregated == true && mem.UniqueName == mem.Hierarchy.FilterMember.UniqueName)
            {
                MembersAggregate maggr = mem.Hierarchy.FilterMember as MembersAggregate;
                if (maggr != null)
                {
                    for (int i = 0; i < maggr.Members.Count; i++)
                    {
                        CalculatedMember cmem = maggr.Members[i] as CalculatedMember;
                        if (cmem != null)
                        {
                            this.CreateMemHierarchy(AxisOrdinal, hostTable, cmem, HierIsAggregated, TreeDepth, false);                             // recursion
                        }
                    }
                }
                return;
            }

            string       memIdentifier           = _contr.IdentifierFromSchemaMember(mem);
            string       hierIdentifier          = mem.Hierarchy.Axis.Ordinal.ToString() + ":" + mem.Hierarchy.Ordinal.ToString();
            bool         memIsSelected           = false;
            bool         memIsOpen               = false;
            bool         memIsPlaceholder        = false;
            bool         memChildrenAutoSelected = (mem.Hierarchy.CalculatedMembers.GetMemberChildrenSet(mem.UniqueName) != null);
            SchemaMember smem = mem as SchemaMember;

            if (smem != null)
            {
                memIsOpen        = smem.IsOpen;
                memIsPlaceholder = smem.IsPlaceholder;
            }

            if (HierIsAggregated)
            {
                memIsSelected = (((MembersAggregate)mem.Hierarchy.FilterMember).Members[mem.UniqueName] != null?true:false);
            }
            else
            {
                memIsSelected = (mem.Hierarchy.GetMember(mem.UniqueName) != null);
            }

            HtmlTableRow  tr = new HtmlTableRow();
            HtmlTableCell td;

            System.Web.UI.WebControls.Button btn;
            Literal lit;

            // --- node contr col--
            td = new HtmlTableCell();
            td.Attributes.Add("class", "sel_C1");
            td.NoWrap = true;
            tr.Cells.Add(td);

            // --- node name col--
            td = new HtmlTableCell();

            lit = new Literal();
            for (int i = 0; i < TreeDepth; i++)
            {
                lit.Text = lit.Text + "&nbsp;&nbsp;";
            }
            td.Controls.Add(lit);

            if (memIsOpen)
            {
                btn          = new System.Web.UI.WebControls.Button();
                btn.ToolTip  = "Close";
                btn.ID       = "sel_close:" + memIdentifier;
                btn.CssClass = "sel_close";
                td.Controls.Add(btn);
            }
            else
            {
                if (mem.CanDrillDown)
                {
                    btn          = new System.Web.UI.WebControls.Button();
                    btn.ToolTip  = "Open";
                    btn.ID       = "sel_open:" + memIdentifier;
                    btn.CssClass = "sel_open";
                    td.Controls.Add(btn);
                }
                else
                {
                    // no image
                    lit.Text = lit.Text + "&nbsp;&nbsp;&nbsp;";
                }
            }


            if (memIsPlaceholder == false)
            {
                if (AxisOrdinal == 2 && HierIsAggregated == false)
                {
                    HtmlInputRadioButton radio = new HtmlInputRadioButton();
                    radio.Name            = "m:" + hierIdentifier;
                    radio.ID              = "m:" + memIdentifier;
                    radio.EnableViewState = false;
                    radio.Checked         = (memIsSelected || autoSelect);
                    radio.Disabled        = autoSelect;
                    radio.Attributes.Add("class", "sel_chk");
                    td.Controls.Add(radio);
                }
                else
                {
                    HtmlInputCheckBox chk = new HtmlInputCheckBox();
                    chk.ID = "m:" + mem.UniqueName;                   //note, UniqueName !
                    chk.EnableViewState = false;
                    chk.Checked         = (memIsSelected || autoSelect);
                    chk.Disabled        = autoSelect;
                    chk.Attributes.Add("class", "sel_chk");
                    td.Controls.Add(chk);
                }
            }

            lit      = new Literal();
            lit.Text = mem.Name;
            td.Controls.Add(lit);

            td.Attributes.Add("class", "sel_C");
            td.NoWrap = true;
            tr.Cells.Add(td);


            // --- node select col--
            td = new HtmlTableCell();

            if (AxisOrdinal != 2 && memIsOpen)
            {
                if (!memChildrenAutoSelected)
                {
                    // placeholder cannot have auto-children, because it is not native olap object
                    if (!memIsPlaceholder)
                    {
                        btn          = new System.Web.UI.WebControls.Button();
                        btn.ToolTip  = "Auto-Select Children";
                        btn.ID       = "sel_selauto:" + memIdentifier;
                        btn.CssClass = "sel_selauto";
                        td.Controls.Add(btn);
                    }

                    btn          = new System.Web.UI.WebControls.Button();
                    btn.ToolTip  = "Select Children";
                    btn.ID       = "sel_selall:" + memIdentifier;
                    btn.CssClass = "sel_selall";
                    td.Controls.Add(btn);
                }

                btn          = new System.Web.UI.WebControls.Button();
                btn.ToolTip  = "Deselect All Children";
                btn.ID       = "sel_deselall:" + memIdentifier;
                btn.CssClass = "sel_deselall";
                td.Controls.Add(btn);
            }

            td.Attributes.Add("class", "sel_C2");
            td.NoWrap = true;
            tr.Cells.Add(td);


            hostTable.Rows.Add(tr);


            if (memIsOpen == false)
            {
                return;
            }

            // next level members if it's schema member
            TreeDepth++;
            if (smem != null)
            {
                for (int j = 0; j < smem.Children.Count; j++)
                {
                    CreateMemHierarchy(AxisOrdinal, hostTable, smem.Children[j], HierIsAggregated, TreeDepth, memChildrenAutoSelected);
                }
            }
        }
コード例 #36
0
    //this function will pull a list of transactions from this user
    protected void DisplayTransaction(string userName)
    {
        HtmlTable transTable = new HtmlTable();

        transTable.Border      = 1;
        transTable.CellPadding = 3;
        transTable.CellSpacing = 3;
        transTable.BorderColor = "Gray";

        HtmlTableRow  row;
        HtmlTableCell cell;
        int           rowCount = 0;

        //create the header row and add to the table
        row            = new HtmlTableRow();
        cell           = new HtmlTableCell();
        cell.InnerHtml = "<b>Date of Sale</b>";
        cell.Height    = "25px";
        cell.Width     = "100px";
        row.Cells.Add(cell);
        cell           = new HtmlTableCell();
        cell.InnerHtml = "<b>Item Name</b>";
        cell.Height    = "20px";
        cell.Width     = "100px";
        row.Cells.Add(cell);
        cell           = new HtmlTableCell();
        cell.InnerHtml = "<b>Item Number</b>";
        cell.Height    = "20px";
        cell.Width     = "100px";
        row.Cells.Add(cell);
        cell           = new HtmlTableCell();
        cell.InnerHtml = "<b>Price</b>";
        cell.Height    = "20px";
        cell.Width     = "80px";
        row.Cells.Add(cell);
        transTable.Rows.Add(row);


        int count = 0;

        count = CustomerDB.GetOneInt("select count(*) from vw_customerTransaction where email = '" + userName + "'");

        if (count == 0)
        {    //no transaction, create an empty row
            row            = new HtmlTableRow();
            cell           = new HtmlTableCell();
            cell.InnerHtml = "No transactions found.";
            cell.ColSpan   = 4;
            cell.Height    = "20px";
            row.Cells.Add(cell);
            transTable.Rows.Add(row);
            PnlTable.Controls.Add(transTable);
        }
        else
        {
            ArrayList res = new ArrayList();
            res = CustomerDB.GetRows("select saleDate,name,itemNumber, priceSold from vw_customerTransaction where email = '" + userName + "'");


            for (int j = 0; j < res.Count; j++)
            {
                rowCount++;
                //create a new row
                row = new HtmlTableRow();

                row.BgColor = (rowCount % 2 == 0 ? "white" : "#cccccc");

                //now loop through each row to get the cell content
                ArrayList oneRow = new ArrayList();
                oneRow = (ArrayList)res[j];

                for (int field = 0; field < oneRow.Count; field++)
                {
                    //create a cell and set the content
                    cell = new HtmlTableCell();
                    //each row will show the transaction date, item number and price


                    cell.InnerHtml = oneRow[field].ToString();
                    row.Cells.Add(cell);
                }
                //add the row to the table
                transTable.Rows.Add(row);
            }
            //add the table to the panel
            PnlTable.Controls.Add(transTable);
        }
    }
コード例 #37
0
        protected void ShowEditConsentForm(object sender, System.EventArgs e)
        {
            if (selConsentFormID.SelectedValue != "-1")
            {
                tblVersionsForm = new HtmlTable();
                HtmlTableRow  oTr;
                HtmlTableCell oTd;
                bool          bDisplayedHeader = false;
                bool          bDoDark          = false;

                for (int i = 0; i < selGroupIDs.Items.Count; i++)
                {
                    selGroupIDs.Items[i].Selected = false;
                }

                oDBLookup = new DBLookup();

                SqlCommand oCmd = new SqlCommand();
                oCmd.Connection     = Master.SqlConn;
                oCmd.CommandTimeout = 90;
                oCmd.CommandType    = CommandType.StoredProcedure;
                oCmd.CommandText    = "spGetConsentFormVersionsByConsentFormID";
                oCmd.Parameters.Add(new SqlParameter("@ConsentFormID", selConsentFormID.SelectedValue));

                SqlDataReader oReader = oCmd.ExecuteReader();

                while (oReader.Read())
                {
                    if (!bDisplayedHeader)
                    {
                        #region Display Header
                        txtConsentFormName.Text      = oReader["ConsentFormName"].ToString();
                        txtConsentFormNameShort.Text = oReader["ConsentFormNameShort"].ToString();
                        if (Convert.ToBoolean(oReader["IsActive"].ToString()))
                        {
                            chkIsActive.Checked = true;
                        }
                        else
                        {
                            chkIsActive.Checked = false;
                        }
                        if (Convert.ToBoolean(oReader["AssignOnEntry"].ToString()))
                        {
                            chkAssignOnEntry.Checked = true;
                        }
                        else
                        {
                            chkAssignOnEntry.Checked = false;
                        }
                        btnAddConsentVersion.Style["display"] = "inline";
                        SelectListBoxItems(ref selGroupIDs, oDBLookup.GetGroupIDsByConsentFormID(Convert.ToInt32(selConsentFormID.SelectedValue)).Split(','));

                        oTr = new HtmlTableRow();

                        oTd = new HtmlTableCell();
                        oTr.Attributes["class"] = "trTitle";
                        oTd.ColSpan             = 7;
                        oTd.InnerHtml           = "Versions of " + oReader["ConsentFormName"].ToString();
                        oTr.Cells.Add(oTd);

                        tblVersionsForm.Rows.Add(oTr);

                        tblVersionsForm.Attributes["class"] = "tblInput";
                        tblVersionsForm.CellSpacing         = 0;
                        tblVersionsForm.Style["width"]      = "100%";
                        tblVersionsForm.Style["margin"]     = "0px";

                        oTr = new HtmlTableRow();

                        oTd = new HtmlTableCell();
                        oTd.Attributes["class"] = "tdHeaderAlt";
                        oTd.InnerHtml           = "Version";
                        oTr.Cells.Add(oTd);

                        oTd = new HtmlTableCell();
                        oTd.Attributes["class"] = "tdHeaderAlt";
                        oTd.InnerHtml           = "Name";
                        oTr.Cells.Add(oTd);

                        oTd = new HtmlTableCell();
                        oTd.Attributes["class"] = "tdHeaderAlt";
                        oTd.InnerHtml           = "Approved";
                        oTr.Cells.Add(oTd);

                        oTd = new HtmlTableCell();
                        oTd.Attributes["class"] = "tdHeaderAlt";
                        oTd.InnerHtml           = "Effective";
                        oTr.Cells.Add(oTd);

                        oTd = new HtmlTableCell();
                        oTd.Attributes["class"] = "tdHeaderAlt";
                        oTd.InnerHtml           = "End Date";
                        oTr.Cells.Add(oTd);

                        oTd = new HtmlTableCell();
                        oTd.Attributes["class"] = "tdHeaderAlt";
                        oTd.InnerHtml           = "Reason for Change";
                        oTr.Cells.Add(oTd);

                        oTd = new HtmlTableCell();
                        oTd.Attributes["class"] = "tdHeaderAlt";
                        oTd.InnerHtml           = "Data Sharing Notes";
                        oTr.Cells.Add(oTd);

                        tblVersionsForm.Rows.Add(oTr);

                        bDisplayedHeader = true;
                        #endregion
                    }

                    #region Display Consent Form Versions
                    oTr = new HtmlTableRow();
                    if (bDoDark)
                    {
                        oTr.Attributes["class"] = "trDark";
                    }

                    oTd = new HtmlTableCell();
                    oTd.Style["vertical-align"] = "top";
                    oTd.Style["border-bottom"]  = "solid 1px #a1b5cf";
                    oTd.InnerHtml  = "<input type=\"text\" name=\"txtVersion\" value=\"" + oReader["Version"].ToString() + "\" style=\"width: 30px;\" />";
                    oTd.InnerHtml += "<input type=\"hidden\" name=\"hidConsentFormVersionID\" value=\"" + oReader["ConsentFormVersionID"].ToString() + "\" />";
                    oTr.Cells.Add(oTd);

                    oTd = new HtmlTableCell();
                    oTd.Style["vertical-align"] = "top";
                    oTd.Style["border-bottom"]  = "solid 1px #a1b5cf";
                    oTd.InnerHtml = "<input type=\"text\" name=\"txtConsentFormVersionName\" value=\"" + oReader["ConsentFormVersionName"].ToString() + "\" style=\"width: 50px;\" />";
                    oTr.Cells.Add(oTd);

                    oTd = new HtmlTableCell();
                    oTd.Style["vertical-align"] = "top";
                    oTd.Style["border-bottom"]  = "solid 1px #a1b5cf";
                    oTd.InnerHtml = "<input type=\"text\" name=\"txtApprovedDate\" value=\"" + oReader["ApprovedDate"].ToString() + "\" style=\"width: 65px;\" />";
                    oTr.Cells.Add(oTd);

                    oTd = new HtmlTableCell();
                    oTd.Style["vertical-align"] = "top";
                    oTd.Style["border-bottom"]  = "solid 1px #a1b5cf";
                    oTd.InnerHtml = "<input type=\"text\" name=\"txtEffectiveDate\" value=\"" + oReader["EffectiveDate"].ToString() + "\" style=\"width: 65px;\" />";
                    oTr.Cells.Add(oTd);

                    oTd = new HtmlTableCell();
                    oTd.Style["vertical-align"] = "top";
                    oTd.Style["border-bottom"]  = "solid 1px #a1b5cf";
                    oTd.InnerHtml = "<input type=\"text\" name=\"txtEndingDate\" value=\"" + oReader["EndingDate"].ToString() + "\" style=\"width: 65px;\" />";
                    oTr.Cells.Add(oTd);

                    oTd = new HtmlTableCell();
                    oTd.Style["vertical-align"] = "top";
                    oTd.Style["border-bottom"]  = "solid 1px #a1b5cf";
                    oTd.InnerHtml = "<textarea name=\"txtReasonForChange\" style=\"width: 240px;\" rows=\"2\">" + oReader["ReasonForChange"].ToString() + "</textarea>";
                    oTr.Cells.Add(oTd);

                    oTd = new HtmlTableCell();
                    oTd.Style["vertical-align"] = "top";
                    oTd.Style["border-bottom"]  = "solid 1px #a1b5cf";
                    oTd.InnerHtml = "<textarea name=\"txtDataSharingNotes\" style=\"width: 240px;\" rows=\"2\">" + oReader["DataSharing_Notes"].ToString() + "</textarea>";
                    oTr.Cells.Add(oTd);

                    tblVersionsForm.Rows.Add(oTr);

                    bDoDark = !bDoDark;
                    #endregion
                }

                tdVersionsForm.Controls.Add(tblVersionsForm);

                oReader.Close();
            }
            else
            {
                txtConsentFormName.Text               = "";
                txtConsentFormNameShort.Text          = "";
                btnAddConsentVersion.Style["display"] = "none";
            }
        }
コード例 #38
0
        private GraphBinding IncializeChartAndChartData(HtmlTable table, HtmlTableRow tRow, ClientCategorieModel item,
                                                        Enums.ChartRenderType type     = Enums.ChartRenderType.KOLICINA,
                                                        Enums.ChartRenderPeriod period = Enums.ChartRenderPeriod.MESECNO,
                                                        bool showFilterOnChart         = true,
                                                        DateTime?dateFROM = null,
                                                        DateTime?dateTO   = null)
        {
            UserControlGraph ucf2 = (UserControlGraph)LoadControl("~/UserControls/UserControlGraph.ascx");

            ChartRenderModel        chart = null;
            List <ChartRenderModel> list  = null;

            if (showFilterOnChart)
            {
                chart = CheckModelValidation(GetDatabaseConnectionInstance().GetChartDataFromSQLFunction(clientID, item.Kategorija.idKategorija, (int)period, (int)type));
            }
            else//if we want to see all types
            {
                list = CheckModelValidation(GetDatabaseConnectionInstance().GetChartDataForAllTypesSQLFunction(clientID, item.Kategorija.idKategorija, (int)period, dateFROM, dateTO));
            }

            if ((chart != null && chart.chartRenderData.Count > 0) || (list != null && list.Count > 0 && list.Exists(c => c.chartRenderData.Count > 0)))
            {
                item.HasChartDataForCategorie = true;
                //ucf2.ID = model.KodaStranke + "_UserControlGraph_" + (bindingCollection.Count + 1).ToString();
                ucf2.btnPostClk          += ucf2_btnPostClk;
                ucf2.btnDeleteGraphClick += ucf2_btnDeleteGraphClick;
                ucf2.btnAddEventClick    += ucf2_btnAddEventClick;


                tRow = AddChartsToCell(ucf2, tRow, 1);
                table.Rows.Add(tRow);

                ChartsCallback.Controls.Add(table);

                GraphBinding instance = new GraphBinding();

                if (period.Equals(Enums.ChartRenderPeriod.MESECNO))
                {
                    if (chart != null)
                    {
                        chart.chartRenderData = CheckForMissingMoths(chart.chartRenderData, (int)period, (int)type, item.Kategorija.idKategorija, 0);
                    }
                    else
                    {
                        foreach (var obj in list)
                        {
                            if (obj.chartRenderData.Count > 0)
                            {
                                obj.chartRenderData = CheckForMissingMoths(obj.chartRenderData, (int)period, obj.chartRenderData[0].Tip, item.Kategorija.idKategorija, 0);
                            }
                        }
                    }
                }

                ucf2.HeaderName.HeaderText = item.Kategorija.Naziv;
                ucf2.HeaderLink.Visible    = false;
                ucf2.Period.SelectedIndex  = ucf2.Period.Items.FindByValue(((int)period).ToString()).Index;
                ucf2.Period.Visible        = showFilterOnChart ? true : false;
                ucf2.Type.SelectedIndex    = ucf2.Type.Items.FindByValue(((int)type).ToString()).Index;
                ucf2.Type.Visible          = showFilterOnChart ? true : false;
                ucf2.RenderChart.Text      = "Izriši " + item.Kategorija.Koda;
                ucf2.RenderChart.Visible   = showFilterOnChart ? true : false;
                ucf2.CategorieID           = item.Kategorija.idKategorija;
                ucf2.YAxisTitle            = (chart != null && chart.chartRenderData.Count > 0) ? chart.chartRenderData[0].EnotaMere : "";
                ucf2.ShowFromToDateFilteringUserControl = showFilterOnChart ? true : false;

                if (chart != null)
                {
                    ucf2.CreateGraph(chart);
                }
                else if (list != null && list.Count > 0)
                {
                    //rbTypeDetail.SelectedIndex = rbTypeDetail.Items.FindByValue(((int)period).ToString()).Index;
                    ucf2.CreateGraphMultiPane(list);
                }

                instance.obdobje                = (int)period;
                instance.tip                    = (int)type;
                instance.YAxisTitle             = ucf2.YAxisTitle;
                instance.chartData              = chart;
                instance.chartDataMultiplePanes = list;
                instance.control                = ucf2;
                instance.HeaderText             = item.Kategorija.Koda;
                instance.CategorieID            = item.Kategorija.idKategorija;
                instance.ShowFilterFromToDate   = showFilterOnChart ? true : false;
                instance.dateFrom               = DateEdit_OD.Date;
                instance.dateTo                 = DateEdit_DO.Date;

                return(instance);
            }

            return(null);
        }
コード例 #39
0
        private void retrieve_datacustomer(string key, bool force_calc)
        {
            label_name.Text = cust_name;

            object[]  par = new object[] { appid };
            DataTable dt  = conn.GetDataTable("SELECT * FROM vw_reputasidetail WHERE appid = @1 order by bn_code", par, dbtimeout);

            if (dt.Rows.Count == 0)
            {
                Content.Attributes.CssStyle.Add("display", "none");
            }
            string tmpbank = ""; HtmlTable tbl = null; int tblnum = 0; double total_os = 0;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (tmpbank != dt.Rows[i]["bank_name"].ToString())
                {
                    tmpbank = dt.Rows[i]["bank_name"].ToString();
                    if (tbl != null)
                    {
                        tblnum++;
                        tddetail.Controls.Add(new LiteralControl("<div style='position: relative; left: -15px; top: 25px;'>" + tblnum.ToString() + ".&nbsp; </div>"));
                        tddetail.Controls.Add(tbl);
                    }

                    //create new table
                    #region create table
                    tbl       = new HtmlTable();
                    tbl.Width = "95%";
                    tbl.Attributes.CssStyle.Add("margin-bottom", "25px");
                    tbl.CellPadding = 2; tbl.CellSpacing = 0;
                    #endregion

                    #region create header
                    HtmlTableCell cell1 = new HtmlTableCell();
                    cell1.InnerText = dt.Rows[i]["bank_name"].ToString();
                    cell1.RowSpan   = 2;
                    cell1.Attributes.Add("class", "boxboldcenter");
                    cell1.BgColor = "Orange";
                    cell1.Width   = "40%";
                    cell1.Attributes.CssStyle.Add("font-weight", "bold");

                    HtmlTableCell cell2 = new HtmlTableCell();
                    cell2.InnerText = "Kewajiban saat ini";
                    cell2.RowSpan   = 2;
                    cell2.Attributes.Add("class", "boxboldcenter");
                    cell2.BgColor = "Yellow";
                    cell2.Width   = "25%";

                    HtmlTableCell cell3 = new HtmlTableCell();
                    cell3.InnerText = "Reputasi";
                    cell3.ColSpan   = 3;
                    cell3.Attributes.Add("class", "boxboldcenter");
                    cell3.BgColor = "Yellow";
                    cell1.Width   = "15%";

                    HtmlTableCell cell4 = new HtmlTableCell();
                    cell4.InnerText = "%";
                    cell4.RowSpan   = 2;
                    cell4.Attributes.Add("class", "boxboldcenter");
                    cell4.BgColor = "Yellow";
                    cell4.Width   = "15%";

                    HtmlTableCell cell5 = new HtmlTableCell();
                    cell5.InnerText = "1-6 bulan";
                    cell5.Attributes.Add("class", "boxboldcenter");
                    cell5.BgColor = "Yellow";
                    cell5.Width   = "15%";

                    HtmlTableCell cell6 = new HtmlTableCell();
                    cell6.InnerText = "7-12 bulan";
                    cell6.Attributes.Add("class", "boxboldcenter");
                    cell6.BgColor = "Yellow";
                    cell6.Width   = "15%";

                    HtmlTableCell cell7 = new HtmlTableCell();
                    cell7.InnerText = "13-24 bulan";
                    cell7.Attributes.Add("class", "boxboldcenter");
                    cell7.BgColor = "Yellow";
                    cell7.Width   = "10%";

                    HtmlTableRow row1 = new HtmlTableRow();
                    row1.Cells.Add(cell1);
                    row1.Cells.Add(cell2);
                    row1.Cells.Add(cell3);
                    row1.Cells.Add(cell4);
                    HtmlTableRow row2 = new HtmlTableRow();
                    row2.Cells.Add(cell5);
                    row2.Cells.Add(cell6);
                    row2.Cells.Add(cell7);
                    tbl.Rows.Add(row1);
                    tbl.Rows.Add(row2);
                    #endregion
                }

                #region fill data
                HtmlTableCell celldata1 = new HtmlTableCell();
                celldata1.InnerText = dt.Rows[i]["jenis_kredit"].ToString();
                celldata1.Attributes.Add("class", "boxboldleft");

                HtmlTableCell celldata2 = new HtmlTableCell();
                celldata2.InnerText = FormatedValue(dt.Rows[i]["baki_debet"], "n0");
                total_os            = total_os + (double)dt.Rows[i]["baki_debet"];
                celldata2.Attributes.Add("class", "boxboldright");

                HtmlTableCell celldata3 = new HtmlTableCell();
                celldata3.InnerText = dt.Rows[i]["rep1"].ToString();
                celldata3.Attributes.Add("class", "boxboldcenter");

                HtmlTableCell celldata4 = new HtmlTableCell();
                celldata4.InnerText = dt.Rows[i]["rep2"].ToString();
                celldata4.Align     = "center";
                celldata4.Attributes.Add("class", "boxboldcenter");

                HtmlTableCell celldata5 = new HtmlTableCell();
                celldata5.InnerText = dt.Rows[i]["rep3"].ToString();
                celldata5.Align     = "center";
                celldata5.Attributes.Add("class", "boxboldcenter");

                HtmlTableCell celldata6 = new HtmlTableCell();
                celldata6.InnerText = FormatedValue(dt.Rows[i]["prc"], "n2") + " %";
                celldata6.Align     = "center";
                celldata6.Attributes.Add("class", "boxboldcenter");

                HtmlTableRow rowdata = new HtmlTableRow();
                rowdata.BgColor = "White";

                rowdata.Cells.Add(celldata1);
                rowdata.Cells.Add(celldata2);
                rowdata.Cells.Add(celldata3);
                rowdata.Cells.Add(celldata4);
                rowdata.Cells.Add(celldata5);
                rowdata.Cells.Add(celldata6);
                tbl.Rows.Add(rowdata);
                #endregion
            }
            //add last table
            if (tbl != null)
            {
                tddetail.Controls.Add(new LiteralControl("<div style='position: relative; left: -15px; top: 25px;'>" + (tblnum + 1).ToString() + ".&nbsp; </div>"));
                tddetail.Controls.Add(tbl);
                //add total kewajiban
                tddetail.Controls.Add(new LiteralControl("<div style='font-weight:bold;'>Total : " + FormatedValue(total_os, "n0") + "</div>"));

                //add summary reputasi
                #region table reputasi summary header
                HtmlTable tblsum = new HtmlTable();
                tblsum.Width       = "40%";
                tblsum.Align       = "center";
                tblsum.CellPadding = 0; tblsum.CellSpacing = 0;

                HtmlTableCell cellsum1 = new HtmlTableCell();
                cellsum1.InnerText = "Reputasi Per Periode";
                cellsum1.ColSpan   = 3;
                cellsum1.Attributes.Add("class", "boxboldcenter");
                cellsum1.BgColor = "Yellow";
                HtmlTableRow rowsum1 = new HtmlTableRow();
                rowsum1.Cells.Add(cellsum1);

                HtmlTableCell cellsum2 = new HtmlTableCell();
                cellsum2.InnerText = "1-6 bulan";
                cellsum2.Attributes.Add("class", "boxboldcenter");
                cellsum2.BgColor = "Yellow";
                cellsum2.Width   = "33%";

                HtmlTableCell cellsum3 = new HtmlTableCell();
                cellsum3.InnerText = "7-12 bulan";
                cellsum3.Attributes.Add("class", "boxboldcenter");
                cellsum3.BgColor = "Yellow";
                cellsum3.Width   = "33%";

                HtmlTableCell cellsum4 = new HtmlTableCell();
                cellsum4.InnerText = "13-24 bulan";
                cellsum4.Attributes.Add("class", "boxboldcenter");
                cellsum4.BgColor = "Yellow";
                cellsum4.Width   = "33%";

                HtmlTableRow rowsum2 = new HtmlTableRow();
                rowsum2.Cells.Add(cellsum2);
                rowsum2.Cells.Add(cellsum3);
                rowsum2.Cells.Add(cellsum4);

                #endregion

                #region table reputasi summary data
                par = new object[] { appid };
                DataTable dt2 = conn.GetDataTable("SELECT * FROM vw_appreputasidetail WHERE appid = @1", par, dbtimeout);
                if (dt2.Rows.Count == 0)
                {
                    dt2 = conn.GetDataTable("SELECT * FROM vw_appreputasi WHERE appid = @1", par, dbtimeout);
                }
                if (dt2.Rows.Count > 0)
                {
                    HtmlTableCell celldata1 = new HtmlTableCell();
                    celldata1.InnerText = dt2.Rows[0]["repburuk_1"].ToString() + " / " + dt2.Rows[0]["jmlkreditur_1"].ToString();
                    celldata1.Attributes.Add("class", "boxboldcenter");
                    HtmlTableCell celldata2 = new HtmlTableCell();
                    celldata2.InnerText = dt2.Rows[0]["repburuk_2"].ToString() + " / " + dt2.Rows[0]["jmlkreditur_2"].ToString();
                    celldata2.Attributes.Add("class", "boxboldcenter");
                    HtmlTableCell celldata3 = new HtmlTableCell();
                    celldata3.InnerText = dt2.Rows[0]["repburuk_3"].ToString() + " / " + dt2.Rows[0]["jmlkreditur_3"].ToString();
                    celldata3.Attributes.Add("class", "boxboldcenter");
                    HtmlTableRow rowsum3 = new HtmlTableRow();
                    rowsum3.Cells.Add(celldata1);
                    rowsum3.Cells.Add(celldata2);
                    rowsum3.Cells.Add(celldata3);

                    tblsum.Rows.Add(rowsum1);
                    tblsum.Rows.Add(rowsum2);
                    tblsum.Rows.Add(rowsum3);
                    tddetail.Controls.Add(tblsum);
                }
                #endregion
            }
        }
コード例 #40
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //use cookies to get information
        string     v1     = "";
        string     v2     = "";
        HttpCookie cookie = Request.Cookies["Name"];

        if (cookie != null) //need to check in case the user disabled cookies
        {
            v1 = cookie["fn"];
            v2 = cookie["em"];
        }

        /*if ((v1=="") && (v2==""))
         * {   //this will be replaced later with Session variables so it can be handled better.
         *  //It should happen that if the user clicks on the my account link after logging in, they will be taken to the main page.
         *  //But if they click on the link without loggin in, they will be taken to the login page.
         *  //Right now, if the user clicks on the My Account link any time, it will go to the login page.
         *  Response.Redirect("login.aspx");
         * }*/
        if (v1 != null)
        {
            // LblMsg.Text = "Welcome " + v1 + " !";
            fname = v1;
        }


        if (v2 != null)
        {
            uname            = v2;
            hiddenEmail.Text = uname;
        }

        this.DataBind(); //must call this method in order to do single-value binding



        if (Session["email"] != null)
        {
            hiddenEmail.Text = (string)Session["email"];
            uname            = (string)Session["email"];
            fname            = CustomerDB.GetOneValue("Select fname from customer where email = '" + (string)Session["email"] + "';");
        }
        else
        {
            Response.Redirect("login.aspx");  //if the user access the my account page without login, it will go to the login page
        }
        //update the shopping cart
        if (Session["totalCartItems"] != null)
        {
            TxtTotal.Text = "$" + System.Convert.ToString(Cart.GetTotalAmount((List <CartItem>)Session["CartItems"]));

            //Build the table and add cart details
            HtmlTable transTable = new HtmlTable();
            transTable.Border      = 1;
            transTable.CellPadding = 3;
            transTable.CellSpacing = 3;
            transTable.BorderColor = "White";

            HtmlTableRow  row;
            HtmlTableCell cell;
            row  = new HtmlTableRow();
            cell = new HtmlTableCell();
            int             rowCount = 0;
            List <CartItem> items    = (List <CartItem>)Session["CartItems"];
            cell.InnerHtml = "<b>ItemNumber</b>";
            row.Cells.Add(cell);
            cell           = new HtmlTableCell();
            cell.InnerHtml = "<b>Quantity</b>";
            row.Cells.Add(cell);
            transTable.Rows.Add(row);
            for (int i = 0; i < items.Count; i++)
            {
                row = new HtmlTableRow();

                cell           = new HtmlTableCell();
                cell.Width     = "100px";
                cell.InnerHtml = items[i].ItemNumber;
                row.Cells.Add(cell);

                cell           = new HtmlTableCell();
                cell.Width     = "100px";
                cell.InnerHtml = "1";
                row.Cells.Add(cell);

                transTable.Rows.Add(row);
            }
            LstItems.Controls.Add(transTable);
        }
        else
        {
            LstMsg.Text = "No Items in Cart";
        }
    }
コード例 #41
0
        protected void Page_Load(object sender, EventArgs e)
        {
            /// TODO: Dynamiclly build your book collection with the following information
            /// 1. Book title
            /// 2. Author's LastName and FirstName
            /// 3. Price
            /// 4. Publish date
            /// 5. Publisher's name
            /// 6. Genre
            ///

            HtmlTable BookCollection = new HtmlTable();

            // Set the table's formatting-related properties.
            BookCollection.Border      = 1;
            BookCollection.CellPadding = 3;
            BookCollection.CellSpacing = 3;
            BookCollection.BorderColor = "blue";

            // Start adding content to the table.
            HtmlTableRow  row;
            HtmlTableCell cell;

            for (int i = 1; i <= 6; i++)
            {
                // Create a new row and set its background color.
                row         = new HtmlTableRow();
                row.BgColor = (i % 2 == 0 ? "green" : "red");
                for (int j = 1; j <= 4; j++)
                {
                    cell = new HtmlTableCell();
                    row.Cells.Add(cell);
                }

                BookCollection.Rows.Add(row);
            }

            this.Controls.Add(BookCollection);



            // 1. Create a SqlConnection object
            SqlConnection conn = new SqlConnection();

            conn.ConnectionString = WebConfigurationManager.ConnectionStrings["DBConnectionString"].ConnectionString;

            // 2. Create a SqlCommand object using the above connection object
            SqlCommand cmd = new SqlCommand();

            cmd.Connection  = conn;
            cmd.CommandText = "Your SQL statements go there";
            cmd.Parameters.AddWithValue(@"BookTitle", bktitle);
            cmd.Parameters.AddWithValue(@"AuthorLastAndFirst", atNumTxt);
            cmd.Parameters.AddWithValue(@"Price", PriceTxt);
            cmd.Parameters.AddWithValue(@"PublishDate", PubDate);
            cmd.Parameters.AddWithValue(@"PublishersName", PubName);
            cmd.Parameters.AddWithValue(@"Genre", Genre);
            // 3. Open the connection and execute the command
            // store the returned data in a SqlDataReader object
            conn.Open();
            SqlDataReader reader = cmd.ExecuteReader();

            // 4. if there is data in the SqlDataReader object
            // then loop through each record to build the table to display the books
            if (reader.HasRows)
            {
                // Build the table
            }
        }
コード例 #42
0
ファイル: ParseHL7.aspx.cs プロジェクト: rasamats/HL7Parser
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            string    text        = inputHL7.Text;
            HtmlTable table       = new HtmlTable();
            HtmlTable parsedTable = new HtmlTable();

            HtmlTableRow row;
            HtmlTableRow pRow;

            HtmlTableCell cell1;
            HtmlTableCell cell2;

            HtmlTableCell pCell;
            //parsedHL7.Text="<Table>";
            string[] arrStr = Regex.Split(text, @"\r?\n|\r");

            for (int i = 0; i < arrStr.Length; i++)
            {
                if (arrStr[i] == "")
                {
                    continue;
                }
                row = new HtmlTableRow();
                int      ind            = arrStr[i].IndexOf("|");
                string   linkName       = arrStr[i].Substring(0, ind);
                string   rest           = arrStr[i].Substring(ind + 1);
                string[] supportedLinks = { "MSH", "EVN", "PID", "MRG", "PV1", "DG1", "IN1", "GT1", "NK1", "ZM1", "ZM2", "NTE", "OBR", "OBX", "ORC", "FT1" };
                if (!supportedLinks.Contains(linkName))
                {
                    continue;
                }
                cell1 = new HtmlTableCell();
                HyperLink hl = new HyperLink();
                hl.NavigateUrl = "javascript:ParseDetail('" + linkName + @"','" + rest + @"')";
                hl.Text        = linkName;
                cell1.Controls.Add(hl);
                row.Cells.Add(cell1);

                cell2           = new HtmlTableCell();
                cell2.InnerText = rest;
                row.Cells.Add(cell2);
                table.Rows.Add(row);
            }
            this.Controls.Add(table);

            //parsedTable.Visible = false;
            parsedTable.ID = "tListView";
            pRow           = new HtmlTableRow();
            pCell          = new HtmlTableCell();

            Label pLabel = new Label();
            pLabel.ID   = "tagID";
            pLabel.Text = "TagValue";
            pCell.Controls.Add(pLabel);
            pRow.Cells.Add(pCell);
            parsedTable.Rows.Add(pRow);
            for (int lblCnt = 1; lblCnt < 75; lblCnt++)
            {
                if ((lblCnt % 2) == 1)
                {
                    pRow = new HtmlTableRow();
                }
                pCell       = new HtmlTableCell();
                pLabel      = new Label();
                pLabel.ID   = "lblID" + lblCnt;
                pLabel.Text = lblCnt + ": ";
                pCell.Controls.Add(pLabel);
                pRow.Cells.Add(pCell);
                if ((lblCnt % 2) == 0)
                {
                    parsedTable.Rows.Add(pRow);
                }
            }

            this.Controls.Add(parsedTable);
        }
    }
    /// <summary>
    /// Hide the row bcz exist in.
    /// </summary>
    /// <param name="e"></param>
    /// <param name="sFlightNumber"></param>
    /// <param name="hTable"></param>
    private void NoShowSegmnet(object sender, string sFlightNumber, HtmlTable hTable, string HoraSalida, string HoraLlegada,
                               bool Ida, string sAeropuertoOrigen)
    {
        //clsCache cCache = new csCache().cCache();
        try
        {
            clsIATAVirtual csIata = new clsIATAVirtual();
            csIata = csIata.sObtenerIataVirtual(cCache.AeropuertoOrigen.SCodigo, cCache.AeropuertoDestino.SCodigo);
            if (Ida)
            {
                bool     bEncontrado  = false;
                string[] sAeropuertos = csIata.sIda.Split(',');
                for (int a = 0; a < sAeropuertos.Length; a++)
                {
                    if (cCache.AeropuertoOrigen.SCodigo == sAeropuertos[a])
                    {
                        bEncontrado = true;
                    }
                }
                if (!bEncontrado)
                {
                    hTable.Visible = false;
                }
                else
                {
                    for (int i = 0; i < ((Repeater)sender).Items.Count; i++)
                    {
                        Label lbl            = (Label)((Repeater)sender).Items[i].FindControl("lblFly");
                        Label lblHoraSalida  = (Label)((Repeater)sender).Items[i].FindControl("lblHourDeparture");
                        Label lblHoraLlegada = (Label)((Repeater)sender).Items[i].FindControl("lblHourArrival");

                        if (lbl.Text.Equals(sFlightNumber) && lblHoraSalida.Text.Equals(HoraSalida) && lblHoraLlegada.Text.Equals(HoraLlegada))
                        {
                            hTable.Visible = false;
                        }
                    }
                }
            }
            else
            {
                bool     bEncontrado  = false;
                string[] sAeropuertos = csIata.sIda.Split(',');
                for (int a = 0; a < sAeropuertos.Length; a++)
                {
                    if (cCache.AeropuertoOrigen.SCodigo == sAeropuertos[a])
                    {
                        bEncontrado = true;
                    }
                }
                if (!bEncontrado)
                {
                    hTable.Visible = false;
                }
                else
                {
                    for (int i = 0; i < ((Repeater)sender).Items.Count; i++)
                    {
                        Label lbl            = (Label)((Repeater)sender).Items[i].FindControl("lblFly");
                        Label lblHoraSalida  = (Label)((Repeater)sender).Items[i].FindControl("lblHourDeparture");
                        Label lblHoraLlegada = (Label)((Repeater)sender).Items[i].FindControl("lblHourArrival");

                        if (lbl.Text.Equals(sFlightNumber) && lblHoraSalida.Text.Equals(HoraSalida) && lblHoraLlegada.Text.Equals(HoraLlegada))
                        {
                            hTable.Visible = false;
                        }
                    }
                }
            }
        }
        catch { }
    }
コード例 #44
0
    protected void GeraHtml(HtmlTable table, Relatorio relatorio)
    {
        List <Parametro> parametros     = relatorio.parametros;
        string           relatorio_nome = relatorio.relatorio;

        if (parametros.Count > 0)
        {
            string tamanho = "200px";
            System.Text.StringBuilder scriptAjax = new System.Text.StringBuilder();

            foreach (var par in parametros)
            {
                HtmlTableRow row = new HtmlTableRow();

                Label label1 = new Label();
                label1.ID      = "lbl" + par.parametro;
                label1.Text    = par.descricao;
                label1.Visible = par.visivel == "S";

                HtmlTableCell cell = new HtmlTableCell();
                cell.Controls.Add(label1);;
                row.Cells.Add(cell);

                if (par.componente_web == "DropDownList")
                {
                    DropDownList DropDownList1 = new DropDownList();
                    DropDownList1.ID      = "Param_" + par.parametro;
                    DropDownList1.Visible = par.visivel == "S";
                    DropDownList1.Enabled = par.habilitado == "S";
                    DropDownList1.Style.Add("width", tamanho);

                    if (par.dropdowlist_consulta.Length > 0)
                    {
                        RelatorioBLL relBLL = new RelatorioBLL();
                        CarregaDropDowDT(relBLL.ListarDrop(par.dropdowlist_consulta), DropDownList1);
                    }

                    if (par.valor_inicial.Length > 0)
                    {
                        DropDownList1.SelectedValue = par.valor_inicial;
                    }



                    HtmlTableCell cell1 = new HtmlTableCell();
                    cell1.Controls.Add(DropDownList1);
                    row.Cells.Add(cell1);
                }

                if (par.componente_web == "TextBox")
                {
                    ///////////////CONDIÇÃO EXCLUSIVA PARA O RELATÓRIO_CONTROLE_LIBERAÇÃO_FATURA//////////////////////
                    if (relatorio_nome == "Rel_Controle_liberacao.rpt" &&
                        par.parametro.Equals("matricula"))
                    {
                        label1.Visible = false;
                        var user = (ConectaAD)Session["objUser"];

                        HiddenField hdnField = new HiddenField();
                        hdnField.ID = "Param_" + par.parametro;
                        if ((user.nome == "Wendel Lemes") || (user.nome == "Ana Claudia Alves Santos") || (user.nome == "Soraya Diba Alves de Lima"))
                        {
                            par.valor_inicial = " ";
                        }

                        else
                        {
                            par.valor_inicial = user.login;
                        }


                        if (par.valor_inicial.Length > 0)
                        {
                            hdnField.Value = (par.valor_inicial.ToUpper() == "SYSDATE") ? DateTime.Now.ToString("dd/MM/yyyy") : par.valor_inicial;
                        }

                        HtmlTableCell cell2 = new HtmlTableCell();
                        cell2.Controls.Add(hdnField);;
                        row.Cells.Add(cell2);
                    }
                    ///////////////FIM DA CONDIÇÃO EXCLUSIVA PARA O RELATÓRIO_CONTROLE_LIBERAÇÃO_FATURA//////////////////////
                    else
                    {
                        TextBox TextBox1 = new TextBox();
                        TextBox1.ID      = "Param_" + par.parametro;
                        TextBox1.Visible = par.visivel == "S";
                        TextBox1.Style.Add("width", tamanho);
                        TextBox1.Enabled = par.habilitado == "S";

                        if (par.tipo == "DateField")
                        {
                            TextBox1.CssClass = "date";
                            TextBox1.Attributes.Add("onkeypress", "javascript:return mascara(this, data);");
                            TextBox1.Attributes.Add("MaxLength", "10");
                        }
                        else if (par.tipo == "NumberField")
                        {
                            TextBox1.CssClass = "number";
                            TextBox1.Attributes.Add("onkeypress", "javascript:return mascara(this, soNumeros);");
                            TextBox1.Attributes.Add("MaxLength", "10");
                        }

                        if (par.valor_inicial.Length > 0)
                        {
                            TextBox1.Text = (par.valor_inicial.ToUpper() == "SYSDATE") ? DateTime.Now.ToString("dd/MM/yyyy") : par.valor_inicial;
                        }
                        HtmlTableCell cell2 = new HtmlTableCell();
                        cell2.Controls.Add(TextBox1);;
                        row.Cells.Add(cell2);
                    }
                }
                table.Rows.Add(row);
            }
        }
    }
    /// <summary>
    /// Load Hour &&minuts
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void RptSegmentosIda_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        //if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem) return;

        //clsCache cCache = new csCache().cCache();
        DataTable   dtNewvalue = null;
        DataRowView drv        = (DataRowView)(e.Item.DataItem);
        string      IdFly      = drv.Row["FlightNumber"].ToString();
        TimeSpan    dHour;

        List <clsTotal> ListTotal = new List <clsTotal>();
        clsTotal        objTota   = new clsTotal();
        RadioButton     rb        = (RadioButton)e.Item.FindControl("rbtnSel");
        string          script    = "SetUniqueRadioButton('RptSegmentosIda.*', '" + rb.ClientID + "')";

        rb.Attributes.Add("onclick", script);
        var lblOdeId = ((Label)e.Item.FindControl("lblOdeId")).Text;

        HtmlTable tblIda = ((HtmlTable)e.Item.FindControl("tblIda"));

        //if (IdFly.Equals("14"))
        //{
        //    int i = 0;
        //}

        if (Session["$DsFilter"] != null)
        {
            ListTotal = (List <clsTotal>)Session["$DsFilter"];
        }

        ////Hide tbale when exist in teh current datalist
        //NoShowSegmnet(sender, IdFly, tblIda);
        string sIdaVuleta = "I";

        if (Etipo == Enum_TipoTrayecto.Ida)
        {
            sIdaVuleta = "R";
        }
        dtNewvalue = getRealArrival(lblOdeId.ToString(), sIdaVuleta);

        int IndicadorFila = 0;

        for (int i = 0; i < dtNewvalue.Rows.Count; i++)
        {
            if (dtNewvalue.Rows[i]["strDepartureAirport"].ToString().Equals(cCache.AeropuertoOrigen.SCodigo))
            {
                IndicadorFila = i;
            }
        }

        ((Label)e.Item.FindControl("lblTimeFly")).Text = ((Label)e.Item.FindControl("lblTimeFly")).Text + "Min";
        if (dtNewvalue != null && dtNewvalue.Rows.Count > 1)
        {
            ((Label)e.Item.FindControl("lblCiudadLlegada")).Text    = dtNewvalue.Rows[dtNewvalue.Rows.Count - 1]["strCiudad_LLegada"].ToString();
            ((LinkButton)e.Item.FindControl("lblHederIda")).Text    = (dtNewvalue.Rows.Count - 1).ToString() + " Paradas";//dtNewvalue.Rows[dtNewvalue.Rows.Count - 1]["strParadas"].ToString() + "Paradas";
            ((Label)e.Item.FindControl("lblHourArrival")).Text      = Convert.ToDateTime(dtNewvalue.Rows[dtNewvalue.Rows.Count - 1]["dtmFechaLlegada"]).ToString("HH:mm:ss");
            ((Label)e.Item.FindControl("lblCiudadLlegadaCod")).Text = dtNewvalue.Rows[dtNewvalue.Rows.Count - 1]["strArrivalAirport"].ToString();

            //Diferncia total en horas del trayecto
            dHour = Convert.ToDateTime((dtNewvalue.Rows[dtNewvalue.Rows.Count - 1]["dtmFechaLlegada"])).Subtract(Convert.ToDateTime(((Label)e.Item.FindControl("lblHourTotal")).Text));

            ((Label)e.Item.FindControl("lblTimeFly")).Text = dHour.Minutes.ToString() + " Min";
            if (dHour.TotalMinutes >= 60)
            {
                int iHora   = Convert.ToInt16((dHour.TotalHours));
                int iMinuts = dHour.Minutes;
                //INT iMinuts = Math.Round(iHora - (Convert.ToInt32(iHora)),2);
                ((Label)e.Item.FindControl("lblTimeFly")).Text = iHora.ToString() + " Hr " + iMinuts.ToString() + " Min";
            }
            objTota.StopQuantity        = (dtNewvalue.Rows.Count - 1).ToString();
            objTota.strMarketingAirline = dtNewvalue.Rows[dtNewvalue.Rows.Count - 1]["strMarketingAirline"].ToString();
            objTota.strNombre_Aerolinea = dtNewvalue.Rows[dtNewvalue.Rows.Count - 1]["strNombre_Aerolinea"].ToString();
            objTota.urlImagenAerolinea  = dtNewvalue.Rows[dtNewvalue.Rows.Count - 1]["urlImagenAerolinea"].ToString();
            objTota.intPrecioDesde      = this.getTotal(lblOdeId);
        }
        else
        {
            dHour = Convert.ToDateTime((dtNewvalue.Rows[dtNewvalue.Rows.Count - 1]["dtmFechaLlegada"])).Subtract(Convert.ToDateTime(((Label)e.Item.FindControl("lblHourTotal")).Text));
            ((Label)e.Item.FindControl("lblTimeFly")).Text = dHour.Minutes.ToString() + " Min";
            if (dHour.TotalMinutes >= 60)
            {
                int iHora   = Convert.ToInt16((dHour.TotalHours));
                int iMinuts = dHour.Minutes;
                //INT iMinuts = Math.Round(iHora - (Convert.ToInt32(iHora)),2);
                ((Label)e.Item.FindControl("lblTimeFly")).Text = iHora.ToString() + " Hr " + iMinuts.ToString() + " Min";
            }
            try
            {
                if (Convert.ToInt16(((LinkButton)e.Item.FindControl("lblHederIda")).Text) > 0)
                {
                    ((LinkButton)e.Item.FindControl("lblHederIda")).Text = ((LinkButton)e.Item.FindControl("lblHederIda")).Text + " Parada";
                }
            }
            catch { }


            objTota.StopQuantity        = "0";
            objTota.strMarketingAirline = ((Label)e.Item.FindControl("lblMarketingAirline")).Text;
            objTota.strNombre_Aerolinea = ((Label)e.Item.FindControl("lblNameAir")).Text;
            objTota.urlImagenAerolinea  = ((Image)e.Item.FindControl("ImgAir")).ImageUrl;
            objTota.intPrecioDesde      = this.getTotal(lblOdeId);
        }


        if (
            (ListTotal.Exists(delegate(clsTotal p) { return(p.strMarketingAirline == objTota.strMarketingAirline && objTota.intPrecioDesde < p.intPrecioDesde); })) ||
            (!ListTotal.Exists(delegate(clsTotal p) { return(p.strMarketingAirline == objTota.strMarketingAirline); })) ||
            (ListTotal.Count == 0)
            )
        {
            ListTotal.Add(objTota);
            ListTotal.RemoveAll(delegate(clsTotal p) { return(p.strMarketingAirline == objTota.strMarketingAirline && p.intPrecioDesde > objTota.intPrecioDesde); });
        }
        //Cuando es la primera vez asigna el valor
        if (Session["$DsFilter"] == null)
        {
            Session["$DsFilter"] = ListTotal;
        }
        ////Hide tbale when exist in teh current datalist
        string HoraSalida = Convert.ToDateTime(drv.Row["dtmFechaSalida"]).ToString("HH:mm:ss");

        try
        {
            NoShowSegmnet(sender, IdFly, tblIda, HoraSalida, ((Label)e.Item.FindControl("lblHourArrival")).Text, true, dtNewvalue.Rows[IndicadorFila]["strDepartureAirport"].ToString());
        }
        catch { }
    }
コード例 #46
0
    private void FillDownloadFileList()
    {
        var infokitcategorylist = from infokitdet in dataclasses.InfokitCategories
                                  where infokitdet.Status == 1
                                  orderby infokitdet.DisplayOrder ascending
                                  select infokitdet;

        if (infokitcategorylist.Count() > 0)
        {
            int           i             = 1;
            HtmlTable     dtInfikitList = new HtmlTable(); dtInfikitList.Width = "275";
            HtmlTableRow  trInfokitList;
            HtmlTableCell tcellInfokitList;
            foreach (var categorylist in infokitcategorylist)
            {
                string categoryname = categorylist.CategoryName.ToString();
                int    categoryid   = int.Parse(categorylist.CategoryId.ToString());
                //Label lblGroupname = new Label();
                //lblGroupname.Font.Bold = true;
                //lblGroupname.Font.Size = 14;
                //lblGroupname.Text = categoryname;
                //trInfokitList = new HtmlTableRow();
                //tcellInfokitList = new HtmlTableCell();
                //tcellInfokitList.Controls.Add(lblGroupname);
                //trInfokitList.Cells.Add(tcellInfokitList);
                //dtInfikitList.Rows.Add(trInfokitList);

                var downloadfilelist = from downloadablefiles in dataclasses.InfokitFileLists
                                       where downloadablefiles.CategoryId == categoryid
                                       orderby downloadablefiles.DisplayOrder ascending
                                       select downloadablefiles;
                if (downloadfilelist.Count() > 0)
                {
                    //blank cell
                    Label lblGroupname = new Label(); lblGroupname.Width = 25; lblGroupname.Text = "";
                    trInfokitList    = new HtmlTableRow();
                    tcellInfokitList = new HtmlTableCell();
                    tcellInfokitList.Controls.Add(lblGroupname);
                    trInfokitList.Cells.Add(tcellInfokitList);
                    dtInfikitList.Rows.Add(trInfokitList);
                    // if files exists under current category then add category name ..
                    lblGroupname           = new Label(); lblGroupname.ForeColor = Color.Maroon;
                    lblGroupname.Font.Bold = true;
                    lblGroupname.Font.Size = 10;
                    lblGroupname.Text      = categoryname;
                    trInfokitList          = new HtmlTableRow();
                    tcellInfokitList       = new HtmlTableCell(); //tcellInfokitList.Style.Add("text-align", "center");
                    tcellInfokitList.Controls.Add(lblGroupname);
                    trInfokitList.Cells.Add(tcellInfokitList);
                    dtInfikitList.Rows.Add(trInfokitList);


                    foreach (var filelist in downloadfilelist)
                    {
                        trInfokitList    = new HtmlTableRow();
                        tcellInfokitList = new HtmlTableCell();
                        LinkButton lbtnFileName = new LinkButton();
                        lbtnFileName.ID              = "FileName_" + i.ToString();
                        lbtnFileName.Text            = filelist.DisplayName; lbtnFileName.Font.Size = 9;
                        lbtnFileName.Font.Underline  = false;
                        lbtnFileName.CommandName     = "FileName" + i.ToString();
                        lbtnFileName.CommandArgument = "images/InfoKitFiles/" + filelist.InfoFileName;
                        lbtnFileName.Click          += new EventHandler(lbtnFileName_Click);
                        tcellInfokitList.Controls.Add(lbtnFileName);
                        trInfokitList.Cells.Add(tcellInfokitList);
                        dtInfikitList.Rows.Add(trInfokitList);

                        i++;
                    }
                }
            }

            pnlDownloadFileList.Controls.Clear();
            pnlDownloadFileList.Controls.Add(dtInfikitList);
        }
    }
コード例 #47
0
ファイル: Home.aspx.cs プロジェクト: TotoCafe/TotoCafe
    private Panel createInformationPanel(int TableID)
    {
        Panel pnlInfo = new Panel();
        infoTable = cmp.GetTableWithId(TableID);
        float totalPrice = 0;
        Dictionary<int, Product> products = new Dictionary<int, Product>();

        foreach (Category c in cmp.GetCategoryCollection().Values)
        {
            foreach (var p in c.GetProducts)
            {
                products.Add(p.Key, p.Value);
            }
        }

        HtmlTable table = new HtmlTable();
        HtmlTableRow row;
        HtmlTableCell cell;
        Button btn;

        row = new HtmlTableRow();
        row.Attributes["class"] = "headRow";

        cell = new HtmlTableCell();
        cell.InnerText = "Product ID";
        row.Cells.Add(cell);

        cell = new HtmlTableCell();
        cell.InnerText = "Product Name";
        row.Cells.Add(cell);

        cell = new HtmlTableCell();
        cell.InnerText = "Amount";
        row.Cells.Add(cell);

        cell = new HtmlTableCell();
        cell.InnerText = "Product Price";
        row.Cells.Add(cell);

        table.Rows.Add(row);

        foreach (Order o in infoTable.ActiveController.getOrders().Values)
        {
            Product product = products[o.ProductID];
            totalPrice += product.Price * o.Amount;

            row = new HtmlTableRow();
            row.Attributes["class"] = "contentRow";

            cell = new HtmlTableCell();
            cell.InnerText = product.ProductID.ToString();
            row.Cells.Add(cell);

            cell = new HtmlTableCell();
            cell.InnerText = product.ProductName;
            row.Cells.Add(cell);

            cell = new HtmlTableCell();
            cell.InnerText = o.Amount.ToString();
            row.Cells.Add(cell);

            cell = new HtmlTableCell();
            cell.InnerText = (product.Price * o.Amount).ToString();
            row.Cells.Add(cell);

            table.Rows.Add(row);
        }
        table.Style["margin"] = "auto";
        pnlInfo.Controls.Add(table);

        btn = new Button();
        btn.Text = "Back";
        btn.Click += BtnBack_Click;
        pnlInfo.Controls.Add(btn);

        btn = new Button();
        btn.Text = "Pay";
        btn.Click += BtnPay_Click;
        pnlInfo.Controls.Add(btn);

        Label lblTotalPrice = new Label();
        lblTotalPrice.Text = "Total: " + totalPrice.ToString();
        lblTotalPrice.ForeColor = System.Drawing.Color.Black;
        pnlInfo.Controls.Add(lblTotalPrice);

        pnlInfo.Style["color"] = "black";
        pnlInfo.Style["text-align"] = "center";
        return pnlInfo;
    }
コード例 #48
0
ファイル: Logs.aspx.cs プロジェクト: cloughin/VoteProject.5
 public static HtmlTableRow Add_Tr_To_Table_Return_Tr(HtmlTable htmlTable, string rowClass)
 {
     return(Add_Tr_To_Table_Return_Tr(htmlTable, rowClass, string.Empty));
 }
コード例 #49
0
    public HtmlTable htbDisplayData(string strQuery, string strWidth)
    {
        HtmlTable    htbReturn = new HtmlTable();
        HtmlTableRow htrRow    = new HtmlTableRow();



        bool   blnDisplayHeader = false;
        string strValue         = "";
        int    intRowCount      = 0;

        if (strWidth != "")
        {
            htbReturn.Style.Add("width", strWidth);
        }
        for (int intCount = 0; intCount < arlColumns.Count; intCount++)
        {
            udsColumns objC = (udsColumns)arlColumns[intCount];
            if (objC.strHeaderText.Length > 0)
            {
                blnDisplayHeader = true;
                break;
            }
        }
        if (blnDisplayHeader == true)
        {
            for (int intCount = 0; intCount < arlColumns.Count; intCount++)
            {
                udsColumns    objC    = (udsColumns)arlColumns[intCount];
                HtmlTableCell htcCell = new HtmlTableCell();
                htcCell.InnerText = objC.strHeaderText;
                htcCell.ID        = "tc_" + objC.strHeaderText;
                htcCell.Attributes.Add("class", objC.strHeaderClass);
                htcCell.Attributes.Add("style", "text-align:center");
                htrRow.Controls.Add(htcCell);
            }
            htbReturn.Controls.Add(htrRow);
        }

        if (objDB.blnOpenResultSet(strQuery) == true)
        {
            if (objDB.blnHasRecords == false)
            {
                htrRow = new HtmlTableRow();
                HtmlTableCell tdCell = new HtmlTableCell();
                tdCell.InnerText = "----------------NO RECORD FOUND----------------------";
                tdCell.ColSpan   = arlColumns.Count;
                tdCell.Attributes.Add("style", "text-align:center;color:#FF0000");
                htrRow.Controls.Add(tdCell);
                htbReturn.Controls.Add(htrRow);
                return(htbReturn);
            }
            while (objDB.blnResultsMoveNextRow() == true)
            {
                intRowCount++;
                htrRow = new HtmlTableRow();
                for (int intCount = 0; intCount < arlColumns.Count; intCount++)
                {
                    udsColumns objC = (udsColumns)arlColumns[intCount];
                    strValue = objDB.objResultsValue(objC.strColumnName).ToString();
                    string strBackgroundColor;
                    double dblToAdd = 0;
                    if (objDB.strResultsColName(0) != "BackgroundColor")
                    {
                        strBackgroundColor = "#FFFFFF";
                    }
                    else
                    {
                        strBackgroundColor = objDB.objResultsValue("BackgroundColor").ToString();
                    }
                    switch (objC.strTotal)
                    {
                    case "S":
                        dblToAdd = double.Parse(objDB.objResultsValue(objC.strColumnName).ToString());
                        break;

                    case "C":
                        dblToAdd = 1;
                        break;

                    case "A":
                        dblToAdd = double.Parse(objDB.objResultsValue(objC.strColumnName).ToString());
                        break;
                    }
                    arrTotals[intCount] = arrTotals[intCount] + dblToAdd;
                    if (strValue == "")
                    {
                        strValue = "&nbsp";
                    }
                    htrRow.Controls.Add(htcDisplayRecords(strValue, objC.strDataType, objC.strFormat, objC.strColumnClass, objC.strAlign));
                    htrRow.BgColor = strBackgroundColor;
                    htrRow.Attributes.Add("onmouseover", "this.style.backgroundColor='#CCCCCC';");
                    htrRow.Attributes.Add("onmouseout", "this.style.backgroundColor='" + strBackgroundColor + "';");
                }
                htbReturn.Controls.Add(htrRow);
            }
        }
        objDB.blnCloseConnection();

        if (blnDisplayTotals == true)
        {
            htrRow = new HtmlTableRow();
            for (int intCount = 0; intCount < arlColumns.Count; intCount++)
            {
                udsColumns    objC    = (udsColumns)arlColumns[intCount];
                HtmlTableCell htcCell = new HtmlTableCell();
                switch (objC.strTotal)
                {
                case "S":
                    strValue = arrTotals[intCount].ToString(objC.strFormat);
                    break;

                case "C":
                    strValue = arrTotals[intCount].ToString(objC.strFormat);
                    break;

                case "A":
                    strValue = ((arrTotals[intCount]) / (intRowCount)).ToString(objC.strFormat);
                    break;

                default:
                    strValue = "&nbsp;";
                    break;
                }
                if (intCount == 0)
                {
                    strValue = "Total : ";
                }
                htcCell.InnerHtml = strValue;
                htcCell.ID        = "tc_" + objC.strColumnName;
                htcCell.Attributes.Add("class", objC.strHeaderClass);
                htcCell.Attributes.Add("style", "text-align:center");
                htrRow.Controls.Add(htcCell);
            }
            htbReturn.Controls.Add(htrRow);
        }

        return(htbReturn);
    }
コード例 #50
0
    protected void dgAulas_ItemDataBound(object sender, DataGridItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
        {
            DropDownList ddlAtividade        = (DropDownList)e.Item.FindControl("ddlAtividade");
            Label        lblData             = (Label)e.Item.FindControl("lblData");
            TextBox      txtDescricao        = (TextBox)e.Item.FindControl("txtDescricao");
            Label        lblDescData         = (Label)e.Item.FindControl("lblDescData");
            Label        lblCorDaData        = (Label)e.Item.FindControl("lblCorDaData");
            Label        lblRecursosAlocados = (Label)e.Item.FindControl("lblRecursosAlocados");
            //lblRecursosAlocados.ReadOnly = true;
            Label lblRecursosAlocadosId = (Label)e.Item.FindControl("lblRecursosAlocadosId");
            Label lblAulaId             = (Label)e.Item.FindControl("lblAulaId");
            Label lblAula = (Label)e.Item.FindControl("lblAula");
            Label lblHora = (Label)e.Item.FindControl("lblHora");

            Panel        pnRecursos  = (Panel)e.Item.FindControl("pnRecursos");
            HtmlTable    tabRecursos = (HtmlTable)e.Item.FindControl("tabRecursos");
            int          i           = tabRecursos.Rows[0].Cells[0].Controls.Count;
            CheckBoxList cbRecursos  = (CheckBoxList)tabRecursos.Rows[0].Cells[0].Controls[1];

            ImageButton butDel    = (ImageButton)e.Item.FindControl("butDeletar");
            ImageButton butTransf = (ImageButton)e.Item.FindControl("butTransferir");
            ImageButton butTrocar = (ImageButton)e.Item.FindControl("butTrocar");

            //CheckBoxList cbRecursos = (CheckBoxList) tabRecursos.FindControl("cbRecursos");

            //Label tmp2 = new Label();
            //tmp2.Text = "boo";
            //pnRecursos.Controls.Add(tmp2);
            //Label tmp3 = new Label();
            //tmp3.Text = "boo2";
            //pnRecursos.Controls.Add(tmp3);
            //pnRecursos.BackColor = Color.Red;
            Color cor = argb[0];

            //txtDescricao.Attributes.Add("onkeyup", "setDirtyFlag()");
            //string call = "testAlert(this," + lblAula.Text + ")";
            //txtDescricao.Attributes.Add("onkeyup", call);
            //txtDescricao.Attributes.Add("onkeyup", "this.className='changed'");

            Label lbl = (Label)e.Item.FindControl("lblAula");
            lbl.Text = "";

            listCData = cdataBo.GetCategoriaDatas();

            DateTime dataAtual = Convert.ToDateTime(lblData.Text);

            List <Recurso> livres = recursosBO.GetRecursosDisponiveis(dataAtual, lblHora.Text);
            livres.Sort();
            Recurso dummy = new Recurso();
            dummy.Descricao = "Selecionar...";
            dummy.Id        = dummyGuid;
            livres.Insert(0, dummy);
            DropDownList ddlDisponiveis = (DropDownList)e.Item.FindControl("ddlDisponiveis");
            ddlDisponiveis.DataValueField = "Id";
            ddlDisponiveis.DataTextField  = "Descricao";
            ddlDisponiveis.DataSource     = livres;
            ddlDisponiveis.DataBind();

            ddlAtividade.DataValueField = "Id";
            ddlAtividade.DataTextField  = "Descricao";
            ddlAtividade.DataSource     = listaAtividades;
            ddlAtividade.DataBind();

            ddlAtividade.SelectedValue = categorias[0].ToString();

            //Data data = null;
            //verifica as datas para pintar as linhas

            // Associa a chamada da funçao Javascript para setar a dirty flag + trocar cor
            string num = cont2.ToString();
            if (cont2++ < 10)
            {
                num = "0" + num;
            }
            string call = "testAlert(this,'" + num + "')";
            txtDescricao.Attributes.Add("onkeyup", call);

            if ((dataAtual >= cal.InicioG2))
            {
                e.Item.BackColor = Color.LightGray;
            }
            else
            {
                Data data = VerificaData(dataAtual);
                if (data != null)
                {
                    foreach (CategoriaData c in listCData)
                    {
                        if (c.Id == data.Categoria.Id)
                        {
                            if (!c.DiaLetivo)
                            {
                                e.Item.BackColor  = c.Cor;
                                e.Item.Enabled    = false;
                                lblCorDaData.Text = "True";
                                txtDescricao.Text = c.Descricao + (txtDescricao.Text != "Feriado" ? " (era " + txtDescricao.Text + ")" : "");
                            }
                            else
                            {
                                facin = (bool)Session["facin"];
                                if (facin)
                                {
                                    lblDescData.Text  = c.Descricao;
                                    txtDescricao.Text = c.Descricao;                                    // + " "+facin; // + " - " + txtDescricao.Text;
                                    //txtDescricao.Text = txtDescricao.Text;
                                    e.Item.BackColor  = c.Cor;
                                    lblCorDaData.Text = "True";
                                }
                                else
                                {
                                    e.Item.BackColor  = cor;
                                    lblCorDaData.Text = "False";
                                }
                                lbl.Text = (cont++).ToString();
                                break;
                            }

                            /*else
                             * {
                             *  lblDescData.Text = c.Descricao;
                             *  txtDescricao.Text = c.Descricao + "\n" + txtDescricao.Text;
                             * }*/
                        }
                    }
                }
                else
                {
                    e.Item.BackColor  = cor;
                    lblCorDaData.Text = "False";
                    lbl.Text          = (cont++).ToString();
                    // Associa a chamada da funçao Javascript para setar a dirty flag + trocar cor

                    /*string num = cont.ToString();
                     * if (cont < 10)
                     *  num = "0" + num;
                     * string call = "testAlert(this,'" + num + "')";
                     * txtDescricao.Attributes.Add("onkeyup", call);
                     */
                }
            }

            AtualizaComponentes(e.Item, lblData.Text, lblHora.Text, lblAulaId.Text);

            /*
             */

            categorias.RemoveAt(0);
            argb.RemoveAt(0);
        }
    }
コード例 #51
0
    // 報表************************************************************************************************************************
    private string GetReport()
    {
        HtmlTable table = new HtmlTable();
        HtmlTableRow row;
        HtmlTableCell cell;
        CssStyleCollection css;
        StringWriter sw = new StringWriter();
        HtmlTextWriter htw = new HtmlTextWriter(sw);

        DataTable dt = GetDataTable();

        if (dt.Rows.Count == 0)
        {
            //lblReport.Text = "";
            ShowSysMsg("查無資料");
            return "";
        }

        foreach (DataRow dr in dt.Rows)
        {
            string strFontSize = "14px";

            table = new HtmlTable();
            table.Border = 1;
            table.BorderColor = "black";
            table.CellPadding = 0;
            table.CellSpacing = 0;
            table.Align = "center";
            css = table.Style;
            css.Add("font-size", strFontSize);
            css.Add("font-family", "標楷體");
            css.Add("width", "700px");

            string strColor = "lightgrey";  //字的顏色
            string strBackGround = "darkseagreen"; //cell 顏色
            string strMarkColor = "'background-color:'''"; // 字的底色
            string strMemberColor = "color:red"; //聯絡人的字顏色
            string strDtaeColor = "color:black"; //聯絡人的字顏色
            string strWeight = ""; //字體
            string strHeight = "20px";//欄高

            //------------------------------------------------
            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("font-weight", strWeight);
            css.Add("height", "20px");
            Util.AddTDLine(css, 123, strColor);
            cell.InnerHtml = "<span style= " + strMemberColor + " >103 年 &nbsp; 月 &nbsp; 日</span>";
            row.Cells.Add(cell);
            //----------------------------------------------------
            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("font-weight", strWeight);
            css.Add("height", "20px");
            Util.AddTDLine(css, 123, strColor);
            cell.InnerHtml = "<span style= " + strDtaeColor + " >轉介日期:" + DateTime.Now.ToShortDateString() + "</span>";// font-weight:bold;
            row.Cells.Add(cell);

            //---------------------------------------------------
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("font-weight", strWeight);
            css.Add("height", "20px");
            Util.AddTDLine(css, 123, strColor);
            cell.InnerHtml = "<span style= " + strMemberColor + " >轉介教會:" + Name;
            row.Cells.Add(cell);
            table.Rows.Add(row);
            //----------------------------------------------------
            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("font-weight", strWeight);
            css.Add("height", "20px");
            Util.AddTDLine(css, 123, strColor);
            cell.InnerHtml = "<span style= " + strMemberColor + " >電話:" + dr["Phone"].ToString() + "</span>";// font-weight:bold;
            row.Cells.Add(cell);

            //---------------------------------------------------
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            // css.Add("font-weight", strWeight)
            css.Add("height", strHeight); ;
            Util.AddTDLine(css, 23, strColor);
            cell.InnerHtml = "<span style=" + strMemberColor + ">來電諮詢別(大類):" + Util.TrimLastChar(dr["ConsultantMain"].ToString(), ',') + "&nbsp;</span>";
            row.Cells.Add(cell);
            table.Rows.Add(row);
            //------------------------------------------------------------------

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("font-weight", strWeight);
            css.Add("height", "25px");
            Util.AddTDLine(css, 123, strColor);
            cell.InnerHtml = "<span style=" + strMemberColor + " >姓名:" + dr["Cname"].ToString() + "</span> ";
            row.Cells.Add(cell);
            //table.Rows.Add(row);

            //------------------------------------------------------------------

            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            // css.Add("font-weight", strWeight);
            css.Add("height", strHeight);
            Util.AddTDLine(css, 23, strColor);
            cell.RowSpan = 3;
            cell.InnerHtml = "<span style=" + strMemberColor + " >來電諮詢別(分項):" + Util.TrimLastChar(dr["ConsultantItem"].ToString(), ',') + "&nbsp;</span>";
            row.Cells.Add(cell);
            table.Rows.Add(row);
            //-------------------------------------------------

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("font-weight", strWeight);
            css.Add("height", "30px");
            Util.AddTDLine(css, 123, strColor);
            cell.InnerHtml = "<span style=" + strMemberColor + " >性別:" + dr["Sex"].ToString() + "</span>";
            row.Cells.Add(cell);
            table.Rows.Add(row);
            //------------------------------------------------------------------
            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.InnerHtml = "<span style=" + strMemberColor + " >婚姻:" + Util.TrimLastChar(dr["Marry"].ToString(), ',') + "</span>&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);
            //------------------------------------------------------------------

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            //cell.RowSpan = 2;
            cell.ColSpan = 2;
            if (dr["FullAddress"].ToString() != "")
            {
                cell.InnerHtml = "<span style=" + strMemberColor + " >8.地址:" + dr["FullAddress"].ToString() + "</span> ";
            }
            else
            {
                cell.InnerHtml = "<span style=" + strMemberColor + " >8.地址:" + dr["Overseas"].ToString().TrimEnd(',') + "</span> ";
            }
            row.Cells.Add(cell);
            table.Rows.Add(row);

            table.RenderControl(htw);

            table = new HtmlTable();
            table.Border = 1;
            table.BorderColor = "black";
            table.CellPadding = 0;
            table.CellSpacing = 0;
            table.Align = "center";
            css = table.Style;
            css.Add("font-size", strFontSize);
            css.Add("font-family", "標楷體");
            css.Add("width", "700px");

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "center");
            css.Add("font-size", strFontSize);
            css.Add("background", strBackGround);
            Util.AddTDLine(css, 23, strColor);
            cell.InnerHtml = "<span style=font-weight:bold>求助者的主訴(用第一人稱 '我' 敘述)</span>";
            cell.ColSpan = 3;
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            //css.Add("font-weight", strWeight);
            css.Add("height", strHeight);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "<span style=font-weight:bold>A(事件):</span>" + dr["Event"].ToString() + "&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("height", strHeight);
            // css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.InnerHtml = "<span style=font-weight:bold>B(想法):</span>" + dr["Think"].ToString() + "&nbsp;";
            cell.ColSpan = 3;
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("height", strHeight);
            //  css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.InnerHtml = "<span style=font-weight:bold>C(感受):</span>" + dr["Feel"].ToString() + "&nbsp;";
            cell.ColSpan = 3;
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("height", strHeight);
            //css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "<span style=font-weight:bold>補充說明:</span>" + dr["Comment"].ToString() + "&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);
            table.RenderControl(htw);

            table = new HtmlTable();
            table.Border = 1;
            table.BorderColor = "black";
            table.CellPadding = 0;
            table.CellSpacing = 0;
            table.Align = "center";
            css = table.Style;
            css.Add("font-size", strFontSize);
            css.Add("font-family", "標楷體");
            css.Add("width", "700px");

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "center");
            css.Add("font-size", strFontSize);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "  由轉介之教會填寫 (敬請一個月內回覆告知) &nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            cell.InnerHtml = " <span style=font-weight:bold >A、問題摘要:&nbsp;<P>";
            cell.InnerHtml += " <span style=font-weight:bold >關懷簡述:  :&nbsp;<P>";
            cell.InnerHtml += " <span style=font-weight:bold >B、後續跟進:&nbsp;<br>";
            cell.InnerHtml += " <span style=font-weight:bold >1.□受洗:&nbsp;<br>";
            cell.InnerHtml += " <span style=font-weight:bold >2.□穩定聚會(有參加主日或其他小組聚會):&nbsp;<br>";
            cell.InnerHtml += " <span style=font-weight:bold >3.□偶而參加聚會:&nbsp;<br>";
            cell.InnerHtml += " <span style=font-weight:bold >4.□不肯進入教會   (原因:           ) :&nbsp;<br>";
            cell.InnerHtml += " <span style=font-weight:bold >5.□其他:  &nbsp;<P>";

            cell.InnerHtml += " <span style=font-weight:bold >C、關懷方式:&nbsp;<BR>";
            cell.InnerHtml += " <span style=font-weight:bold >1.□進入教會的關懷系統(小組/團契等) :&nbsp;<P>";
            cell.InnerHtml += " <span style=font-weight:bold >2.□繼續保持聯繫(電話或探訪):&nbsp;<br>";
            cell.InnerHtml += " <span style=font-weight:bold >3.□曾經聯繫過但目前中斷,原因:&nbsp;<br>";
            cell.InnerHtml += " <span style=font-weight:bold >4.□其他:&nbsp;<P>";
            cell.InnerHtml += " <span style=font-weight:bold >D、建 議:&nbsp;<br>";
            cell.InnerHtml += " <span style=font-weight:bold >&nbsp;<br>&nbsp;<br>&nbsp;<br>";

            row.Cells.Add(cell);
            table.Rows.Add(row);
            table.RenderControl(htw);
        }
        //轉成 html 碼========================================================================

        return htw.InnerWriter.ToString();

        //再改就翻掉
        //        <table border="1" bordercolor="black" cellpadding="0" cellspacing="0" align="center" style="font-size:14px;font-family:標楷體;width:700px;">
        //    <tr>
        //        <td style="text-align:left;font-size:14px;font-weight:;height:20px;border-left:1px solid lightgrey;border-top: 1px solid lightgrey;border-right:1px solid lightgrey;"><span style= color:black >轉介日期:2015/4/9</span></td>
        //        <td style="text-align:left;font-size:14px;font-weight:;height:20px;border-left:1px solid lightgrey;border-top: 1px solid lightgrey;border-right:1px solid lightgrey;"><span style= color:red >轉介教會:士林靈糧堂</td>
        //    </tr>
        //    <tr>
        //        <td style="text-align:left;font-size:14px;font-weight:;height:20px;border-left:1px solid lightgrey;border-top: 1px solid lightgrey;border-right:1px solid lightgrey;"><span style= color:red >電話:0</span></td>
        //        <td style="text-align:left;font-size:14px;height:20px;border-top:1px solid  lightgrey;border-right:1px solid  lightgrey;"><span style=color:red>來電諮詢別(大類):親子&nbsp;</span></td>
        //    </tr>
        //    <tr>
        //        <td style="text-align:left;font-size:14px;font-weight:;height:25px;border-left:1px solid lightgrey;border-top: 1px solid lightgrey;border-right:1px solid lightgrey;"><span style=color:red >姓名:李小姐-板橋 網路電話77</span> </td>
        //        <td style="text-align:left;font-size:14px;height:20px;border-top:1px solid  lightgrey;border-right:1px solid  lightgrey;" rowspan="3"><span style=color:red >來電諮詢別(分項):&nbsp;</span></td>
        //    </tr>
        //    <tr>
        //        <td style="text-align:left;font-size:14px;font-weight:;height:30px;border-left:1px solid lightgrey;border-top: 1px solid lightgrey;border-right:1px solid lightgrey;"><span style=color:red >性別:女</span></td>
        //    </tr>
        //    <tr>
        //        <td style="text-align:left;font-size:14px;font-weight:;border-top:1px solid  lightgrey;border-right:1px solid  lightgrey;"><span style=color:red >婚姻:已婚</span>&nbsp;</td>
        //    </tr>
        //    <tr>
        //        <td style="text-align:left;font-size:14px;font-weight:;border-top:1px solid  lightgrey;border-right:1px solid  lightgrey;" colspan="2"><span style=color:red >8.地址:</span> </td>
        //    </tr>
        //</table>
        //<table border="1" bordercolor="black" cellpadding="0" cellspacing="0" align="center" style="font-size:14px;font-family:標楷體;width:700px;">
        //    <tr>
        //        <td style="text-align:center;font-size:14px;background:darkseagreen;border-top:1px solid  lightgrey;border-right:1px solid  lightgrey;" colspan="3"><span style=font-weight:bold>求助者的主訴(用第一人稱 '我' 敘述)</span></td>
        //    </tr>
        //    <tr>
        //        <td style="text-align:left;font-size:14px;height:20px;border-top:1px solid  lightgrey;border-right:1px solid  lightgrey;" colspan="3"><span style=font-weight:bold>A(事件):</span>幫朋友問親子相處問題&nbsp;</td>
        //    </tr>
        //    <tr>
        //        <td style="text-align:left;font-size:14px;height:20px;border-top:1px solid  lightgrey;border-right:1px solid  lightgrey;" colspan="3"><span style=font-weight:bold>B(想法):</span>&nbsp;</td>
        //    </tr>
        //    <tr>
        //        <td style="text-align:left;font-size:14px;height:20px;border-top:1px solid  lightgrey;border-right:1px solid  lightgrey;" colspan="3"><span style=font-weight:bold>C(感受):</span>&nbsp;</td>
        //    </tr>
        //    <tr>
        //        <td style="text-align:left;font-size:14px;height:20px;border-top:1px solid  lightgrey;border-right:1px solid  lightgrey;" colspan="3"><span style=font-weight:bold>補充說明:</span>&nbsp;</td>
        //    </tr>
        //    <tr>
        //        <td style="text-align:left;font-size:14px;border-top:1px solid  lightgrey;border-right:1px solid  lightgrey;" colspan="3">&nbsp;</td>
        //    </tr>
        //</table>
        //<table border="1" bordercolor="black" cellpadding="0" cellspacing="0" align="center" style="font-size:14px;font-family:標楷體;width:700px;">
        //    <tr>
        //        <td style="text-align:center;font-size:14px;border-top:1px solid  lightgrey;border-right:1px solid  lightgrey;" colspan="3">  由轉介之教會填寫 (敬請一個月內回覆告知) &nbsp;</td>
        //    </tr>
        //    <tr>
        //        <td> <span style=font-weight:bold >A、問題摘要:&nbsp;<P> <span style=font-weight:bold >關懷簡述:  :&nbsp;<P> <span style=font-weight:bold >B、後續跟進:&nbsp;<br> <span style=font-weight:bold >1.□受洗:&nbsp;<br> <span style=font-weight:bold >2.□穩定聚會(有參加主日或其他小組聚會):&nbsp;<br> <span style=font-weight:bold >3.□偶而參加聚會:&nbsp;<br> <span style=font-weight:bold >4.□不肯進入教會   (原因:           ) :&nbsp;<br> <span style=font-weight:bold >5.□其他:  &nbsp;<P> <span style=font-weight:bold >C、關懷方式:&nbsp;<BR> <span style=font-weight:bold >1.□進入教會的關懷系統(小組/團契等) :&nbsp;<P> <span style=font-weight:bold >2.□繼續保持聯繫(電話或探訪):&nbsp;<br> <span style=font-weight:bold >3.□曾經聯繫過但目前中斷,原因:&nbsp;<br> <span style=font-weight:bold >4.□其他:&nbsp;<P> <span style=font-weight:bold >D、建 議:&nbsp;<br> <span style=font-weight:bold >&nbsp;<br>&nbsp;<br>&nbsp;<br></td>
        //    </tr>
        //</table>
    }
コード例 #52
0
        public void TestMethod_IssueCenterSearchFilter()
        {
            string HitscountString;
            int    hitsCount;

            //Read the datasheet
            ReadData();

            //Login to the system
            myManager.ActiveBrowser.NavigateTo(_Url);
            CommonFunctions.HandleSpashScreen(myManager, myManager.ActiveBrowser);
            myManager.ActiveBrowser.WaitUntilReady();
            myManager.ActiveBrowser.RefreshDomTree();
            CommonFunctions.Login(myManager, myManager.ActiveBrowser, _Uname, _Password);
            Thread.Sleep(7000);

            //Navigate to IssueCenter
            string navigateURL;

            navigateURL = _Url + "/bugs-wishes/";
            myManager.ActiveBrowser.NavigateTo(navigateURL);
            Thread.Sleep(5000);


            //Search For a bug
            myManager.ActiveBrowser.WaitUntilReady();
            myManager.ActiveBrowser.RefreshDomTree();

            ObjIssueCenter  issueCenter  = new ObjIssueCenter(myManager);
            HtmlInputText   SearchText   = issueCenter.SearchTextBox.As <HtmlInputText>();
            HtmlInputButton SearchButton = issueCenter.SearchButton.As <HtmlInputButton>();

            SearchText.Text = _SearchText;
            SearchButton.MouseClick();
            //It takes sometime to load the results
            Thread.Sleep(7000);
            myManager.ActiveBrowser.WaitUntilReady();
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlTable ResultSet = issueCenter.SearchTable.As <HtmlTable>();


            Element HitsCount = issueCenter.HitsCount;

            //HtmlDiv HitsCount = ResultSet.Find.ById("searchResultSummary").As<HtmlDiv>();

            HitscountString = HitsCount.InnerText;
            hitsCount       = CommonFunctions.ExtractNumberFromSrting(HitscountString);

            //Verify the number of rows are actually displyed in the table
            Assert.AreEqual(hitsCount, ResultSet.BodyRows.Count);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            //verify search in rersult
            HtmlDiv         div            = myManager.ActiveBrowser.Find.ById("searchTbl_filter").As <HtmlDiv>();
            HtmlInputSearch searchinResult = div.ChildNodes[0].ChildNodes[1].As <HtmlInputSearch>();

            searchinResult.Text = _SearchInResult;
            myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, searchinResult.GetRectangle());
            myManager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter);
            Thread.Sleep(5000);
            ResultSet.Refresh();
            myManager.ActiveBrowser.RefreshDomTree();

            string result = ResultSet.Rows[0].Cells[0].InnerText;

            //Verify the searched sesult from the grid
            Assert.AreEqual(result, _SearchInResult);

            //open the popup
            ResultSet.Rows[0].MouseClick(MouseClickType.LeftDoubleClick);

            Thread.Sleep(5000);
            myManager.ActiveBrowser.WaitUntilReady();
            myManager.ActiveBrowser.RefreshDomTree();
            //Click on track This issue
            Element TrackSLider = issueCenter.TrackSlider;

            if (TrackSLider != null)
            {
                Thread.Sleep(2000);
                myManager.ActiveBrowser.Actions.Click(TrackSLider);

                Thread.Sleep(3000);
                myManager.ActiveBrowser.WaitUntilReady();
                myManager.ActiveBrowser.RefreshDomTree();

                HtmlDiv trackMessage    = issueCenter.TrackValidator.As <HtmlDiv>();
                string  trackMessageext = trackMessage.InnerText;
                Assert.IsTrue(trackMessageext.Contains("Added to your tracking list."));

                //remove from the tracking list
                Thread.Sleep(2000);
                myManager.ActiveBrowser.Actions.Click(TrackSLider);
            }
            //Add a comment
            ArtOfTest.WebAii.Core.Browser t1_frame = myManager.ActiveBrowser.Frames[0];
            Element TextEditor = t1_frame.Find.ByXPath("/html/body");

            myManager.ActiveBrowser.Actions.SetText(TextEditor, _Comment);

            HtmlAnchor Submitbutton = issueCenter.SubmitComment.As <HtmlAnchor>();

            Submitbutton.ScrollToVisible();
            Submitbutton.MouseClick();

            //Click on open in a new tab
            HtmlAnchor OpenNewtab = issueCenter.OpenNewTab.As <HtmlAnchor>();

            OpenNewtab.MouseClick();

            Thread.Sleep(5000);
            myManager.ActiveBrowser.Refresh();
            //Validate Comments in the page
            myManager.ActiveBrowser.WaitUntilReady();
            myManager.ActiveBrowser.Window.SetFocus();

            HtmlDiv Comments = issueCenter.Comments.As <HtmlDiv>();

            Assert.IsTrue(Comments.InnerText.Contains(_Comment));
        }
コード例 #53
0
        /// <summary>
        /// Selects the row on the page based on the row number provided
        /// </summary>
        private HtmlTable SelectRowOnPage(string rowNumber)
        {
            var list = this.UIXeroSalesWindowsInteWindow.UIXeroNewRepeatingInvoDocument;
            var tableOnScreen = new HtmlTable(list);

            //tag instance identifies which row it's using
            tableOnScreen.SearchProperties.Add(HtmlTable.PropertyNames.TagInstance, rowNumber, PropertyExpressionOperator.EqualTo);
            return tableOnScreen;
        }
コード例 #54
0
    void LoadControls()
    {
        HtmlTable tbl = new HtmlTable();

        tbl.ID = "tblAtts";
        HtmlTableRow  tr;
        HtmlTableCell td;
        int           indexer = 0;

        if (product.Attributes != null)
        {
            selectedAttributes = new Attributes();
            foreach (Commerce.Common.Attribute att in product.Attributes)
            {
                tr = new HtmlTableRow();
                td = new HtmlTableCell();

                Label lblSingle = new Label();
                lblSingle.Text = "<br><b>" + att.Name + ":</b>";
                if (att.Description != string.Empty)
                {
                    lblSingle.Text += "<br><span class=smalltext>" + att.Description + "</span><br>";
                }
                lblSingle.ID = "lbl" + att.Name + indexer.ToString();
                td.Controls.Add(lblSingle);
                indexer++;
                switch (att.SelectionType)
                {
                case AttributeType.SingleSelection:
                    lblSingle.Text += "&nbsp;";
                    DropDownList ddl = new DropDownList();
                    ddl.ID             = att.Name;
                    ddl.DataSource     = att.Selections;
                    ddl.DataTextField  = "FormattedValue";
                    ddl.DataValueField = "Value";
                    ddl.DataBind();
                    ddl.SelectedIndex = 0;
                    td.Controls.Add(ddl);

                    break;

                case AttributeType.MultipleSelection:
                    lblSingle.Text += "<br>";
                    CheckBoxList chkList = new CheckBoxList();
                    chkList.ID             = att.Name;
                    chkList.DataSource     = att.Selections;
                    chkList.DataTextField  = "Value";
                    chkList.DataValueField = "Value";
                    chkList.DataBind();
                    td.Controls.Add(chkList);
                    break;

                case AttributeType.UserInput:
                    lblSingle.Text += "<br>";
                    TextBox t = new TextBox();
                    t.ID       = att.Name;
                    t.TextMode = TextBoxMode.MultiLine;
                    t.Height   = Unit.Pixel(80);
                    t.Width    = Unit.Pixel(120);
                    td.Controls.Add(t);

                    break;
                }
                tr.Cells.Add(td);
                tbl.Rows.Add(tr);
            }
            pnlAttControls.Controls.Add(tbl);
        }
    }
コード例 #55
0
    private void FillFillBlanksQuestionInstructions()
    {
        int testSecondVariableId = 0, testFirstVariableId = 0, testSectionID = 0;
        if (Session["CurrentTestSectionId"] != null)
            testSectionID = int.Parse(Session["CurrentTestSectionId"].ToString());

        if (Session["CurrentTestSecondVariableId"] != null)
            testSecondVariableId = int.Parse(Session["CurrentTestSecondVariableId"].ToString());
        if (Session["CurrentTestFirstVariableId"] != null)
            testFirstVariableId = int.Parse(Session["CurrentTestFirstVariableId"].ToString());

        bool valueexists = false;
        DataSet dsInstructiondet = new DataSet();
        string quesrystring = "";
        if (testSecondVariableId > 0)
            quesrystring = "select InstructionDetails,InstructionImage1,InstructionDetails2,InstructionImage2,InstructionDetails3 from TestSectionVariablewiseInstructions where CategoryId =2 and TestId=" + testId + " and TestSectionId =" + testSectionID + " and FirstVariableId=" + testFirstVariableId + " and SecondVariableId =" + testSecondVariableId;
        else if (testFirstVariableId > 0)
            quesrystring = "select InstructionDetails,InstructionImage1,InstructionDetails2,InstructionImage2,InstructionDetails3 from TestSectionVariablewiseInstructions where CategoryId =2 and TestId=" + testId + " and TestSectionId =" + testSectionID + " and FirstVariableId=" + testFirstVariableId;

        dsInstructiondet = clsclass.GetValuesFromDB(quesrystring);

        if (dsInstructiondet != null) if (dsInstructiondet.Tables.Count > 0) if (dsInstructiondet.Tables[0].Rows.Count > 0)
                { //divInstructions.InnerHtml = dsInstructiondet.Tables[0].Rows[0]["InstructionDetails"].ToString(); valueexists = true;
                    string styleproperties = "padding-left: 40px";
                    HtmlTable tblInstructions = new HtmlTable();
                    HtmlTableRow trInstructions = new HtmlTableRow();
                    HtmlTableCell tcellInstructions = new HtmlTableCell();
                    if (dsInstructiondet.Tables[0].Rows[0]["InstructionDetails"].ToString() != null && dsInstructiondet.Tables[0].Rows[0]["InstructionDetails"].ToString() != "")
                    {
                        tcellInstructions.InnerHtml = dsInstructiondet.Tables[0].Rows[0]["InstructionDetails"].ToString();
                        trInstructions.Cells.Add(tcellInstructions);
                        tblInstructions.Rows.Add(trInstructions);
                        valueexists = true;
                    }
                    if (dsInstructiondet.Tables[0].Rows[0]["InstructionImage1"].ToString() != null && dsInstructiondet.Tables[0].Rows[0]["InstructionImage1"].ToString() != "")
                    {
                        trInstructions = new HtmlTableRow();
                        tcellInstructions = new HtmlTableCell();
                        tcellInstructions.InnerHtml = "<div style='" + styleproperties + "'><img alt='' src='QuestionAnswerFiles/InstructionImages/" + dsInstructiondet.Tables[0].Rows[0]["InstructionImage1"].ToString() + "' /></div>";
                        trInstructions.Cells.Add(tcellInstructions);
                        tblInstructions.Rows.Add(trInstructions);
                        valueexists = true;
                    }
                    if (dsInstructiondet.Tables[0].Rows[0]["InstructionDetails2"].ToString() != null && dsInstructiondet.Tables[0].Rows[0]["InstructionDetails2"].ToString() != "")
                    {
                        trInstructions = new HtmlTableRow();
                        tcellInstructions = new HtmlTableCell();
                        tcellInstructions.InnerHtml = dsInstructiondet.Tables[0].Rows[0]["InstructionDetails2"].ToString();
                        trInstructions.Cells.Add(tcellInstructions);
                        tblInstructions.Rows.Add(trInstructions);
                        valueexists = true;
                    }
                    if (dsInstructiondet.Tables[0].Rows[0]["InstructionImage2"].ToString() != null && dsInstructiondet.Tables[0].Rows[0]["InstructionImage2"].ToString() != "")
                    {
                        trInstructions = new HtmlTableRow();
                        tcellInstructions = new HtmlTableCell();
                        tcellInstructions.InnerHtml = "<div style='" + styleproperties + "'><img alt='' src='QuestionAnswerFiles/InstructionImages/" + dsInstructiondet.Tables[0].Rows[0]["InstructionImage2"].ToString() + "' /></div>";
                        trInstructions.Cells.Add(tcellInstructions);
                        tblInstructions.Rows.Add(trInstructions);
                        valueexists = true;
                    }
                    if (dsInstructiondet.Tables[0].Rows[0]["InstructionDetails3"].ToString() != null && dsInstructiondet.Tables[0].Rows[0]["InstructionDetails3"].ToString() != "")
                    {
                        trInstructions = new HtmlTableRow();
                        tcellInstructions = new HtmlTableCell();
                        tcellInstructions.InnerHtml = dsInstructiondet.Tables[0].Rows[0]["InstructionDetails3"].ToString();
                        trInstructions.Cells.Add(tcellInstructions);
                        tblInstructions.Rows.Add(trInstructions);
                        valueexists = true;
                    }
                    divInstructions.Controls.Clear();
                    divInstructions.Controls.Add(tblInstructions);

                }

        if (valueexists == false)
            FillCommonInstructions();
        else FillTitle();
    }
コード例 #56
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int role = -1;

            if (Session["role"] != null)
            {
                int.TryParse(clsRidjindalEncryption.Decrypt(Session["role"].ToString(), "P@ssword", "123", "SHA1", 2, "%1234567890@#$%^", 256), out role);
            }
            if (role != 1)
            {
                Response.Redirect("../default.aspx");
            }
            else
            {
                Response.Write("admin Login!");
            }

            SqlConnection con   = new SqlConnection(Login.GetConnectionString());
            string        query = "select * from LH_category where isActive = 1";

            con.Open();
            SqlCommand    cmd       = new SqlCommand(query, con);
            SqlDataReader dr        = cmd.ExecuteReader();
            HtmlTable     userTable = new HtmlTable();

            userTable.Attributes["id"]    = "userTable";
            userTable.Attributes["class"] = "table table-bordered";
            HtmlTableRow header = new HtmlTableRow();

            HtmlTableCell idHeader = new HtmlTableCell("th");

            idHeader.InnerText = "ID";
            header.Cells.Add(idHeader);

            HtmlTableCell usernameHeader = new HtmlTableCell("th");

            usernameHeader.InnerText = "Name";
            header.Cells.Add(usernameHeader);
            userTable.Rows.Add(header);
            int count = 1;

            while (dr.Read())
            {
                string       rowID = "row_" + count.ToString();
                HtmlTableRow row   = new HtmlTableRow();
                row.Attributes["id"]    = rowID;
                row.Attributes["class"] = "usersRows";
                HtmlTableCell id = new HtmlTableCell("th");
                id.InnerText = dr[0].ToString();
                row.Cells.Add(id);

                HtmlTableCell username = new HtmlTableCell();
                username.InnerText = dr["category_name"].ToString();
                row.Cells.Add(username);



                HtmlTableCell delete = new HtmlTableCell();
                delete.InnerHtml = "<a href='#' onClick='deleteUser(" + dr[0] + "," + count + ")'>Delete</a>";
                row.Cells.Add(delete);

                HtmlTableCell edit = new HtmlTableCell();
                edit.InnerHtml = "<a runat='server' id='edit_" + count + "' href='editCategory.aspx?id=" + dr[0] + "' onClick='editUser(" + dr[0] + ")'>Edit</a>";
                row.Cells.Add(edit);

                userTable.Rows.Add(row);
                count++;
            }
            tableContainer.Controls.Add(userTable);
            con.Close();
        }
コード例 #57
0
 private void button1_Click(object sender, EventArgs e)
 {
     HtmlTable table = new HtmlTable();
     string html = table.GenerateHtml();
 }
 public virtual StringCollection GetHiddenRows(HtmlTable table)
 {
     return((StringCollection)_listOfHiddenRows[table]);
 }
コード例 #59
0
ファイル: QryReport.aspx.cs プロジェクト: samuellin124/cms
    // 報表************************************************************************************************************************
    private string GetReport()
    {
        HtmlTable table = new HtmlTable();
        HtmlTableRow row;
        HtmlTableCell cell;
        CssStyleCollection css;
        StringWriter sw = new StringWriter();
        HtmlTextWriter htw = new HtmlTextWriter(sw);
        //table.Border = 0;
        //table.BorderColor = "black";
        //table.CellPadding = 0;
        //table.CellSpacing = 0;
        //table.Align = "center";
        //css = table.Style;
        //css.Add("font-size", "32pt");
        //css.Add("font-family", "標楷體");
        //css.Add("width", "900px");
        //--------------------------------------------
        DataTable dt = GetDataTable();

        if (dt.Rows.Count == 0)
        {
            lblReport.Text = "";
            ShowSysMsg("查無資料");
            return "";
        }

        foreach (DataRow dr in dt.Rows)
        {
            string strFontSize = "16px";

            table = new HtmlTable();
            table.Border = 1;
            table.BorderColor = "black";
            table.CellPadding = 0;
            table.CellSpacing = 0;
            table.Align = "center";
            css = table.Style;
            css.Add("font-size", strFontSize);
            css.Add("font-family", "標楷體");
            css.Add("width", "900px");

            string strColor = "lightgrey";  //字的顏色
            string strBackGround = "darkseagreen"; //cell 顏色
            string strMarkColor = "'background-color:'''"; // 字的底色
            string strMemberColor = "color:crimson"; //聯絡人的字顏色
            string strWeight = "bold"; //字體
            string strHeight = "20px";//欄高

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("font-weight", strWeight);
            css.Add("height", "20px");
            Util.AddTDLine(css, 123, strColor);
            cell.InnerHtml = "1.電話:<span style= " + strMemberColor + " >" + dr["Phone"].ToString() + "</span>";// font-weight:bold;
            row.Cells.Add(cell);

            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.InnerHtml = "4.年齡約:<span style=" + strMemberColor + "> " + dr["age"].ToString() + "</span>";
            row.Cells.Add(cell);

            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.InnerHtml = "7.轉介教會:<span style=" + strMemberColor + ">" + dr["ChurchYN"].ToString() + "</span>";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("font-weight", strWeight);
            css.Add("height", "25px");
            Util.AddTDLine(css, 123, strColor);
            cell.InnerHtml = "2.姓名:<span style=" + strMemberColor + " >" + dr["Cname"].ToString() + "</span> ";
            row.Cells.Add(cell);

            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.InnerHtml = "5.婚姻:<span style=" + strMemberColor + " >" + Util.TrimLastChar(dr["Marry"].ToString(), ',') + "</span>&nbsp;";
            row.Cells.Add(cell);

            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.RowSpan = 2;
            //cell.ColSpan = 2;
            if (dr["FullAddress"].ToString() != "")
            {
                cell.InnerHtml = "8.地址:<span style=" + strMemberColor + " >" + dr["FullAddress"].ToString() + "</span> ";
            }
            else
            {
                cell.InnerHtml = "8.地址:<span style=" + strMemberColor + " >" + dr["Overseas"].ToString().TrimEnd(',') + "</span> ";
            }
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("font-weight", strWeight);
            css.Add("height", "30px");
            Util.AddTDLine(css, 123, strColor);
            cell.InnerHtml = "3.性別:<span style=" + strMemberColor + " >" + dr["Sex"].ToString() + "</span>";
            row.Cells.Add(cell);

            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.InnerHtml = "6.基督徒:<span style=" + strMemberColor + " >" + dr["Christian"].ToString() + "</span>";
            row.Cells.Add(cell);
            table.Rows.Add(row);
            //table.RenderControl(htw);

            //table = new HtmlTable();
            //table.Border = 0;
            //table.BorderColor = "black";
            //table.CellPadding = 0;
            //table.CellSpacing = 0;
            //table.Align = "center";
            //css = table.Style;
            //css.Add("font-size", strFontSize);
            //css.Add("font-family", "標楷體");
            //css.Add("width", "900px");

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 123, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "備註:<span style=" + strMemberColor + " >" + dr["M_Memo"].ToString() + "</span>";
            row.Cells.Add(cell);
            table.Rows.Add(row);
            table.RenderControl(htw);

            table = new HtmlTable();
            table.Border = 0;
            table.BorderColor = "black";
            table.CellPadding = 0;
            table.CellSpacing = 0;
            table.Align = "center";
            css = table.Style;
            css.Add("font-size", strFontSize);
            css.Add("font-family", "標楷體");
            css.Add("width", "900px");

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("font-weight", strWeight);
            css.Add("height", "30px");
            Util.AddTDLine(css, 123, strColor);
            cell.ColSpan = 1;
            cell.InnerHtml = "志工:<span style=color:darkseagreen >" + dr["ServiceUser"].ToString() + "</span>";
            row.Cells.Add(cell);
            string TotalTalkTime = "";
            DateTime t1, t2;
            if (dr["CreateDate"].ToString() != "" && dr["EndDate"].ToString() != "")
            {
                t1 = DateTime.Parse(Util.DateTime2String(dr["CreateDate"].ToString(), DateType.yyyyMMddHHmmss, EmptyType.ReturnNull));
                t2 = DateTime.Parse(Util.DateTime2String(dr["EndDate"].ToString(), DateType.yyyyMMddHHmmss, EmptyType.ReturnNull));

                TotalTalkTime = DateDiff(t1, t2);
            }

            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "建檔時間:<span style=" + strMarkColor + " >" + Util.DateTime2String(dr["CreateDate"].ToString(), DateType.yyyyMMddHHmmss, EmptyType.ReturnNull) + " " + "</span> &nbsp;結束時間:<span style=" + strMarkColor + " >" + Util.DateTime2String(dr["EndDate"].ToString(), DateType.yyyyMMddHHmmss, EmptyType.ReturnNull) + "</span>&nbsp;" + TotalTalkTime;
            row.Cells.Add(cell);
            table.Rows.Add(row);

            table.RenderControl(htw);

            table = new HtmlTable();
            table.Border = 0;
            table.BorderColor = "black";
            table.CellPadding = 0;
            table.CellSpacing = 0;
            table.Align = "center";
            css = table.Style;
            css.Add("font-size", strFontSize);
            css.Add("font-family", "標楷體");
            css.Add("width", "900px");

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "center");
            css.Add("font-size", "26px");
            css.Add("background", strBackGround);
            Util.AddTDLine(css, 123, strColor);
            cell.Width = "88mm";
            cell.RowSpan = 6;
            cell.InnerHtml = "S";
            row.Cells.Add(cell);

            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "center");
            css.Add("font-size", strFontSize);
            css.Add("background", strBackGround);
            Util.AddTDLine(css, 23, strColor);
            cell.InnerHtml = "<span style=font-weight:bold>求助者的主訴(用第一人稱 '我' 敘述)</span>";
            cell.ColSpan = 3;
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            //css.Add("font-weight", strWeight);
            css.Add("height", strHeight);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "<span style=font-weight:bold>A(事件):</span>" + dr["Event"].ToString() + "&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("height", strHeight);
            // css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.InnerHtml = "<span style=font-weight:bold>B(想法):</span>" + dr["Think"].ToString() + "&nbsp;";
            cell.ColSpan = 3;
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("height", strHeight);
          //  css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.InnerHtml = "<span style=font-weight:bold>C(感受):</span>" + dr["Feel"].ToString() + "&nbsp;";
            cell.ColSpan = 3;
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("height", strHeight);
            //css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "<span style=font-weight:bold>補充說明:</span>" + dr["Comment"].ToString() + "&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "center");
            css.Add("font-size", "26px");
            css.Add("background", strBackGround);
            Util.AddTDLine(css, 123, strColor);
            cell.RowSpan = 6;
            cell.InnerHtml = "O";
            row.Cells.Add(cell);

            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "center");
            css.Add("font-size", strFontSize);
            css.Add("background", strBackGround);
            //css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "<span style=font-weight:bold>客觀分析(諮商類別)</span>";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            // css.Add("font-weight", strWeight)
            css.Add("height", strHeight); ;
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "<span style=font-weight:bold>來電諮詢別(大類):</span>" + Util.TrimLastChar(dr["ConsultantMain"].ToString(), ',') + "&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            // css.Add("font-weight", strWeight);
            css.Add("height", strHeight);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "<span style=font-weight:bold >來電諮詢別(分項):</span>" + Util.TrimLastChar(dr["ConsultantItem"].ToString(), ',') + "&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("height", strHeight);
            // css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            if (dr["HarassOther"].ToString() != "")
            {
                cell.InnerHtml = "<span style=font-weight:bold >騷擾電話:</span>" + Util.TrimLastChar(dr["HarassPhone"].ToString().Replace("其他", ""), ',').TrimEnd(',') + "<span style=font-weight:bold >其他: </span>" + dr["HarassOther"].ToString() + "&nbsp;";
                //cell.InnerHtml = "<span style=font-weight:bold >騷擾電話:</span>" + Util.TrimLastChar(dr["HarassPhone"].ToString(), ',') + "<span style=font-weight:bold >其他: </span>" + dr["HarassOther"].ToString() + "&nbsp;";
            }
            else
            {
                cell.InnerHtml = "<span style=font-weight:bold>騷擾電話:</span>" + Util.TrimLastChar(dr["HarassPhone"].ToString(), ',') + "&nbsp;";
            }

            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            Util.AddTDLine(css, 23, strColor);
            css.Add("height", strHeight);
            // css.Add("font-weight", strWeight);
            cell.ColSpan = 3;
            cell.InnerHtml = "<span style= font-weight:bold>轉介單位(告知電話):</span>" + Util.TrimLastChar(dr["IntroductionUnit"].ToString(), ',') + "&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            //   css.Add("font-weight", strWeight);
            css.Add("height", strHeight);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "<span style= font-weight:bold>緊急轉介(撥打電話):</span>" + Util.TrimLastChar(dr["CrashIntroduction"].ToString(), ',') + "&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "center");
            css.Add("font-size", "26px");
            css.Add("background", strBackGround);
            css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 123, strColor);
            cell.RowSpan = 2;
            cell.InnerHtml = "A";
            row.Cells.Add(cell);

            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "center");
            css.Add("font-size", strFontSize);
            css.Add("background", strBackGround);
            // css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "<span style=font-weight:bold >問題評估</span>&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("height", strHeight);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 1;
            cell.InnerHtml = "<span style=" + strMarkColor + " > " + dr["Problem"].ToString() + " </span>&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            //row = new HtmlTableRow();
            //cell = new HtmlTableCell();
            //css = cell.Style;
            //css.Add("text-align", "left");
            //css.Add("font-size", strFontSize);
            //Util.AddTDLine(css, 23);
            //cell.ColSpan = 3;
            //cell.InnerHtml = "2.因" + dr["Reason2"].ToString() + "造成" + dr["Trouble2"].ToString() + "問題";
            //row.Cells.Add(cell);
            //table.Rows.Add(row);

            //row = new HtmlTableRow();
            //cell = new HtmlTableCell();
            //css = cell.Style;
            //css.Add("text-align", "left");
            //css.Add("font-size", strFontSize);
            //Util.AddTDLine(css, 23);
            //cell.ColSpan = 3;
            //cell.InnerHtml = "3.因" + dr["Reason3"].ToString() + "造成" + dr["Trouble3"].ToString() + "問題";
            //row.Cells.Add(cell);
            //table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "center");
            css.Add("font-size", "26px");
            css.Add("background", strBackGround);
            css.Add("height", strHeight);
            //css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 1234, strColor);
            cell.RowSpan = 8;
            cell.InnerHtml = "P";
            row.Cells.Add(cell);

            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "center");
            css.Add("font-size", strFontSize);
            css.Add("background", strBackGround);
            //css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "<span style= font-weight:bold>計畫</span>";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            // css.Add("font-weight", strWeight);
            css.Add("height", strHeight);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "<span style=font-weight:bold >1.找出案主心中的假設:</span>" + dr["FindAssume"].ToString() + "</span>&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            //css.Add("font-weight", strWeight);
            css.Add("height", strHeight);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "<span style=font-weight:bold >2.與案主討論與解釋假設: </span>" + dr["Discuss"].ToString() + "</span>&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("height", strHeight);
            // css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "<span style=font-weight:bold >3.加入新的元素:</span>" + dr["Element"].ToString() + "&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("height", strHeight);
            //css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = " <span style=font-weight:bold >4.改變案主原先的期待:</span>" + dr["Expect"].ToString() + "&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("height", strHeight);
            // css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.InnerHtml = " <span style=font-weight:bold >5.給予案主祝福與盼望:</span>" + dr["Blessing"].ToString() + "&nbsp;";
            cell.ColSpan = 3;
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("height", strHeight);
            // css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 23, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "<span style=font-weight:bold >6.帶領決志禱告:</span>" + dr["IntroductionChurch"].ToString() + "&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            css.Add("height", strHeight);
            //  css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 234, strColor);
            cell.ColSpan = 3;
            cell.InnerHtml = "<span style=font-weight:bold >7.我對個案的幫助程度:</span>" + dr["HelpLvMark"].ToString() + "&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("height", strHeight);
            css.Add("font-size", strFontSize);
            //css.Add("font-weight", strWeight);
            Util.AddTDLine(css, 134, strColor);
            cell.ColSpan = 6;
            cell.InnerHtml = "<span style=font-weight:bold >小叮嚀:</span>" + dr["Memo"].ToString() + "&nbsp;";
            row.Cells.Add(cell);
            table.Rows.Add(row);

            cell = new HtmlTableCell();
            row = new HtmlTableRow();
            css = cell.Style;
            css.Add("text-align", "left");
            css.Add("font-size", strFontSize);
            cell.InnerHtml = "&nbsp; <BR>";
            row.Cells.Add(cell);
            table.Rows.Add(row);
            table.RenderControl(htw);
        }
        //轉成 html 碼========================================================================

        return htw.InnerWriter.ToString();
    }
 public virtual FormGridRowInfoCollection GetAdditionalRows(HtmlTable table)
 {
     return((FormGridRowInfoCollection)_listOfFormGridRowInfos[table]);
 }