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);
        }
示例#2
0
        public static void AddDropDownList(HtmlTable htmlTable, string resourceClassName, string itemSelectorPath,
            string columnName, bool isNullable, string tableSchema, string tableName, string tableColumn,
            string defaultValue, string displayFields, string displayViews, bool useDisplayViewsAsParent,
            string selectedValues, string errorCssClass)
        {
            var label = LocalizationHelper.GetResourceString(resourceClassName, columnName);

            var dropDownList = GetDropDownList(columnName + "_dropdownlist");

            HtmlAnchor itemSelectorAnchor;

            using (var table = GetTable(tableSchema, tableName, tableColumn, displayViews, useDisplayViewsAsParent))
            {
                SetDisplayFields(dropDownList, table, tableSchema, tableName, tableColumn, displayFields);
                itemSelectorAnchor = GetItemSelector(dropDownList.ClientID, table, itemSelectorPath, tableSchema,
                    tableName, tableColumn, displayViews);
            }

            SetSelectedValue(dropDownList, tableSchema, tableName, tableColumn, defaultValue, selectedValues);

            if (isNullable)
            {
                dropDownList.Items.Insert(0, new ListItem(String.Empty, String.Empty));
                ScrudFactoryHelper.AddDropDownList(htmlTable, label, dropDownList, itemSelectorAnchor, null);
            }
            else
            {
                var required = ScrudFactoryHelper.GetRequiredFieldValidator(dropDownList, errorCssClass);
                ScrudFactoryHelper.AddDropDownList(htmlTable, label + ScrudResource.RequiredFieldIndicator, dropDownList,
                    itemSelectorAnchor, required);
            }
        }
示例#3
0
文件: Labels.cs 项目: hoanien/mixerp
        private void AddTopFormLabels(HtmlTable table)
        {
            using (HtmlTableRow header = new HtmlTableRow())
            {
                TableHelper.AddCell(header, HtmlControlHelper.GetLabelHtml(Titles.ValueDate, "DateTextBox"));

                if (this.ShowStore)
                {
                    TableHelper.AddCell(header, HtmlControlHelper.GetLabelHtml(Titles.SelectStore, "StoreSelect"));
                }

                TableHelper.AddCell(header, HtmlControlHelper.GetLabelHtml(Titles.SelectParty, "PartyCodeInputText"));
                TableHelper.AddCell(header, string.Empty);

                if (this.ShowPriceTypes)
                {
                    TableHelper.AddCell(header, HtmlControlHelper.GetLabelHtml(Titles.PriceType, "PriceTypeSelect"));
                }

                TableHelper.AddCell(header, HtmlControlHelper.GetLabelHtml(Titles.ReferenceNumberAbbreviated, "ReferenceNumberInputText"));
                TableHelper.AddCell(header, string.Empty);
                TableHelper.AddCell(header, string.Empty);

                table.Rows.Add(header);
            }
        }
        public void ASPXToPDF(HtmlTable objhtml1,  HtmlTable objhtml2)
        {
            string fileName = "AsignacionFolios.pdf";
            HttpContext.Current.Response.ClearContent();
            HttpContext.Current.Response.Clear();

            StringWriter sw1 = new StringWriter();
            HtmlTextWriter hw1 = new HtmlTextWriter(sw1);
            objhtml1.RenderControl(hw1);

            StringWriter sw2 = new StringWriter();
            HtmlTextWriter hw2 = new HtmlTextWriter(sw2);
            objhtml2.RenderControl(hw2);

            StringReader sr1 = new StringReader(sw1.ToString());
            StringReader sr2 = new StringReader(sw2.ToString());

            Document pdfDoc = new Document(PageSize.A2, 5f, 5f, 5f, 5f);
            HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
            PdfWriter.GetInstance(pdfDoc, HttpContext.Current.Response.OutputStream);
            pdfDoc.Open();
            htmlparser.Parse(sr1);
            pdfDoc.NewPage();

            htmlparser.Parse(sr2);
            pdfDoc.Close();

            HttpContext.Current.Response.ContentType = "application/pdf";
            HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=" + fileName);
            HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
            HttpContext.Current.Response.Write(pdfDoc);
            HttpContext.Current.Response.End();
        }
        public override Control AddTo(Control container)
        {
            HtmlTableCell labelCell = new HtmlTableCell();
            Label label = AddLabel(labelCell);

            HtmlTableCell editorCell = new HtmlTableCell();
            Control editor = AddEditor(editorCell);
            if (label != null && editor != null && !string.IsNullOrEmpty(editor.ID))
                label.AssociatedControlID = editor.ID;

            HtmlTableCell extraCell = new HtmlTableCell();
            if (Required)
                AddRequiredFieldValidator(extraCell, editor);
            if (Validate)
                AddRegularExpressionValidator(extraCell, editor);

            AddHelp(extraCell);

            HtmlTableRow row = new HtmlTableRow();
            row.Cells.Add(labelCell);
            row.Cells.Add(editorCell);
            row.Cells.Add(extraCell);

            HtmlTable editorTable = new HtmlTable();
            editorTable.Attributes["class"] = "editDetail";
            editorTable.Controls.Add(row);
            container.Controls.Add(editorTable);

            return editor;
        }
示例#6
0
        public static void AddDropDownList(HtmlTable htmlTable, string columnName, bool isNullable, string tableSchema, string tableName, string tableColumn, string defaultValue, string displayFields, string displayViews, string selectedValues)
        {
            string label = LocalizationHelper.GetResourceString("FormResource", columnName);

            DropDownList dropDownList = GetDropDownList(columnName + "_dropdownlist");

            HtmlAnchor itemSelectorAnchor;

            using (System.Data.DataTable table = MixERP.Net.WebControls.ScrudFactory.Data.FormHelper.GetTable(tableSchema, tableName))
            {
                SetDisplayFields(dropDownList, table, tableSchema, tableName, tableColumn, displayFields);
                itemSelectorAnchor = GetItemSelector(dropDownList.ClientID, table, tableSchema, tableName, tableColumn, displayViews);
            }

            SetSelectedValue(dropDownList, tableSchema, tableName, tableColumn, defaultValue, selectedValues);

            if (isNullable)
            {
                dropDownList.Items.Insert(0, new ListItem(String.Empty, String.Empty));
                ScrudFactoryHelper.AddRow(htmlTable, label, dropDownList, itemSelectorAnchor);
            }
            else
            {
                RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(dropDownList);
                ScrudFactoryHelper.AddRow(htmlTable, label + Resources.ScrudResource.RequiredFieldIndicator, dropDownList, required, itemSelectorAnchor);
            }
        }
示例#7
0
文件: TextBox.cs 项目: n4gava/mixerp
        public static void AddTextBox(HtmlTable htmlTable, string columnName, string defaultValue, bool isNullable, int maxLength)
        {
            if (htmlTable == null)
            {
                return;
            }

            if (string.IsNullOrWhiteSpace(columnName))
            {
                return;
            }

            using (TextBox textBox = GetTextBox(columnName + "_textbox", maxLength))
            {
                string label = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", columnName);

                textBox.Text = defaultValue;

                if (!isNullable)
                {
                    RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(textBox);
                    ScrudFactoryHelper.AddRow(htmlTable, label + Resources.ScrudResource.RequiredFieldIndicator, textBox, required);
                    return;
                }

                ScrudFactoryHelper.AddRow(htmlTable, label, textBox);
            }
        }
示例#8
0
        internal static void AddDecimalTextBox(HtmlTable htmlTable, string resourceClassName, string columnName, string label, string description,
            string defaultValue, bool isNullable, int maxLength, string domain, string errorCssClass, bool disabled)
        {
            using (TextBox textBox = ScrudTextBox.GetTextBox(columnName + "_textbox", maxLength))
            {
                if (string.IsNullOrWhiteSpace(label))
                {
                    label = ScrudLocalizationHelper.GetResourceString(resourceClassName, columnName);
                }

                using (CompareValidator validator = GetDecimalValidator(textBox, domain, errorCssClass))
                {
                    textBox.Text = defaultValue;
                    textBox.ReadOnly = disabled;
                    textBox.CssClass = "decimal";

                    if (!string.IsNullOrWhiteSpace(description))
                    {
                        textBox.CssClass += " activating element";
                        textBox.Attributes.Add("data-content", description);
                    }

                    if (!isNullable)
                    {
                        RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(textBox,
                            errorCssClass);
                        ScrudFactoryHelper.AddRow(htmlTable, label + Titles.RequiredFieldIndicator, textBox, validator,
                            required);
                        return;
                    }

                    ScrudFactoryHelper.AddRow(htmlTable, label, textBox, validator);
                }
            }
        }
示例#9
0
        public static void AddDateTextBox(HtmlTable t, string columnName, string defaultValue, bool isNullable, int maxLength)
        {
            string label = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", columnName);

            TextBox textBox = ScrudTextBox.GetTextBox(columnName + "_textbox", maxLength);
            textBox.CssClass = "date";

            CompareValidator validator = GetDateValidator(textBox);
            AjaxControlToolkit.CalendarExtender extender = new AjaxControlToolkit.CalendarExtender();

            textBox.Width = 70;
            extender.ID = textBox.ID + "_calendar_extender";
            extender.TargetControlID = textBox.ID;
            extender.PopupButtonID = textBox.ID;

            if(!string.IsNullOrWhiteSpace(defaultValue))
            {
                textBox.Text = MixERP.Net.Common.Conversion.TryCastDate(defaultValue).ToShortDateString();
            }

            if(!isNullable)
            {
                RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(textBox);
                ScrudFactoryHelper.AddRow(t, label + Resources.ScrudResource.RequiredFieldIndicator, textBox, validator, required, extender);
                return;
            }

            ScrudFactoryHelper.AddRow(t, label, textBox, validator, extender);
        }
示例#10
0
        private void AddTopFormControls(HtmlTable table)
        {
            using (HtmlTableRow row = new HtmlTableRow())
            {
                this.AddDateTextBoxCell(row);

                if (this.ShowStore)
                {
                    AddStoreSelectCell(row);
                }

                AddPartyCodeInputTextCell(row);
                AddPartySelectCell(row);

                if (this.ShowPriceTypes)
                {
                    AddPriceTypeSelectCell(row);
                }

                this.AddReferenceNumberInputTextCell(row);
                this.AddCashTransactionDivCell(row);
                this.AddPaymentTermSelectCell(row);

                table.Controls.Add(row);
            }
        }
示例#11
0
        private HtmlGenericControl GetPartySummaryTab()
        {
            using (HtmlGenericControl partSummaryDiv = ControlHelper.GetGenericControl(@"div", @"ui tab bottom stacked attached green segment"))
            {
                partSummaryDiv.Attributes.Add("data-tab", "party-summary");

                partSummaryDiv.ID = "party-summary";

                using (HtmlTable table = new HtmlTable())
                {
                    table.Attributes.Add("class", "ui table segment");
                    table.Rows.Add(ControlHelper.GetNewRow(Titles.PartyType, @"PartyTypeSpan", @"span"));
                    table.Rows.Add(ControlHelper.GetNewRow(Titles.EmailAddress, @"EmailAddressSpan", @"span"));
                    table.Rows.Add(ControlHelper.GetNewRow(Titles.PANNumber, @"PANNumberSpan", @"span"));
                    table.Rows.Add(ControlHelper.GetNewRow(Titles.SSTNumber, @"SSTNumberSpan", @"span"));
                    table.Rows.Add(ControlHelper.GetNewRow(Titles.CSTNumber, @"CSTNumberSpan", @"span"));
                    table.Rows.Add(ControlHelper.GetNewRow(Titles.CreditAllowed, @"CreditAllowedSpan", @"span"));
                    table.Rows.Add(ControlHelper.GetNewRow(Titles.MaximumCreditPeriod, @"MaxCreditPeriodSpan", @"span"));
                    table.Rows.Add(ControlHelper.GetNewRow(Titles.MaximumCreditAmount, @"MaxCreditAmountSpan", @"span"));
                    table.Rows.Add(ControlHelper.GetNewRow(Titles.GLHead, @"GLHeadSpan", @"span"));
                    table.Rows.Add(ControlHelper.GetNewRow(Titles.DefaultCurrency, @"DefaultCurrencySpan", @"span"));
                    partSummaryDiv.Controls.Add(table);
                }

                return partSummaryDiv;
            }
        }
示例#12
0
        internal static void AddRadioButtonList(HtmlTable htmlTable, string resourceClassName, string columnName, bool isNullable, string keys, string values, string selectedValue, string errorCssClass, bool disabled)
        {
            if (htmlTable == null)
            {
                return;
            }

            using (RadioButtonList radioButtonList = GetRadioButtonList(columnName + "_radiobuttonlist", keys, values, selectedValue))
            {
                string label = ScrudLocalizationHelper.GetResourceString(resourceClassName, columnName);

                radioButtonList.Enabled = !disabled;

                if (!isNullable)
                {
                    using (RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(radioButtonList, errorCssClass))
                    {
                        ScrudFactoryHelper.AddRow(htmlTable, label + Titles.RequiredFieldIndicator, radioButtonList, required);
                        return;
                    }
                }

                ScrudFactoryHelper.AddRow(htmlTable, label, radioButtonList);
            }
        }
示例#13
0
文件: TabBody.cs 项目: roczj/mixerp
        private HtmlGenericControl GetAddressInfoTab()
        {
            using (HtmlGenericControl addressInfoDiv = ControlHelper.GetGenericControl(@"div", @"ui tab bottom stacked attached teal segment"))
            {
                addressInfoDiv.Attributes.Add("data-tab", "contact-info");
                addressInfoDiv.ID = "addresses-and-contact-info";

                using (HtmlGenericControl h3 = ControlHelper.GetGenericControl("h3", "ui header"))
                {
                    h3.InnerHtml = "  <i class='globe icon'></i>" + Titles.AddressAndContactInfo;

                    addressInfoDiv.Controls.Add(h3);
                }

                using (HtmlTable table = new HtmlTable())
                {
                    table.Attributes.Add("class", "ui table segment");
                    table.Rows.Add(ControlHelper.GetNewRow(Titles.DefaultAddress, @"AddressDiv", "div"));
                    table.Rows.Add(ControlHelper.GetNewRow(Titles.ShippingAddresses, @"ShippingAddressesDiv", "div"));
                    addressInfoDiv.Controls.Add(table);
                }

                return addressInfoDiv;
            }
        }
        public void LoadUDFs()
        {
            var udfList = UDF.GetUDFList(_udfLevel, _levelID);

            if (udfList.Count > 0)
            {
                var udfTable = new HtmlTable();
                udfTable.Attributes["class"] = "fieldValueTable";
                udfTable.Width = "100%";

                foreach (UDF udf in udfList)
                {
                    var tableRow = new HtmlTableRow();
                    var labelCell = new HtmlTableCell();
                    var valueCell = new HtmlTableCell();

                    labelCell.Attributes["class"] = "fieldLabel";
                    labelCell.InnerHtml = udf.Name + ":";

                    valueCell.InnerHtml = udf.Value;

                    tableRow.Cells.Add(labelCell);
                    tableRow.Cells.Add(valueCell);

                    udfTable.Rows.Add(tableRow);

                    udfInformationContainer.Controls.Add(udfTable);
                    udfTable.DataBind();
                }
            }
        }
示例#15
0
        protected void btnLiteralTable_Click(object sender, EventArgs e)
        {
            System.Web.UI.HtmlControls.HtmlTable     tableT = new System.Web.UI.HtmlControls.HtmlTable();
            System.Web.UI.HtmlControls.HtmlTableRow  rowR   = new System.Web.UI.HtmlControls.HtmlTableRow();
            System.Web.UI.HtmlControls.HtmlTableCell cellA  = new System.Web.UI.HtmlControls.HtmlTableCell();
            System.Web.UI.HtmlControls.HtmlTableCell cellB  = new System.Web.UI.HtmlControls.HtmlTableCell();

            System.Web.UI.HtmlControls.HtmlTableCell cellC = new System.Web.UI.HtmlControls.HtmlTableCell();
            cellA.InnerText = "t2 C1Header";
            cellB.InnerText = "t2 C2Header";
            cellC.InnerText = "t2 C3Header";
            rowR.Cells.Add(cellA);
            rowR.Cells.Add(cellB);
            rowR.Cells.Add(cellC);
            tableT.Rows.Add(rowR);
            cellA           = new HtmlTableCell();
            cellB           = new HtmlTableCell();
            cellC           = new HtmlTableCell();
            rowR            = new HtmlTableRow();
            cellA.InnerText = "r1c1";
            cellB.InnerHtml = "r2c2";
            cellC.InnerText = "r3c3";
            rowR.Cells.Add(cellA);
            rowR.Cells.Add(cellB);
            rowR.Cells.Add(cellC);
            tableT.Rows.Add(rowR);

            this.Controls.Add(tableT);
        }
        /// <summary>
        /// 功用描述:将Table内容导出为指定格式文件
        /// 创建人:  陈国迎
        /// 创建日期:2006-06-06
        /// </summary>
        /// <param name="objTable">表名</param>
        /// <param name="strFileName">文件名</param>
        /// <param name="strFormat">格式名(调ExportFileType结构体)</param>
        public void ExportHtmlTableToFormatedFile(System.Web.UI.HtmlControls.HtmlTable objTable, string strFileName, string strFormat)
        {
            //清空即有内容
            Response.Clear();

            //定义输出格式
            string strStype = @"<style>.text { mso-number-format:\@; } </style>";

            Response.AddHeader("content-disposition", "attachment;filename=" + HttpUtility.UrlEncode("" + strFileName + "", System.Text.Encoding.UTF8) + "." + strFormat + "");
            Response.Charset         = "utf-8";
            Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            Response.Cache.SetCacheability(HttpCacheability.Public);
            Response.ContentType = "application/vnd." + strFormat + "";

            //定义输出流
            System.IO.StringWriter       stringWrite = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter htmlWrite   = new HtmlTextWriter(stringWrite);
            objTable.RenderControl(htmlWrite);


            Response.Write(strStype);
            Response.Write(stringWrite.ToString());

            //结束输出
            Response.End();
        }
示例#17
0
 public static void CopyData(HtmlTable tblDetail,object outObj)
 {
     foreach (PropertyInfo i in outObj.GetType().GetProperties())
     {
         if (i.PropertyType.FullName.Equals(typeof(string).FullName) == true)
         {
             RadTextBox txt = tblDetail.FindControl(i.Name) as RadTextBox;
             if (txt == null)
             {
                 //thử với CodeList
                 CodeList cl = tblDetail.FindControl(i.Name) as CodeList;
                 if (cl == null) continue;
                 i.SetValue(outObj, cl.CODE, null);
                 continue;
             }
             else
             {
                 i.SetValue(outObj, txt.Text, null);
                 continue;
             }
         }
         if (i.PropertyType.FullName.Equals(typeof(decimal).FullName) == true)
         {
             RadNumericTextBox txt = tblDetail.FindControl(i.Name) as RadNumericTextBox;
             if (txt == null) continue;
             decimal dm = 0;
             if(decimal.TryParse(txt.Text,out dm)==true)
                 i.SetValue(outObj, dm, null);
         }
     }
 }
示例#18
0
文件: TextBox.cs 项目: neppie/mixerp
        public static void AddTextBox(HtmlTable htmlTable, string resourceClassName, string columnName,
            string defaultValue, bool isNullable, int maxLength, string errorCssClass)
        {
            if (htmlTable == null)
            {
                return;
            }

            if (string.IsNullOrWhiteSpace(columnName))
            {
                return;
            }

            using (var textBox = GetTextBox(columnName + "_textbox", maxLength))
            {
                var label = LocalizationHelper.GetResourceString(resourceClassName, columnName);

                textBox.Text = defaultValue;

                if (!isNullable)
                {
                    var required = ScrudFactoryHelper.GetRequiredFieldValidator(textBox, errorCssClass);
                    ScrudFactoryHelper.AddRow(htmlTable, label + ScrudResource.RequiredFieldIndicator, textBox, required);
                    return;
                }

                ScrudFactoryHelper.AddRow(htmlTable, label, textBox);
            }
        }
示例#19
0
        public void AddCollTotalSummaryData(ref System.Web.UI.HtmlControls.HtmlTable tblSummary, ref DataTable dtbTemp)
        {
            //12/16/2005 Q4-Retrofit.Ch1: Added the code to create the heading Payment Type and SubTotal
            HtmlTableRow hRow = new HtmlTableRow();

            AddColumn(ref hRow, "PAYMENT TYPE", 1, 1, "item_template_header_white", "0", "center");
            AddColumn(ref hRow, "SUBTOTAL", 1, 1, "item_template_header_white", "0", "center");
            tblSummary.Rows.Add(hRow);
            //12/16/2005 Q4-Retrofit.Ch1: End
            foreach (DataRow dr in dtbTemp.Rows)
            {
                hRow = new HtmlTableRow();
                decimal dcTot = 0;
                foreach (DataColumn dtCol in dtbTemp.Columns)
                {
                    if (dtCol.ColumnName != "PayType")
                    {
                        dcTot = dcTot + Convert.ToDecimal(dr[dtCol.ColumnName.ToString()].ToString());
                        AddColumn(ref hRow, Convert.ToDecimal(dr[dtCol.ColumnName.ToString()].ToString()).ToString("$##0.00"), 1, 1, "item_template_header_white_nobold", "0", "right");
                    }
                    else
                    {
                        AddColumn(ref hRow, "Total " + dr[dtCol.ColumnName.ToString()].ToString(), 1, 1, "item_template_header_white", "0", "left");
                    }
                }
                //				AddColumn(ref hRow, Convert.ToDecimal(dcTot.ToString()).ToString("$##0.00"), 1,"collection_summary_footer");
                tblSummary.Rows.Add(hRow);
            }
        }
示例#20
0
        public static void AddRadioButtonList(HtmlTable htmlTable, string resourceClassName, string columnName,
            bool isNullable, string keys, string values, string selectedValue, string errorCssClass)
        {
            if (htmlTable == null)
            {
                return;
            }

            using (
                var radioButtonList = GetRadioButtonList(columnName + "_radiobuttonlist", keys, values, selectedValue))
            {
                var label = LocalizationHelper.GetResourceString(resourceClassName, columnName);

                if (!isNullable)
                {
                    using (var required = ScrudFactoryHelper.GetRequiredFieldValidator(radioButtonList, errorCssClass))
                    {
                        ScrudFactoryHelper.AddRow(htmlTable, label + ScrudResource.RequiredFieldIndicator,
                            radioButtonList, required);
                        return;
                    }
                }

                ScrudFactoryHelper.AddRow(htmlTable, label, radioButtonList);
            }
        }
示例#21
0
        public static void AddNumberTextBox(HtmlTable t, string columnName, string defaultValue, bool isSerial, bool isNullable, int maxLength, string domain)
        {
            TextBox textBox = GetNumberTextBox(columnName + "_textbox", maxLength);
            string label = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", columnName);

            if(!defaultValue.StartsWith("nextVal", StringComparison.OrdinalIgnoreCase))
            {
                textBox.Text = defaultValue;
            }

            textBox.Width = 200;

            if(isSerial)
            {
                textBox.ReadOnly = true;
            }
            else
            {
                if(!isNullable)
                {
                    CompareValidator validator = GetNumberValidator(textBox, domain);
                    RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(textBox);
                    ScrudFactoryHelper.AddRow(t, label + Resources.ScrudResource.RequiredFieldIndicator, textBox, validator, required);
                    return;
                }
            }

            ScrudFactoryHelper.AddRow(t, label, textBox);
        }
示例#22
0
        public static void AddField(HtmlTable htmlTable, string resourceClassName, string itemSelectorPath, string columnName, string defaultValue, bool isSerial, bool isNullable, string dataType, string domain, int maxLength, string parentTableSchema, string parentTable, string parentTableColumn, string displayFields, string displayViews, bool useDisplayFieldAsParent, string selectedValues)
        {
            if (htmlTable == null)
            {
                return;
            }

            if (string.IsNullOrWhiteSpace(columnName))
            {
                return;
            }

            if (string.IsNullOrWhiteSpace(parentTableColumn))
            {
                switch (dataType)
                {
                    case "national character varying":
                    case "character varying":
                    case "national character":
                    case "character":
                    case "char":
                    case "varchar":
                    case "nvarchar":
                    case "text":
                        ScrudTextBox.AddTextBox(htmlTable, resourceClassName, columnName, defaultValue, isNullable, maxLength);
                        break;
                    case "smallint":
                    case "integer":
                    case "bigint":
                        ScrudNumberTextBox.AddNumberTextBox(htmlTable, resourceClassName, columnName, defaultValue, isSerial, isNullable, maxLength, domain);
                        break;
                    case "numeric":
                    case "money":
                    case "double":
                    case "double precision":
                    case "float":
                    case "real":
                    case "currency":
                        ScrudDecimalTextBox.AddDecimalTextBox(htmlTable, resourceClassName, columnName, defaultValue, isNullable, maxLength, domain);
                        break;
                    case "boolean":
                        ScrudRadioButtonList.AddRadioButtonList(htmlTable, resourceClassName, columnName, isNullable, ScrudResource.YesNo, "true,false", defaultValue);
                        break;
                    case "date":
                        ScrudDateTextBox.AddDateTextBox(htmlTable, resourceClassName, columnName, defaultValue, isNullable);
                        break;
                    case "bytea":
                        ScrudFileUpload.AddFileUpload(htmlTable, resourceClassName, columnName, isNullable);
                        break;
                    case "timestamp with time zone":
                        //Do not show this field
                        break;
                }
            }
            else
            {
                //Todo: Add an implementation of overriding the behavior of the parent table data being populated into the list.
                ScrudDropDownList.AddDropDownList(htmlTable, resourceClassName, itemSelectorPath, columnName, isNullable, parentTableSchema, parentTable, parentTableColumn, defaultValue, displayFields, displayViews, useDisplayFieldAsParent ,selectedValues);
            }
        }
示例#23
0
        protected void btnLiteralTable_Click(object sender, EventArgs e)
        {
            System.Web.UI.HtmlControls.HtmlTable tableT = new System.Web.UI.HtmlControls.HtmlTable();
            System.Web.UI.HtmlControls.HtmlTableRow rowR = new System.Web.UI.HtmlControls.HtmlTableRow();
            System.Web.UI.HtmlControls.HtmlTableCell cellA = new System.Web.UI.HtmlControls.HtmlTableCell();
            System.Web.UI.HtmlControls.HtmlTableCell cellB = new System.Web.UI.HtmlControls.HtmlTableCell();

            System.Web.UI.HtmlControls.HtmlTableCell cellC = new System.Web.UI.HtmlControls.HtmlTableCell();
            cellA.InnerText = "t2 C1Header";
            cellB.InnerText = "t2 C2Header";
            cellC.InnerText = "t2 C3Header";
            rowR.Cells.Add(cellA);
            rowR.Cells.Add(cellB);
            rowR.Cells.Add(cellC);
            tableT.Rows.Add(rowR);
            cellA = new HtmlTableCell();
            cellB = new HtmlTableCell();
            cellC = new HtmlTableCell();
            rowR = new HtmlTableRow();
            cellA.InnerText = "r1c1";
            cellB.InnerHtml = "r2c2";
            cellC.InnerText = "r3c3";
            rowR.Cells.Add(cellA);
            rowR.Cells.Add(cellB);
            rowR.Cells.Add(cellC);
            tableT.Rows.Add(rowR);

            this.Controls.Add(tableT);
        }
        protected void BuildStudentGrowthTable()
        {
            var table = new HtmlTable();
            var headerRow = new HtmlTableRow();

            table.Width = "100%";
            table.Attributes["class"] = "sgTable";

            //Add header row
            foreach(DataColumn column in _ds.Tables[1].Columns)
            {
                var headerCell = new HtmlTableCell();
                headerCell.Attributes["class"] = "sgTableHeadCell";
                headerCell.InnerHtml = column.ColumnName;
                headerRow.Cells.Add(headerCell);
            }
            table.Rows.Add(headerRow);
            
            //Add body rows
            foreach(DataRow row in _ds.Tables[1].Rows)
            {
                var tableRow = new HtmlTableRow();
                foreach(DataColumn column in _ds.Tables[1].Columns)
                {
                    var tableCell = new HtmlTableCell();
                    tableCell.Attributes["class"] = table.Rows.Count % 2 == 0 ? "" : "altTD";
                    tableCell.InnerHtml = row[column].ToString();
                    tableRow.Cells.Add(tableCell);
                }
                table.Rows.Add(tableRow);
            }

            if (_ds.Tables[1].Rows.Count > 1 || (_ds.Tables[1].Rows.Count > 0 && !_ds.Tables[1].Rows[0][0].ToString().Contains("N/A")))
            {

                //Add spacer row
                var spacerRow = new HtmlTableRow();
                var spacerCell = new HtmlTableCell();
                spacerCell.ColSpan = _ds.Tables[1].Columns.Count;
                spacerCell.InnerHtml = "&nbsp;";
                spacerCell.BgColor = "bababa";
                spacerRow.Cells.Add(spacerCell);
                table.Rows.Add(spacerRow);

                //Add aggregate concordant row
                var concordRow = new HtmlTableRow();
                var concordCell1 = new HtmlTableCell();
                var concordCell2 = new HtmlTableCell();
                concordCell1.ColSpan = _ds.Tables[1].Columns.Count - 1;
                concordCell2.InnerHtml = "Aggregate Concordant = <span class=\"normalText\">" + _aggregateConcordant + "</span>";
                concordCell2.Attributes["class"] = "sgTableHeadCell";
                concordRow.Cells.Add(concordCell1);
                concordRow.Cells.Add(concordCell2);
                table.Rows.Add(concordRow);
            }

            //Add table to panel
            studentGrowDataTable.Controls.Add(table);
        }
示例#25
0
        /// <summary>
        /// Renders a row containing label and control cells to a table.
        /// </summary>
        /// <param name="table">The output table.</param>
        /// <param name="label">The label.</param>
        /// <param name="controls">The collection of controls.</param>
        protected override void RenderRow(HtmlTable table, Control label, Control[] controls)
        {
            HtmlTableRow labelrow = ComposeRow(LabelCellStyle, LabelCellWidth, label);
            table.Controls.Add(labelrow);

            HtmlTableRow controlrow = ComposeRow(ControlCellStyle, ControlCellWidth, controls);
            table.Controls.Add(controlrow);
        }
示例#26
0
文件: sz.aspx.cs 项目: JuRogn/OA
 public static void BuildTableRow(HtmlTable table, TmpAward item)
 {
     var tr = new HtmlTableRow();
     var cell = new HtmlTableCell();
     cell.InnerText = item.TicketNO;
     tr.Cells.Add(cell);
     table.Rows.Add(tr);
 }
        private void LoadData()
        {
            /* Get our standard from TileParms collection. */
            var oStd = (Thinkgate.Base.Classes.Standards)Tile.TileParms.GetParm("standards");

            /* populate controls from our standard. */
            StdsPage_StdsContent_DivStdTitle.InnerText = BuildStdTitle(oStd);
            StdsPage_StdsContent_DivStdText.InnerHtml = oStd.Desc;

            /* populate parent information if our standard has a parent */

            if (oStd.Parent != null)
            {
                StdsPage_StdsContent_DivStdParentTitle.InnerText = BuildStdTitle(oStd.Parent);
                StdsPage_StdsContent_DivStdParentText.InnerHtml = oStd.Parent.Desc;
            }
            else
            {
                StdsPage_StdsContent_DivStdParentTitle.InnerText = "";
                StdsPage_StdsContent_DivStdParentText.InnerText = "";
            }

            /* populate children informationif our standard has children */
            if (oStd.Children.Count >0)
            {
                sb = new StringBuilder("");

                HtmlTable oTbl = new HtmlTable();
                HtmlTableRow oRow;
                HtmlTableCell oCell;
                System.Web.UI.HtmlControls.HtmlGenericControl oDiv;

                foreach (Thinkgate.Base.Classes.Standards oChildStd in oStd.Children)
                {
                    oRow = new HtmlTableRow();
                    oCell = new HtmlTableCell();

                    oDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                    oDiv.Attributes.Add("class", "stdTitle");
                    oDiv.Style.Add("display","block");
                    oDiv.InnerText = BuildStdTitle(oChildStd);

                    oCell.Controls.Add(oDiv);

                    oDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                    oDiv.Attributes.Add("class", "stdText");
                    oDiv.Style.Add("display", "block");
                    oDiv.InnerHtml = oChildStd.Desc;

                    oCell.Controls.Add(oDiv);

                    oRow.Cells.Add(oCell);
                    oTbl.Rows.Add(oRow);
                }

                StdsPage_StdsContent_divStdChildren.Controls.Add(oTbl);
            }
        }
示例#28
0
        protected virtual void CreateControlHeirarchy()
        {
            HtmlTable table = new HtmlTable
            {
                CellPadding = 0,
                CellSpacing = 2
            };
            table.Build(6, 1);

            AreaCodeTextbox = new TextBox 
            { 
                ID = "AreaCodeTextbox",
                MaxLength = 3,
                Width = Unit.Pixel(50)
            };
            table.Rows[0].Cells[1].Controls.Add(AreaCodeTextbox);

            FirstPhoneNumberTextbox = new TextBox 
            { 
                ID = "FirstPhoneNumberTextbox",
                MaxLength = 3,
                Width = Unit.Pixel(50),
            };
            table.Rows[0].Cells[2].Controls.Add(FirstPhoneNumberTextbox);

            SecondPhoneNumberTextbox = new TextBox
            {
                ID = "SecondPhoneNumberTextbox",
                MaxLength = 4,
                Width = Unit.Pixel(60)
            };
            table.Rows[0].Cells[4].Controls.Add(SecondPhoneNumberTextbox);

            PhoneValidator = new PhoneNumberValidator
            {
                ControlsToValidate = AreaCodeTextbox.ID +  "," + FirstPhoneNumberTextbox.ID + "," + SecondPhoneNumberTextbox.ID,
                Condition = Cathexis.LandingPage.Behaviors.PhoneNumberValidator.Conditions.AND,
                Text = "*",
                ErrorMessage = "'Phone Number' is not valid."
            };
            table.Rows[0].Cells[4].Controls.Add(PhoneValidator);

            AreaExtender = new PhoneNumberExtender
            {
                TargetControlID = AreaCodeTextbox.ID,
                TextChangedFunction = "ChangeTextBox('Signup_ctl34_AreaCodeTextbox','Signup_ctl34_FirstPhoneNumberTextbox','3');"
            };
            table.Rows[0].Cells[1].Controls.Add(AreaExtender);

            AreaExtender = new PhoneNumberExtender
            {
                TargetControlID = FirstPhoneNumberTextbox.ID,
                TextChangedFunction = "ChangeTextBox('Signup_ctl34_FirstPhoneNumberTextbox','Signup_ctl34_SecondPhoneNumberTextbox','3');"
            };
            table.Rows[0].Cells[2].Controls.Add(AreaExtender);

            Controls.Add(table);
        }
示例#29
0
		override protected void OnInit(EventArgs e)
		{
			base.OnInit(e);

			node = new cms.businesslogic.CMSNode(int.Parse(helper.Request("id")));

			HtmlTable ht = new HtmlTable();
			ht.CellPadding = 4;

			HtmlTableRow captions = new HtmlTableRow();
			captions.Cells.Add(new HtmlTableCell());

            ArrayList actionList = BusinessLogic.Actions.Action.GetAll();
            foreach (interfaces.IAction a in actionList)
            {
				if (a.CanBePermissionAssigned) 
				{
					HtmlTableCell hc = new HtmlTableCell();
					hc.Attributes.Add("class", "guiDialogTinyMark");
					hc.Controls.Add(new LiteralControl(ui.Text("actions", a.Alias)));
					captions.Cells.Add(hc);
				}
			}
			ht.Rows.Add(captions);

			foreach (BusinessLogic.User u in BusinessLogic.User.getAll()) 
			{
				// Not disabled users and not system account
				if (!u.Disabled && u.Id > 0) 
				{
					HtmlTableRow hr = new HtmlTableRow();

					HtmlTableCell hc = new HtmlTableCell();
					hc.Attributes.Add("class", "guiDialogTinyMark");
					hc.Controls.Add(new LiteralControl(u.Name));
					hr.Cells.Add(hc);

					foreach (interfaces.IAction a in BusinessLogic.Actions.Action.GetAll()) 
					{
						CheckBox c = new CheckBox();
						c.ID = u.Id + "_" + a.Letter;
						if (a.CanBePermissionAssigned) 
						{
							if (u.GetPermissions(node.Path).IndexOf(a.Letter) > -1)
								c.Checked = true;
							HtmlTableCell cell = new HtmlTableCell();
							cell.Style.Add("text-align", "center");
							cell.Controls.Add(c);
							permissions.Add(c);
							hr.Cells.Add(cell);
						}
							
					}
					ht.Rows.Add(hr);
				}
			}
			PlaceHolder1.Controls.Add(ht);
		}
示例#30
0
        private void LoadTopPanel(Panel topPanel)
        {
            topPanel.CssClass = this.TopPanelCssClass;
            using (var table = new HtmlTable())
            {
                using (var row = new HtmlTableRow())
                {
                    using (var dropDownListCell = new HtmlTableCell())
                    {
                        this.filterDropDownList = new DropDownList();

                        this.filterDropDownList.ID = "FilterDropDownList";
                        this.filterDropDownList.CssClass = this.FilterDropDownListCssClass;
                        this.filterDropDownList.DataTextField = "column_name";
                        this.filterDropDownList.DataValueField = "column_name";
                        this.filterDropDownList.DataBound += this.FilterDropDownList_DataBound;

                        dropDownListCell.Controls.Add(this.filterDropDownList);
                        row.Cells.Add(dropDownListCell);

                    }
                    using (var textBoxCell = new HtmlTableCell())
                    {
                        this.filterTextBox = new TextBox();
                        this.filterTextBox.ID = "FilterTextBox";
                        this.filterTextBox.CssClass = this.FilterTextBoxCssClass;
                        textBoxCell.Controls.Add(this.filterTextBox);
                        row.Cells.Add(textBoxCell);
                    }

                    using (var buttonCell = new HtmlTableCell())
                    {
                        this.goButton = new Button();
                        this.goButton.ID = "GoButton";
                        this.goButton.CssClass = this.ButtonCssClass;

                        if (this.ButtonHeight.Value > 0)
                        {
                            this.goButton.Height = this.ButtonHeight;
                        }

                        if (this.ButtonWidth.Value > 0)
                        {
                            this.goButton.Width = this.ButtonWidth;
                        }

                        this.goButton.Click += this.GoButton_Click;
                        this.goButton.Text = ScrudResource.Go;
                        buttonCell.Controls.Add(this.goButton);
                        row.Cells.Add(buttonCell);
                    }

                    table.Rows.Add(row);
                    topPanel.Controls.Add(table);
                }
            }
        }
示例#31
0
        protected void btnRowTable_Click(object sender, EventArgs e)
        {
            HtmlTable table = new HtmlTable();
            HtmlTableRow row = new HtmlTableRow();
            HtmlTableRow rowB = new HtmlTableRow();
            HtmlTableRow rowC = new HtmlTableRow();
            HtmlTableCell cell = new HtmlTableCell();
            HtmlTableCell cell1 = new HtmlTableCell();
            HtmlTableCell cell2 = new HtmlTableCell();
            HtmlTableCell cell3 = new HtmlTableCell();
            HtmlTableCell cell4 = new HtmlTableCell();
            HtmlTableCell cell5 = new HtmlTableCell();
            HtmlTableCell cell6 = new HtmlTableCell();
            HtmlTableCell cell7 = new HtmlTableCell();
            HtmlTableCell cell8 = new HtmlTableCell();
            HtmlTableCell cell9 = new HtmlTableCell();
            cell.InnerText = "This is Column 1";
            cell2.InnerText = "This is Column 2";
            cell3.InnerText = " This is Column 3";
            row.Cells.Add(cell);
            row.Cells.Add(cell2);
            row.Cells.Add(cell3);
            table.Rows.Add(row);
            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            cell2 = new HtmlTableCell();
            cell3 = new HtmlTableCell();
            cell.InnerText = "column 4a";
            cell2.InnerText = "column 5a";
            cell3.InnerText = "Column 6a";
            row.Cells.Add(cell);
            row.Cells.Add(cell2);
            row.Cells.Add(cell3);
            table.Rows.Add(row);

            cell = new HtmlTableCell();
            cell.InnerText = "this is the new cell";
            cell1 = new HtmlTableCell();
            cell1.InnerText = "this is the new cell1";
            cell2 = new HtmlTableCell();
            cell2.InnerText = "this is the new cell3";
            row = new HtmlTableRow();
            row.Cells.Add(cell);
            row.Cells.Add(cell1);
            row.Cells.Add(cell2);
            table.Rows.Add(row);

            //cell7.InnerText = "again with 4";
            //cell8.InnerText = "again with 5";
            //cell9.InnerText = "again with 6";
            //rowC.Cells.Add(cell7);
            //rowC.Cells.Add(cell8);
            //rowC.Cells.Add(cell9);
            //table.Rows.Add(rowC);

            this.Controls.Add(table);
        }
示例#32
0
文件: TextBox.cs 项目: kinpro/mixerp
        internal static void AddTextBox(HtmlTable htmlTable, string resourceClassName, string columnName, string dataType, string defaultValue, bool isNullable, int maxLength, string errorCssClass, bool disabled)
        {
            if (htmlTable == null)
            {
                return;
            }

            if (string.IsNullOrWhiteSpace(columnName))
            {
                return;
            }

            bool isPasswordField = columnName.ToUpperInvariant().Contains("PASSWORD");

            if (isPasswordField && disabled)
            {
                defaultValue = "fake-password";
            }

            using (TextBox textBox = GetTextBox(columnName + "_textbox", maxLength))
            {
                string label = ScrudLocalizationHelper.GetResourceString(resourceClassName, columnName);

                if (dataType.ToUpperInvariant().Equals("COLOR"))
                {
                    textBox.CssClass = "color";
                }

                if (dataType.ToUpperInvariant().Equals("IMAGE"))
                {
                    textBox.CssClass = "image";
                }

                if (isPasswordField)
                {
                    textBox.Attributes.Add("type", "password");
                }

                if (disabled && !isPasswordField)
                {
                    textBox.ReadOnly = true;
                }

                textBox.Text = defaultValue;

                if (!isNullable)
                {
                    using (RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(textBox, errorCssClass))
                    {
                        ScrudFactoryHelper.AddRow(htmlTable, label + Titles.RequiredFieldIndicator, textBox, required);
                        return;
                    }
                }

                ScrudFactoryHelper.AddRow(htmlTable, label, textBox);
            }
        }
示例#33
0
        /// <summary>
        /// Renders a row containing control cells to a table.
        /// </summary>
        /// <param name="table">The output table.</param>
        /// <param name="controls">The collection of controls.</param>
        protected override void RenderRow(HtmlTable table, Control[] controls)
        {
            HtmlTableRow tr = new HtmlTableRow();

            HtmlTableCell controlcell = ComposeCell(ControlCellStyle, ControlCellWidth, controls);
            tr.Controls.Add(controlcell);

            table.Controls.Add(tr);
        }
示例#34
0
        //Header for Total Summary
        public void CreateTotalHeader(ref System.Web.UI.HtmlControls.HtmlTable tblSummary, ref DataTable dtbTemp)
        {
            HtmlTableRow header = new HtmlTableRow();

            //CHG0083477 - Name Change from AAA NCNU IE to CSAA IG as part of Name change project on 11/15/2013.
            //NameChange.Ch1:changed CSAA to AAA NCNU IE as a part of namechange project on 8/19/2010.
            //CHG0104053 - PAS HO CH1 - START : Added the below code to change the label from TOTAL CSAA IG PRODUCTS AND ALL OTHER PRODUCTS to Total Sales Rep Turn In 6/13/2014
            AddColumn(ref header, "TOTAL SALES REP TURN IN", dtbTemp.Columns.Count, 1, "arial_11_bold_white", "0", "left");
            //CHG0104053 - PAS HO CH1 - END : Added the below code to change the label from TOTAL CSAA IG PRODUCTS AND ALL OTHER PRODUCTS to Total Sales Rep Turn In 6/13/2014
            header.BgColor = "#333333";
            //header.Attributes.Add("class","arial_11_bold_white");
            tblSummary.Rows.Add(header);
        }
示例#35
0
        private static DateTime CreateWeekDaysAtTop(DateTime idxDate, HTML.HtmlTable tbl)
        {
            HTML.HtmlTableRow rowDays = new HTML.HtmlTableRow();
            rowDays.EnableViewState = false;
            rowDays.Cells.Add(new HTML.HtmlTableCell());
            rowDays.Attributes.Add("class", "weekdays");
            DateTime idxWeekDay = idxDate;

            for (int idx = 0; idx < 7; idx++)
            {
                HTML.HtmlTableCell cell = new HTML.HtmlTableCell();
                cell.EnableViewState = false;
                cell.InnerHtml       = idxWeekDay.ToString("ddd", System.Threading.Thread.CurrentThread.CurrentUICulture);
                rowDays.Cells.Add(cell);
                idxWeekDay = idxWeekDay.AddDays(1);
            }
            tbl.Rows.Add(rowDays);
            return(idxDate);
        }
示例#36
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Control.HtmlTable    table     = new Control.HtmlTable();
            Control.HtmlTableRow headerRow = new Control.HtmlTableRow();
            headerRow.Cells.Add(new Control.HtmlTableCell("th")
            {
                InnerText = "Color"
            });
            headerRow.Cells.Add(new Control.HtmlTableCell("th")
            {
                InnerText = "Count"
            });
            table.Rows.Add(headerRow);
            foreach (String[] data in tableRows)
            {
                table.Rows.Add(new Control.HtmlTableRow
                {
                    Cells =
                    {
                        new Control.HtmlTableCell {
                            InnerText = data[0]
                        },
                        new Control.HtmlTableCell {
                            InnerText = data[1]
                        },
                    }
                });
            }

            Control.HtmlTableRow footRow = new Control.HtmlTableRow();
            footRow.Cells.Add(new Control.HtmlTableCell("th")
            {
                InnerText = "Total"
            });
            footRow.Cells.Add(new Control.HtmlTableCell("th")
            {
                InnerText = "46"
            });
            table.Rows.Add(footRow);

            container.Controls.Add(table);
        }
示例#37
0
        private void CreateTodayButton(HTML.HtmlTable tbl)
        {
            HTML.HtmlTableRow bottomRow = new HTML.HtmlTableRow();
            bottomRow.EnableViewState = false;
            bottomRow.ID = "stat_" + Value.ToString("dd_MM_yyyy", System.Globalization.CultureInfo.InvariantCulture);
            HTML.HtmlTableCell bottomCell = new HTML.HtmlTableCell();
            bottomCell.EnableViewState     = false;
            bottomCell.Style["text-align"] = "center";
            bottomCell.ID      = "bottC_" + Value.ToString("dd_MM_yyyy", System.Globalization.CultureInfo.InvariantCulture);
            bottomCell.ColSpan = 8;
            LinkButton today = new LinkButton();

            today.ID              = "todayBtn";
            today.Text            = "Today";
            today.Click          += new EventHandler(today_Click);
            today.EnableViewState = false;
            bottomCell.Controls.Add(today);
            bottomRow.Cells.Add(bottomCell);
            tbl.Rows.Add(bottomRow);
        }
示例#38
0
        private void CreateYearMonthPicker(HTML.HtmlTable tbl)
        {
            // Creating header row (with month and year picker)
            HTML.HtmlTableRow headerRow = new HTML.HtmlTableRow();
            headerRow.EnableViewState = false;
            headerRow.ID = "head_" + Value.ToString("dd_MM_yyyy", System.Globalization.CultureInfo.InvariantCulture);
            HTML.HtmlTableCell headerCell = new HTML.HtmlTableCell();
            headerCell.EnableViewState     = false;
            headerCell.Style["text-align"] = "center";
            headerCell.ID      = "headC_" + Value.ToString("dd_MM_yyyy", System.Globalization.CultureInfo.InvariantCulture);
            headerCell.ColSpan = 8;

            // Year SelectList
            CreateYearPicker(headerCell);

            // Month SelectList
            CreateMonthPicker(headerCell);

            headerRow.Cells.Add(headerCell);
            tbl.Rows.Add(headerRow);
        }
示例#39
0
        public double AddCollTotalSummaryFooter(ref System.Web.UI.HtmlControls.HtmlTable tblSummary, ref DataTable dtbTemp)
        {
            HtmlTableRow hRow       = new HtmlTableRow();
            decimal      dcGrandTot = 0;

            foreach (DataColumn dtCol in dtbTemp.Columns)
            {
                string  strColName = dtCol.ColumnName.ToString();
                decimal dcTot      = 0;
                if (strColName != "PayType")
                {
                    foreach (DataRow dr in dtbTemp.Rows)
                    {
                        dcTot = dcTot + Convert.ToDecimal(dr[strColName].ToString());
                    }
                    AddColumn(ref hRow, Convert.ToDecimal(dcTot.ToString()).ToString("$##0.00"), 1, 1, "", "", "right");
                    dcGrandTot = dcGrandTot + dcTot;
                }
                else
                {
                    AddColumn(ref hRow, "GRAND TOTAL", 1, 1, "", "", "left");
                }
            }
            //			AddColumn(ref hRow, Convert.ToDecimal(dcGrandTot.ToString()).ToString("$##0.00"), 1);
            hRow.Attributes.Add("class", "collection_summary_footer");
            tblSummary.Rows.Add(hRow);

            if (dcGrandTot <= 0)
            {
                tblSummary.Visible = false;
            }
            else
            {
                tblSummary.Visible = true;
            }

            return(Convert.ToDouble(dcGrandTot));
        }
示例#40
0
 protected override void AttachChildControls()
 {
     this.dropRegions         = (RegionSelector)this.FindControl("dropRegions");
     this.txtShipTo           = (System.Web.UI.WebControls.TextBox) this.FindControl("txtShipTo");
     this.txtAddress          = (System.Web.UI.WebControls.TextBox) this.FindControl("txtAddress");
     this.txtZipcode          = (System.Web.UI.WebControls.TextBox) this.FindControl("txtZipcode");
     this.txtCellPhone        = (System.Web.UI.WebControls.TextBox) this.FindControl("txtCellPhone");
     this.txtTelPhone         = (System.Web.UI.WebControls.TextBox) this.FindControl("txtTelPhone");
     this.txtInvoiceTitle     = (System.Web.UI.WebControls.TextBox) this.FindControl("txtInvoiceTitle");
     this.drpShipToDate       = (System.Web.UI.HtmlControls.HtmlSelect) this.FindControl("drpShipToDate");
     this.litTaxRate          = (System.Web.UI.WebControls.Label) this.FindControl("litTaxRate");
     this.shippingModeList    = (Common_ShippingModeList)this.FindControl("Common_ShippingModeList");
     this.paymentModeList     = (Common_PaymentModeList)this.FindControl("grd_Common_PaymentModeList");
     this.inputPaymentModeId  = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("inputPaymentModeId");
     this.inputShippingModeId = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("inputShippingModeId");
     this.hdbuytype           = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hdbuytype");
     this.pannel_useraddress  = (System.Web.UI.WebControls.Panel) this.FindControl("pannel_useraddress");
     this.lblPaymentPrice     = (FormatedMoneyLabel)this.FindControl("lblPaymentPrice");
     this.lblShippModePrice   = (FormatedMoneyLabel)this.FindControl("lblShippModePrice");
     this.chkTax                = (System.Web.UI.HtmlControls.HtmlInputCheckBox) this.FindControl("chkTax");
     this.cartProductList       = (Common_SubmmintOrder_ProductList)this.FindControl("Common_SubmmintOrder_ProductList");
     this.cartGiftList          = (Common_SubmmintOrder_GiftList)this.FindControl("Common_SubmmintOrder_GiftList");
     this.litProductAmount      = (System.Web.UI.WebControls.Literal) this.FindControl("litProductAmount");
     this.litProductBundling    = (System.Web.UI.WebControls.Literal) this.FindControl("litProductBundling");
     this.litAllWeight          = (System.Web.UI.WebControls.Label) this.FindControl("litAllWeight");
     this.litPoint              = (System.Web.UI.WebControls.Label) this.FindControl("litPoint");
     this.hlkSentTimesPoint     = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlkSentTimesPoint");
     this.lblOrderTotal         = (FormatedMoneyLabel)this.FindControl("lblOrderTotal");
     this.txtMessage            = (System.Web.UI.WebControls.TextBox) this.FindControl("txtMessage");
     this.hlkFeeFreight         = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlkFeeFreight");
     this.hlkReducedPromotion   = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlkReducedPromotion");
     this.lblTotalPrice         = (FormatedMoneyLabel)this.FindControl("lblTotalPrice");
     this.htmlCouponCode        = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("htmlCouponCode");
     this.CmbCoupCode           = (System.Web.UI.HtmlControls.HtmlSelect) this.FindControl("CmbCoupCode");
     this.tbCoupon              = (System.Web.UI.HtmlControls.HtmlTable) this.FindControl("tbCoupon");
     this.litCouponAmout        = (FormatedMoneyLabel)this.FindControl("litCouponAmout");
     this.btnCreateOrder        = ButtonManager.Create(this.FindControl("btnCreateOrder"));
     this.btnCreateOrder.Click += new System.EventHandler(this.btnCreateOrder_Click);
     Hidistro.Membership.Context.SiteSettings masterSettings = Hidistro.Membership.Context.SettingsManager.GetMasterSettings(false);
     if (!this.Page.IsPostBack)
     {
         this.BindUserAddress();
         this.shippingModeList.DataSource = ShoppingProcessor.GetShippingModes();
         this.shippingModeList.DataBind();
         this.ReBindPayment();
         if (this.shoppingCart != null)
         {
             this.litTaxRate.Text = masterSettings.TaxRate.ToString(System.Globalization.CultureInfo.InvariantCulture);
             this.BindShoppingCartInfo(this.shoppingCart);
             if (this.isGroupBuy || this.isCountDown || this.isBundling || this.shoppingCart.LineItems.Count == 0)
             {
                 this.tbCoupon.Visible = false;
             }
             this.CmbCoupCode.DataTextField  = "DisplayText";
             this.CmbCoupCode.DataValueField = "ClaimCode";
             this.CmbCoupCode.DataSource     = ShoppingProcessor.GetCoupon(this.shoppingCart.GetTotal());
             this.CmbCoupCode.DataBind();
             System.Web.UI.WebControls.ListItem item = new System.Web.UI.WebControls.ListItem("", "0");
             this.CmbCoupCode.Items.Insert(0, item);
             this.hdbuytype.Value            = this.buytype;
             this.pannel_useraddress.Visible = (!Hidistro.Membership.Context.HiContext.Current.User.IsAnonymous && PersonalHelper.GetShippingAddressCount(Hidistro.Membership.Context.HiContext.Current.User.UserId) > 0);
         }
     }
 }
示例#41
0
    /// <summary>
    /// 装载控件数据
    /// </summary>
    public override void LoadData()
    {
        try
        {
            if (this.ApplicationCode != "")
            {
                this.OperationCode = this.ApplicationCode;
            }
            else if (this.OperationCode != "")
            {
                this.ApplicationCode = this.OperationCode;
            }
            else
            {
                return;
            }

            string ud_sPaymentHyperLinkFormat  = "../Finance/PaymentInfo.aspx?PaymentCode={0}&ProjectCode={1}";
            string ud_sContractHyperLinkFormat = "../Contract/ContractInfo.aspx?ContractCode={0}&ProjectCode={1}";

            EntityData entity = RmsPM.DAL.EntityDAO.PaymentDAO.GetStandard_PaymentByCode(this.OperationCode, this.dao);

            decimal ud_deTotalMoney, ud_deTotalChangeMoney, ud_deOriginalMoney, ud_deBudgetMoney, ud_deAdjustMoney;
            decimal ud_deNegAHMoney, ud_deTotalItemMoney, ud_deTotalPayMoney;
            decimal ud_deTotalCash, ud_deTotalChangeCash, ud_deOriginalCash;//, ud_deBudgetCash, ud_deAdjustCash;
            decimal ud_deNegAHCash, ud_deTotalItemCash, ud_deTotalPayCash;


            ud_deTotalMoney       = decimal.Zero;
            ud_deTotalChangeMoney = decimal.Zero;
            ud_deOriginalMoney    = decimal.Zero;
            ud_deBudgetMoney      = decimal.Zero;
            ud_deAdjustMoney      = decimal.Zero;

            ud_deNegAHMoney     = decimal.Zero;
            ud_deTotalItemMoney = decimal.Zero;
            ud_deTotalPayMoney  = decimal.Zero;


            ud_deTotalCash       = decimal.Zero;
            ud_deTotalChangeCash = decimal.Zero;
            ud_deOriginalCash    = decimal.Zero;
//            ud_deBudgetCash = decimal.Zero;
//            ud_deAdjustCash = decimal.Zero;

            ud_deNegAHCash     = decimal.Zero;
            ud_deTotalItemCash = decimal.Zero;
            ud_deTotalPayCash  = decimal.Zero;

            if (entity.HasRecord())
            {
                this.ProjectCode     = entity.GetString("ProjectCode");
                this.ContractCode    = entity.GetString("ContractCode");
                this.ApplicationType = RmsPM.BLL.SystemGroupRule.GetSystemGroupSortIDByGroupCode(entity.GetString("GroupCode"));


                ud_deTotalItemMoney = entity.GetDecimal("Money");

                ud_deNegAHMoney = -entity.GetDecimal("AHMoney");
//                    ud_deTotalPayMoney = entity.GetDecimal("TotalPayMoney");
                ud_deTotalPayMoney = ud_deTotalItemMoney - ud_deNegAHMoney;

                ud_deNegAHCash = -entity.GetDecimal("AHCash");

                string ud_sPaymentCodeFilter = string.Format("PaymentCode='{0}'", this.OperationCode);

                ud_deTotalItemCash = RmsPM.BLL.MathRule.SumColumn(entity.Tables["PaymentItem"].Select(ud_sPaymentCodeFilter), "ItemCash");
                ud_deTotalPayCash  = ud_deTotalItemCash - ud_deNegAHCash;


                if (this.ContractCode != "")
                {
                    //显示合同信息
                    EntityData entityCon = RmsPM.DAL.EntityDAO.ContractDAO.GetStandard_ContractByCode(this.ContractCode);
                    if (entityCon.HasRecord())
                    {
                        this.lblOperProjectName.Text = RmsPM.BLL.ProjectRule.GetProjectName(this.ProjectCode);
                        this.lblEyeProjectName.Text  = this.lblOperProjectName.Text;

                        this.lblOperContractName.Text = ShowApplicationHyperLink(entityCon.GetString("ContractName"), string.Format(ud_sContractHyperLinkFormat, this.ContractCode, this.ProjectCode)); //entityCon.GetString("ContractName");
                        this.lblEyeContractName.Text  = this.lblOperContractName.Text;

                        this.ApplicationTitle = entityCon.GetString("ContractName");

                        this.lblOperContractID.Text = entityCon.GetString("ContractID");
                        this.lblEyeContractID.Text  = this.lblOperContractID.Text;

                        this.lblOperSupplier2Name.Text = RmsPM.BLL.ProjectRule.GetSupplierName(entityCon.GetString("Supplier2Code"));
                        this.lblEyeSupplier2Name.Text  = this.lblOperSupplier2Name.Text;

                        this.lblOperBuilding.Text = entityCon.GetString("Building");
                        this.lblEyeBuilding.Text  = this.lblOperBuilding.Text;

                        //显示合同金额

                        ud_deTotalMoney    = entityCon.GetDecimal("TotalMoney");
                        ud_deOriginalMoney = entityCon.GetDecimal("OriginalMoney");
                        ud_deBudgetMoney   = entityCon.GetDecimal("BudgetMoney");
                        ud_deAdjustMoney   = entityCon.GetDecimal("AdjustMoney");

                        decimal ud_deBudgetCash = 0;
                        ud_deTotalChangeMoney = ud_deTotalMoney - ud_deOriginalMoney;

                        string ud_sContractCodeFilter = string.Format("ContractCode='{0}'", this.ContractCode);

                        ud_deTotalCash    = RmsPM.BLL.MathRule.SumColumn(entityCon.Tables["ContractCostCash"].Select(ud_sContractCodeFilter, "", DataViewRowState.CurrentRows), "Cash");
                        ud_deOriginalCash = RmsPM.BLL.MathRule.SumColumn(entityCon.Tables["ContractCostCash"].Select(ud_sContractCodeFilter, "", DataViewRowState.CurrentRows), "OriginalCash");

                        ud_deTotalChangeCash = ud_deTotalCash - ud_deOriginalCash;

                        ud_deBudgetCash = ud_deOriginalCash + ud_deAdjustMoney;


                        float ud_fTotalPayMoneyPer  = ((float)ud_deTotalPayMoney) / ((float)ud_deTotalMoney);
                        float ud_fTotalItemMoneyPer = ((float)ud_deTotalItemMoney) / ((float)ud_deTotalMoney);

                        switch (this.MoneyState)
                        {
                        case ModuleState.Sightless: //不可见的
                        case ModuleState.Begin:     //不可见的
                        case ModuleState.End:       //不可见的
                            this.txtOperOriginalMoney.Value    = "***************";
                            this.txtOperTotalChangeMoney.Value = "***************";
                            this.txtOperNewTotalMoney.Value    = "***************";
                            this.txtOperBudgetMoney.Value      = "***************";
                            this.txtOperAdjustMoney.Value      = "***************";

                            this.txtOperOriginalCash.Value    = "***************";
                            this.txtOperTotalChangeCash.Value = "***************";
                            this.txtOperNewTotalCash.Value    = "***************";
                            this.txtOperBudgetCash.Value      = "***************";
                            this.txtOperAdjustCash.Value      = "***************";

                            this.lblOperTotalPayMoneyPer.Text  = "";
                            this.lblOperTotalItemMoneyPer.Text = "";
                            break;

                        case ModuleState.Operable:   //可操作的
                        case ModuleState.Eyeable:    //可见的
                            this.txtOperOriginalMoney.Value    = ud_deOriginalMoney.ToString("N");
                            this.txtOperTotalChangeMoney.Value = ud_deTotalChangeMoney.ToString("N");
                            this.txtOperNewTotalMoney.Value    = ud_deTotalMoney.ToString("N");
                            this.txtOperBudgetMoney.Value      = ud_deBudgetMoney.ToString("N");
                            this.txtOperAdjustMoney.Value      = ud_deAdjustMoney.ToString("N");

                            this.txtOperOriginalCash.Value    = ud_deOriginalCash.ToString("N");
                            this.txtOperTotalChangeCash.Value = ud_deTotalChangeCash.ToString("N");
                            this.txtOperNewTotalCash.Value    = ud_deTotalCash.ToString("N");
                            this.txtOperBudgetCash.Value      = (ud_deBudgetCash).ToString("N");
                            this.txtOperAdjustCash.Value      = ud_deAdjustMoney.ToString("N");

                            this.lblOperTotalPayMoneyPer.Text  = ud_fTotalPayMoneyPer.ToString("P");
                            this.lblOperTotalItemMoneyPer.Text = ud_fTotalItemMoneyPer.ToString("P");

                            break;

                        default:
                            this.tabOperMoney.Visible = false;
                            this.tabEyeMoney.Visible  = false;
                            break;
                        }

                        this.txtEyeOriginalMoney.Value    = this.txtOperOriginalMoney.Value;
                        this.txtEyeTotalChangeMoney.Value = this.txtOperTotalChangeMoney.Value;
                        this.txtEyeNewTotalMoney.Value    = this.txtOperNewTotalMoney.Value;
                        this.txtEyeBudgetMoney.Value      = this.txtOperBudgetMoney.Value;
                        this.txtEyeAdjustMoney.Value      = this.txtOperAdjustMoney.Value;


                        //edited 2006-12-20
                        this.txtEyeOriginalCash.Value    = this.txtOperOriginalCash.Value;
                        this.txtEyeTotalChangeCash.Value = this.txtOperTotalChangeCash.Value;
                        this.txtEyeNewTotalCash.Value    = this.txtOperNewTotalCash.Value;
                        this.txtEyeBudgetCash.Value      = this.txtOperBudgetCash.Value;
                        this.txtEyeAdjustCash.Value      = this.txtOperAdjustCash.Value;
                        //////Money to cash

                        this.lblEyeTotalPayMoneyPer.Text  = this.lblOperTotalPayMoneyPer.Text;
                        this.lblEyeTotalItemMoneyPer.Text = this.lblOperTotalItemMoneyPer.Text;

                        entityCon.SetCurrentTable("ContractCostCash");

                        this.lblOperMoneyType.Text = entityCon.GetString("MoneyType");
                        this.lblEyeMoneyType.Text  = this.lblOperMoneyType.Text;
                        if (this.lblOperMoneyType.Text.IndexOf("RMB") >= 0)
                        {
                            displayRMB = "none";
                            System.Web.UI.HtmlControls.HtmlTable table = tabOperMoney;
                            foreach (System.Web.UI.HtmlControls.HtmlTableRow tr in table.Rows)
                            {
                                tr.Cells[1].Style.Add("display", "none");
                            }
                            table = tabEyeMoney;
                            foreach (System.Web.UI.HtmlControls.HtmlTableRow tr in table.Rows)
                            {
                                tr.Cells[1].Style.Add("display", "none");
                            }
                        }
                    }
                    entityCon.Dispose();

                    this.lblOperSupplierName.Text = entity.GetString("SupplyName");
                    this.lblEyeSupplierName.Text  = lblOperSupplierName.Text;

                    this.txtOperCheckOpinion.Value = entity.GetString("CheckRemark");
                    this.lblEyeCheckOpinion.Text   = HttpUtility.HtmlEncode(txtOperCheckOpinion.Value).Replace("\n", "<br>");

                    this.txtOperTotalPayMoney.Value = ud_deTotalPayMoney.ToString("N");
                    this.txtEyeTotalPayMoney.Value  = this.txtOperTotalPayMoney.Value;

                    this.txtOperNegAHMoney.Value = ud_deNegAHMoney.ToString("N");
                    this.txtEyeNegAHMoney.Value  = this.txtOperNegAHMoney.Value;

                    this.txtEyeTotalItemMoney.Value  = ud_deTotalItemMoney.ToString("N");
                    this.txtOperTotalItemMoney.Value = this.txtEyeTotalItemMoney.Value;


                    this.txtOperTotalPayCash.Value = ud_deTotalPayCash.ToString("N");
                    this.txtEyeTotalPayCash.Value  = this.txtOperTotalPayCash.Value;

                    this.txtOperNegAHCash.Value = ud_deNegAHCash.ToString("N");
                    this.txtEyeNegAHCash.Value  = this.txtOperNegAHCash.Value;

                    this.txtOperTotalItemCash.Value = ud_deTotalItemCash.ToString("N");
                    this.txtEyeTotalItemCash.Value  = this.txtOperTotalItemCash.Value;

                    this.txtOperBankName.Value = entity.GetString("BankName");
                    this.lblEyeBankName.Text   = this.txtOperBankName.Value;

                    this.txtOperBankAccount.Value = entity.GetString("BankAccount");
                    this.lblEyeBankAccount.Text   = this.txtOperBankAccount.Value;

                    this.dtOperInputDate.Value = entity.GetDateTimeOnlyDate("ApplyDate");
                    this.dtEyeInputDate.Value  = this.dtOperInputDate.Value;

                    this.dtOperPayDate.Value = entity.GetDateTimeOnlyDate("PayDate");
                    this.dtEyePayDate.Value  = this.dtOperPayDate.Value;

                    this.txtOperOtherAttachMent.Text = entity.GetString("OtherAttachMent");
                    this.txtEyeOtherAttachMent.Text  = this.txtOperOtherAttachMent.Text;

                    this.txtOperIssueMode.Value = entity.GetString("IssueMode").Trim() != "" ? entity.GetString("IssueMode") : RmsPM.BLL.PaymentRule.GetIssueByContractCode(this.ContractCode).ToString();
                    this.lblEyeIssueMode.Text   = this.txtOperIssueMode.Value;

                    this.txtOperIssue.Value = entity.GetInt("Issue").ToString();
                    this.lblEyeIssue.Text   = this.txtOperIssue.Value;

                    this.rdoOperPayType.SelectedIndex = this.rdoOperPayType.Items.IndexOf(this.rdoOperPayType.Items.FindByValue(entity.GetInt("PayType").ToString()));
                    this.rdoEyePayType.SelectedIndex  = this.rdoEyePayType.Items.IndexOf(this.rdoEyePayType.Items.FindByValue(entity.GetInt("PayType").ToString()));
                    this.HyperLink1.NavigateUrl       = string.Format(ud_sPaymentHyperLinkFormat, this.ApplicationCode, this.ProjectCode);// "..//Finance/PaymentInfo.aspx?ProjectCode=100003&PaymentCode=" + this.ApplicationCode;
                    this.HyperLink1.Text = "请款单:" + this.ApplicationCode.ToString();
                }
            }
            entity.Dispose();

            //业务流程属性保存
            SaveOperationProperty("合同金额", ud_deTotalMoney.ToString());
            SaveOperationProperty("单一付款", ud_deTotalItemMoney.ToString());
            SaveOperationProperty("累计付款", ud_deTotalPayMoney.ToString());
        }
        catch (Exception ex)
        {
            ApplicationLog.WriteLog(this.ToString(), ex, "");
        }
    }
示例#42
0
        private void CreateCalendarControls()
        {
            // Finding date to start on
            DateTime idxDate = FindStartDate();

            // Creating table to wrap the whole thing inside of
            HTML.HtmlTable tbl = new HTML.HtmlTable();
            tbl.EnableViewState = false;
            tbl.ID = "tbl_" + Value.ToString("dd_MM_yyyy", System.Globalization.CultureInfo.InvariantCulture);

            // Creating the header row which contains the Year and Month DropDownLists
            CreateYearMonthPicker(tbl);

            // Creating Weekdays at top of calendar
            idxDate = CreateWeekDaysAtTop(idxDate, tbl);

            // Looping through creating childcontrols
            while (true)
            {
                HTML.HtmlTableRow row = new HTML.HtmlTableRow();
                row.EnableViewState = false;
                row.ID = idxDate.ToString("MM_dd", System.Globalization.CultureInfo.InvariantCulture) + Value.ToString("dd_MM_yyyy", System.Globalization.CultureInfo.InvariantCulture);

                idxDate = CreateWeekNumberCell(idxDate, row);

                // Creating week cells for actual dates...
                for (int idx = 0; idx < 7; idx++)
                {
                    idxDate = CreateOneDayCell(idxDate, row);
                }
                tbl.Rows.Add(row);
                if (idxDate.Month != Value.Month)
                {
                    break;
                }
            }

            // Creating "extra controls" to append at bottom
            if (CreateFooterControls != null)
            {
                CreateFooterControlsEventArgs evt = new CreateFooterControlsEventArgs();
                CreateFooterControls(this, evt);
                int idxNo = 0;
                foreach (ASP.Control idx in evt.Controls)
                {
                    HTML.HtmlTableRow row = new HTML.HtmlTableRow();
                    row.ID = "extraRow" + idxNo;
                    HTML.HtmlTableCell cell = new HTML.HtmlTableCell();
                    cell.ID      = "extraCell" + idxNo;
                    cell.ColSpan = 8;
                    cell.Controls.Add(idx);
                    row.Cells.Add(cell);
                    tbl.Rows.Add(row);
                    idxNo += 1;
                }
            }

            // Today button...
            CreateTodayButton(tbl);

            // Rooting the Table as the LAST thing we do...!
            _content.Controls.Add(tbl);
        }
示例#43
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BusinessObjects.Person person = new BusinessObjects.Person(1);

            if (person.Addresses.Count > 0)
            {
                System.Web.UI.HtmlControls.HtmlTable    addressTable   = new System.Web.UI.HtmlControls.HtmlTable();
                System.Web.UI.HtmlControls.HtmlTableRow addressIDRow   = new System.Web.UI.HtmlControls.HtmlTableRow();
                System.Web.UI.HtmlControls.HtmlTableRow addressDataRow = new System.Web.UI.HtmlControls.HtmlTableRow();

                System.Web.UI.HtmlControls.HtmlTableCell addressIDLabelCell = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell str1LabelCell      = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell str2LabelCell      = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell citLabelCell       = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell stLabelCell        = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell zLabelCell         = new System.Web.UI.HtmlControls.HtmlTableCell();

                System.Web.UI.HtmlControls.HtmlTableCell addressIDLiteralCell = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell str1LiteralCell      = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell str2LiteralCell      = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell citLiteralCell       = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell stLiteralCell        = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell zLiteralCell         = new System.Web.UI.HtmlControls.HtmlTableCell();

                addressTable.Border = 1;


                Label   lblAddID = new Label();
                Literal litAddID = new Literal();
                Label   lblStr1  = new Label();
                Literal litStr1  = new Literal();
                Label   lblStr2  = new Label();
                Literal litStr2  = new Literal();
                Label   lblCit   = new Label();
                Literal litCit   = new Literal();
                Label   lblSt    = new Label();
                Literal litSt    = new Literal();
                Label   lblZ     = new Label();
                Literal litZ     = new Literal();

                lblAddID.Text = "Address ID: ";
                lblStr1.Text  = "Street 1: ";
                lblStr2.Text  = "Street 2: ";
                lblCit.Text   = "City: ";
                lblSt.Text    = "State: ";
                lblZ.Text     = "Zip: ";
                int i = 0;
                litAddID.Text = person.Addresses[i].AddressID.ToString();
                litStr1.Text  = person.Addresses[i].Street1.ToString();
                litStr2.Text  = person.Addresses[i].Street2.ToString();
                litCit.Text   = person.Addresses[i].City.ToString();
                litSt.Text    = person.Addresses[i].State.ToString();
                litZ.Text     = person.Addresses[i].Zip.ToString();


                addressIDLabelCell.Controls.Add(lblAddID);
                addressIDLiteralCell.Controls.Add(litAddID);
                str1LabelCell.Controls.Add(lblStr1);
                str1LiteralCell.Controls.Add(litStr1);
                str2LabelCell.Controls.Add(lblStr2);
                str2LiteralCell.Controls.Add(litStr2);
                citLabelCell.Controls.Add(lblCit);
                citLiteralCell.Controls.Add(litCit);
                stLabelCell.Controls.Add(lblSt);
                stLiteralCell.Controls.Add(litSt);
                zLabelCell.Controls.Add(lblZ);
                zLiteralCell.Controls.Add(litZ);

                addressTable.Rows.Add(addressIDRow);
                addressIDRow.Cells.Add(addressIDLabelCell);
                addressIDRow.Cells.Add(str1LabelCell);
                addressIDRow.Cells.Add(str2LabelCell);
                addressIDRow.Cells.Add(citLabelCell);
                addressIDRow.Cells.Add(stLabelCell);
                addressIDRow.Cells.Add(zLabelCell);

                //foreach (BusinessObjects.PersonAddress personAddresses in person.Addresses)
                //{

                //    addressIDRow = new HtmlTableRow();

                //   addressIDLiteralCell = new System.Web.UI.HtmlControls.HtmlTableCell();
                // str1LiteralCell = new System.Web.UI.HtmlControls.HtmlTableCell();
                //     str2LiteralCell = new System.Web.UI.HtmlControls.HtmlTableCell();
                //     citLiteralCell = new System.Web.UI.HtmlControls.HtmlTableCell();
                //    stLiteralCell = new System.Web.UI.HtmlControls.HtmlTableCell();
                //    zLiteralCell = new System.Web.UI.HtmlControls.HtmlTableCell();

                //    litAddID.Text = person.Addresses[i].AddressID.ToString();
                //    litStr1.Text = person.Addresses[i].Street1.ToString();
                //    litStr2.Text = person.Addresses[i].Street2.ToString();
                //    litCit.Text = person.Addresses[i].City.ToString();
                //    litSt.Text = person.Addresses[i].State.ToString();
                //    litZ.Text = person.Addresses[i].Zip.ToString();

                //    addressIDLiteralCell.Controls.Add(litAddID);
                //    str1LiteralCell.Controls.Add(litStr1);
                //    str2LiteralCell.Controls.Add(litStr2);
                //    citLiteralCell.Controls.Add(litCit);
                //    stLiteralCell.Controls.Add(litSt);
                //    zLiteralCell.Controls.Add(litZ);

                //    addressTable.Rows.Add(addressIDRow);
                //    addressIDRow.Cells.Add(addressIDLiteralCell);
                //    addressIDRow.Cells.Add(str1LiteralCell);
                //    addressIDRow.Cells.Add(str2LiteralCell);
                //    addressIDRow.Cells.Add(citLiteralCell);
                //    addressIDRow.Cells.Add(stLiteralCell);
                //    addressIDRow.Cells.Add(zLiteralCell);

                //    i += 1;

                //}

                Page.Form.Controls.Add(addressTable);
            }
        }
示例#44
0
        private void fillPersonPhones()
        {
            BusinessObjects.Person person = new BusinessObjects.Person(1);

            if (person.Phones.Count > 0)
            {
                System.Web.UI.HtmlControls.HtmlTable phoneTable = new System.Web.UI.HtmlControls.HtmlTable();
                phoneTable.Border      = 1;
                phoneTable.CellPadding = 3;
                HtmlTableRow  headerTableRow             = new HtmlTableRow();
                HtmlTableCell phoneIDHeaderTableCell     = new HtmlTableCell();
                HtmlTableCell areaCodeHeaderTableCell    = new HtmlTableCell();
                HtmlTableCell phoneNumberHeaderTableCell = new HtmlTableCell();
                HtmlTableCell extensionHeaderTableCell   = new HtmlTableCell();
                HtmlTableCell phoneTypeIDHeaderTableCell = new HtmlTableCell();
                HtmlTableCell phoneActionHeaderTableCell = new HtmlTableCell();

                phoneIDHeaderTableCell.InnerText     = "Phone ID";
                areaCodeHeaderTableCell.InnerText    = "Area Code";
                phoneNumberHeaderTableCell.InnerText = "Phone Number";
                extensionHeaderTableCell.InnerText   = "Extension";
                phoneTypeIDHeaderTableCell.InnerText = "Phone Type ID";
                phoneActionHeaderTableCell.InnerText = "Action";

                headerTableRow.Cells.Add(phoneIDHeaderTableCell);
                headerTableRow.Cells.Add(areaCodeHeaderTableCell);
                headerTableRow.Cells.Add(phoneNumberHeaderTableCell);
                headerTableRow.Cells.Add(extensionHeaderTableCell);
                headerTableRow.Cells.Add(phoneTypeIDHeaderTableCell);
                headerTableRow.Cells.Add(phoneActionHeaderTableCell);

                phoneTable.Rows.Add(headerTableRow);

                foreach (BusinessObjects.PersonPhone personPhone in person.Phones)
                {
                    HtmlTableRow  phoneTableRow        = new HtmlTableRow();
                    HtmlTableCell phoneIDTableCell     = new HtmlTableCell();
                    HtmlTableCell areaCodeTableCell    = new HtmlTableCell();
                    HtmlTableCell phoneNumberTableCell = new HtmlTableCell();
                    HtmlTableCell extensionTableCell   = new HtmlTableCell();
                    HtmlTableCell phoneTypeIDTableCell = new HtmlTableCell();
                    HtmlTableCell phoneActionTableCell = new HtmlTableCell();

                    phoneIDTableCell.InnerText     = personPhone.PhoneID.ToString(); //some time wrap in some control, JQuery
                    areaCodeTableCell.InnerText    = personPhone.AreaCode.ToString();
                    phoneNumberTableCell.InnerText = personPhone.PhoneNumber.ToString();
                    extensionTableCell.InnerText   = personPhone.Extension.ToString();
                    // phoneTypeIDTableCell.InnerText = personPhone.PhoneTypeID.ToString();

                    int pPhone = Convert.ToInt32(personPhone.PhoneTypeID.ToString());
                    switch (pPhone)
                    {
                    case 1:
                        phoneTypeIDTableCell.InnerText = "Home";
                        break;

                    case 2:
                        phoneTypeIDTableCell.InnerText = "Work";
                        break;

                    case 3:
                        phoneTypeIDTableCell.InnerText = "Cell";
                        break;
                    }
                    //  phoneTypeIDTableCell.InnerText = personPhone.PhoneTypeID.
                    //  phoneActionTableCell.InnerHtml = "<FORM><INPUT Type='BUTTON' VALUE='E' ONCLICK='window.location.href='http://www.treasurepointaudio.com''><INPUT Type='BUTTON' VALUE='Delete' ONCLICK='window.location.href='http://www.treasurepointaudio.com''></FORM>";

                    LinkButton      lnkEdit   = new LinkButton();
                    LinkButton      lnkUpdate = new LinkButton();
                    LiteralControl  litEdit   = new LiteralControl();
                    HtmlInputButton btnDelete = new HtmlInputButton();

                    int x = person.ID;
                    int y = personPhone.PhoneID;
                    btnDelete.Attributes.Add("value", "Delete");
                    //btn_delete.Attributes.Add("onclick", "if(confirm('Are you sure that you want to delete this comment?')){return true;} else {return false;};");

                    btnDelete.Attributes.Add("onclick", "window.location='TelephoneForm.aspx?Mode=Delete&PersonID=" + x + "&PhoneID=" + y + "'");

                    HtmlInputButton btn3 = new HtmlInputButton();
                    btn3.Attributes.Add("value", "Update");

                    btn3.Attributes.Add("onclick", "window.location='TelephoneForm.aspx?Mode=Edit&PersonID=" + x + "&PhoneID=" + y + "'");
                    phoneActionTableCell.Controls.Add(btnDelete);
                    phoneActionTableCell.Controls.Add(btn3);

                    phoneTableRow.Cells.Add(phoneIDTableCell);
                    phoneTableRow.Cells.Add(areaCodeTableCell);
                    phoneTableRow.Cells.Add(phoneNumberTableCell);
                    phoneTableRow.Cells.Add(extensionTableCell);
                    phoneTableRow.Cells.Add(phoneTypeIDTableCell);
                    phoneTableRow.Cells.Add(phoneActionTableCell);
                    phoneTable.Rows.Add(phoneTableRow);
                }

                phTelephoneTable.Controls.Add(phoneTable);
            }

            if (person.Phones.Count == 0)
            {
                System.Web.UI.HtmlControls.HtmlTable phoneTable = new System.Web.UI.HtmlControls.HtmlTable();
                phoneTable.Border      = 1;
                phoneTable.CellPadding = 3;
                HtmlTableRow  headerTableRow   = new HtmlTableRow();
                HtmlTableCell messageTableCell = new HtmlTableCell();

                messageTableCell.InnerText = "Sorry there are no results.";

                headerTableRow.Cells.Add(messageTableCell);

                phoneTable.Rows.Add(headerTableRow);

                phTelephoneTable.Controls.Add(phoneTable);
                //add table and add message that says no entries.
            }
        }
示例#45
0
        public void LoadHtmlTable()
        {
            System.Web.UI.HtmlControls.HtmlTable tblPivot = new System.Web.UI.HtmlControls.HtmlTable();
            tblPivot.CellPadding = 0;
            tblPivot.CellSpacing = 0;
            tblPivot.Width       = "100%";
            tblPivot.Height      = "100%";
            tblPivot.Attributes.Add("class", "tbl1_T");
            pnlPivot.Controls.Add(tblPivot);

            if (_report == null || _report.Cellset.IsValid == false)
            {
                return;
            }

            int Ax0MemCount = _report.Cellset.Axis0TupleMemCount;
            int Ax1MemCount = _report.Cellset.Axis1TupleMemCount;
            int Ax0PosCount = _report.Cellset.Axis0PosCount;
            int Ax1PosCount = _report.Cellset.Axis1PosCount;

            int ax0OrderPos = _report.GetOrderPosition(_report.Axes[0]);
            int ax1OrderPos = _report.GetOrderPosition(_report.Axes[1]);

            Hierarchy ax1Hier = null;
            Hierarchy ax0Hier = null;

            //table
            System.Web.UI.HtmlControls.HtmlTableRow  tr = null;
            System.Web.UI.HtmlControls.HtmlTableCell td = null;

            if (Ax0PosCount == 0 && Ax1PosCount == 0)
            {
                tr = new HtmlTableRow();
                tblPivot.Rows.Add(tr);
                td = new HtmlTableCell();
                tr.Cells.Add(td);
                td.Attributes.Add("class", "tbl1_err");
                td.Attributes.Add("nowrap", "true");
                td.InnerText = "Query successfully executed, cellset contains no data";
                return;
            }


            for (int i = 0; i < Ax0MemCount; i++)
            {
                tr = new System.Web.UI.HtmlControls.HtmlTableRow();
                tblPivot.Rows.Add(tr);

                for (int j = 0; j < Ax1MemCount; j++)
                {
                    td = new System.Web.UI.HtmlControls.HtmlTableCell();
                    td.Attributes.Add("class", "tbl1_HC");
                    td.NoWrap = true;
                    tr.Cells.Add(td);

                    //hier controls in last row
                    if (i == Ax0MemCount - 1)
                    {
                        this.CreateHierControls(_report.Axes[1].Hierarchies[j], td);
                    }
                }

                ax0Hier = _report.Axes[0].Hierarchies[i];
                for (int j = 0; j < Ax0PosCount; j++)
                {
                    CellsetMember mem          = _report.Cellset.GetCellsetMember(0, i, j);
                    bool          inOrderTuple = false;

                    //if same as prev, continue
                    if (j != 0 && _report.Cellset.GetCellsetMember(0, i, j - 1).UniqueName == mem.UniqueName)
                    {
                        continue;
                    }

                    td        = new System.Web.UI.HtmlControls.HtmlTableCell();
                    td.NoWrap = true;

                    // handle order position highlight
                    if (j == ax0OrderPos)                  // in order tuple
                    {
                        inOrderTuple = true;
                    }


                    // handle colspan
                    int spanCount = 1;
                    for (int n = j + 1; n < Ax0PosCount; n++)
                    {
                        CellsetMember nextMem = _report.Cellset.GetCellsetMember(0, i, n);
                        if (nextMem.UniqueName == mem.UniqueName)
                        {
                            spanCount++;

                            // handle order position highlight
                            if (n == ax0OrderPos)
                            {
                                inOrderTuple = true;
                            }
                        }
                        else
                        {
                            break;
                        }
                    }

                    // handle order position highlight
                    if (inOrderTuple)                    // in order tuple
                    {
                        td.Attributes.Add("class", "tbl1_H3");
                    }
                    else
                    {
                        td.Attributes.Add("class", "tbl1_H2");
                    }

                    // if we span
                    if (spanCount > 1)
                    {
                        td.ColSpan = spanCount;
                    }


                    if (mem.ChildCount == 0)
                    {                     // leaf-level
                        System.Web.UI.HtmlControls.HtmlImage img = new System.Web.UI.HtmlControls.HtmlImage();
                        img.Src = "../images/leaf.gif";
                        td.Controls.Add(img);
                    }

                    System.Web.UI.HtmlControls.HtmlInputCheckBox chb = new System.Web.UI.HtmlControls.HtmlInputCheckBox();
                    chb.ID = "m:" + _contr.IdentifierFromCellsetPosition(0, j, i);
                    chb.EnableViewState = false;
                    td.EnableViewState  = false;
                    td.Controls.Add(chb);

                    System.Web.UI.LiteralControl literal = new System.Web.UI.LiteralControl(mem.Name);
                    td.Controls.Add(literal);

                    tr.Cells.Add(td);
                }


                // hier controls in last col
                td = new System.Web.UI.HtmlControls.HtmlTableCell();
                td.Attributes.Add("class", "tbl1_HC");
                td.NoWrap = true;
                CreateHierControls(ax0Hier, td);
                tr.Cells.Add(td);
            }



            for (int i = 0; i < Ax1PosCount; i++)
            {
                tr = new System.Web.UI.HtmlControls.HtmlTableRow();
                tblPivot.Rows.Add(tr);

                for (int j = 0; j < Ax1MemCount; j++)
                {
                    ax1Hier = _report.Axes[1].Hierarchies[j];
                    CellsetMember mem          = _report.Cellset.GetCellsetMember(1, j, i);
                    bool          inOrderTuple = false;

                    //if same as prev, continue
                    if (i != 0 && _report.Cellset.GetCellsetMember(1, j, i - 1).UniqueName == mem.UniqueName)
                    {
                        continue;
                    }

                    td        = new System.Web.UI.HtmlControls.HtmlTableCell();
                    td.NoWrap = true;

                    // handle order position highlight
                    if (i == ax1OrderPos)                  // in order tuple
                    {
                        inOrderTuple = true;
                    }


                    // handle rowspan
                    int spanCount = 1;
                    for (int n = i + 1; n < Ax1PosCount; n++)
                    {
                        CellsetMember nextMem = _report.Cellset.GetCellsetMember(1, j, n);
                        if (nextMem.UniqueName == mem.UniqueName)
                        {
                            spanCount++;

                            // handle order position highlight
                            if (n == ax1OrderPos)
                            {
                                inOrderTuple = true;
                            }
                        }
                        else
                        {
                            break;
                        }
                    }

                    // handle order position highlight
                    if (inOrderTuple)                    // in order tuple
                    {
                        td.Attributes.Add("class", "tbl1_H1");
                    }
                    else
                    {
                        td.Attributes.Add("class", "tbl1_H");
                    }

                    // if we span
                    if (spanCount > 1)
                    {
                        td.RowSpan = spanCount;
                    }



                    if (mem.ChildCount == 0)
                    {                     // leaf-level
                        System.Web.UI.HtmlControls.HtmlImage img = new System.Web.UI.HtmlControls.HtmlImage();
                        img.Src = "../images/leaf.gif";
                        td.Controls.Add(img);
                    }

                    System.Web.UI.HtmlControls.HtmlInputCheckBox chb = new System.Web.UI.HtmlControls.HtmlInputCheckBox();
                    chb.ID = "m:" + _contr.IdentifierFromCellsetPosition(1, i, j);
                    chb.EnableViewState = false;
                    td.EnableViewState  = false;
                    td.Controls.Add(chb);

                    System.Web.UI.LiteralControl literal = new System.Web.UI.LiteralControl(mem.Name);
                    td.Controls.Add(literal);


                    tr.Cells.Add(td);
                }

                for (int j = 0; j < Ax0PosCount; j++)
                {
                    td = new System.Web.UI.HtmlControls.HtmlTableCell();
                    td.Attributes.Add("class", "tbl1_C");
                    td.NoWrap = true;
                    Cell olapCell = _report.Cellset.GetCell(j, i);
                    td.InnerText = olapCell.FormattedValue;
                    tr.Cells.Add(td);
                }
            }
        }
示例#46
0
        //protected void Page_Load(object sender, EventArgs e)
        protected void Page_PreRender(object sender, EventArgs e)
        {
            //Moved from Page_Load because if design is changes Page_Load is performed before
            //the database is updated with the new design. Page_PreRender is performed after
            //the database is updated.
            try
            {
                //if (!IsPostBack)
                //{
                //if (All.Visible)

                if (db.Is_Include_First_Footer_This())
                {
                    #region Visible
                    All.Visible = true;

                    #region HTML Table Attributes
                    HtmlTable FooterFirstHTMLTable = new System.Web.UI.HtmlControls.HtmlTable();
                    FooterFirstHTMLTable.Attributes["cellSpacing"] = "0";
                    FooterFirstHTMLTable.Attributes["padding"]     = "0";
                    FooterFirstHTMLTable.Attributes["border"]      = "0";
                    FooterFirstHTMLTable.Attributes["id"]          = "FooterFirst";
                    if (VotePage.IsPublicPage)
                    {
                        FooterFirstHTMLTable.Attributes["class"] = "tablePage";
                    }
                    else
                    {
                        FooterFirstHTMLTable.Attributes["class"] = "tableAdmin";
                    }
                    #endregion HTML Table Attributes

                    //<tr>
                    //HtmlTableRow FooterFirstHTMLTr = db.AddNavbarRow2Table(FooterFirstHTMLTable);
                    HtmlTableRow FooterFirstHTMLTr =
                        db.Add_Tr_To_Table_Return_Tr(
                            FooterFirstHTMLTable
                            , "trFooterFirst"
                            );

                    string Content = string.Empty;
                    if (SecurePage.IsMasterPage)
                    {
                        Content =
                            MasterDesign.GetDesignStringWithSubstitutions(
                                MasterDesign.Column.FirstFooterAllPages,
                                MasterDesign.Column.IsTextFirstFooterAllPages);
                    }
                    else
                    {
                        Content =
                            DomainDesigns.GetDesignStringWithSubstitutions(
                                DomainDesigns.Column.FirstFooterAllPages,
                                DomainDesigns.Column.IsTextFirstFooterAllPages);
                    }

                    db.Add_Td_To_Tr(
                        FooterFirstHTMLTr
                        , Content
                        , "tdFooterFirst");

                    All.Text = db.RenderToString(FooterFirstHTMLTable);
                    #endregion Visible
                }
                else //if (db.Is_Page_Element_Visible(
                //  db.DomainDesigns_Bool_This(
                //      "IsIncludedFirstFooterAllPages")
                //      , "IsTextFirstFooterAllPages"
                //      , "FirstFooterAllPages"
                //      ))
                {
                    All.Visible = false;
                }
            }
            //}
            catch (Exception ex)
            {
                db.Log_Page_Not_Found_404("FooterFirst.aspx:ex.Message" + ex.Message);
                if (!VotePage.IsDebugging)
                {
                    VotePage.SafeTransferToError500();
                }
            }
        }
 internal HtmlTableRowCollection(HtmlTable owner)
 {
     this.owner = owner;
 }
示例#48
0
        /// <summary>
        /// Gets the items wrapped in a table
        /// </summary>
        /// <param name="nb">The Navbar in which rendering is taking place</param>
        /// <param name="items">The items to render into the group</param>
        /// <returns></returns>
        private string GetChildrenAsTable(NavBar nb, NavBarItems items)
        {
            System.Web.UI.HtmlControls.HtmlTable tbl = new System.Web.UI.HtmlControls.HtmlTable();
            tbl.Border      = 0;
            tbl.CellPadding = 2;
            tbl.CellSpacing = 0;
            tbl.Width       = "100%";

            foreach (NavBarItem itm in items)
            {
                HtmlTableRow tr = new HtmlTableRow();

                string style = string.Empty;
                if (itm.ItemStyle == null || itm.ItemStyle.Base == null)
                {
                    if (nb.DefaultItemStyle == null || nb.DefaultItemStyle.Base == null)
                    {
                        style = string.Empty;
                    }
                    else
                    {
                        style = nb.DefaultItemStyle.Base;
                    }
                }
                else
                {
                    style = itm.ItemStyle.Base;
                }

                string hoverstyle = string.Empty;
                if (itm.ItemStyle == null || itm.ItemStyle.Hover == null)
                {
                    if (nb.DefaultItemStyle == null || nb.DefaultItemStyle.Hover == null)
                    {
                        hoverstyle = string.Empty;
                    }
                    else
                    {
                        hoverstyle = nb.DefaultItemStyle.Hover;
                    }
                }
                else
                {
                    hoverstyle = itm.ItemStyle.Hover;
                }

                tr.Attributes.Add("class", style);
                tr.Style.Add("width", "100%");

                HtmlTableCell td = new HtmlTableCell();
                td.Style.Add("width", "100%");
                td.Attributes.Add("class", style);
                td.Attributes.Add("onmouseover", string.Format("nbItemHighlight(this,'{0}')", hoverstyle));
                td.Attributes.Add("onmouseout", string.Format("nbItemLowlight(this,'{0}')", style));

                HtmlAnchor a = new HtmlAnchor();

                a.HRef = itm.NavigateUrl;
                StringBuilder inner = new StringBuilder();

                if (itm.Image != null && itm.Image.Length > 0)
                {
                    inner.AppendFormat("<img src='{0}'/><br>", itm.Image);
                }

                inner.Append(itm.Text);
                a.InnerHtml = inner.ToString();

                td.Controls.Add(a);

                tr.Cells.Add(td);
                tbl.Rows.Add(tr);
            }

            StringBuilder  sb  = new StringBuilder();
            TextWriter     tw  = new StringWriter(sb);
            HtmlTextWriter htw = new HtmlTextWriter(tw);

            tbl.RenderControl(htw);

            return(sb.ToString());
        }
示例#49
0
        /// <summary>
        /// Returns the Child items wrapped in an HTML table, with correctly formatted
        /// TR and TD elements
        /// </summary>
        /// <param name="items"><see cref="NavBarItem"/> Collection to render</param>
        /// <param name="blockname">The heading that appaears at the top of the block</param>
        /// <param name="selectedcell">The ID of the currently selected cell (so that it can be rendered
        /// with the correct css class)</param>
        /// <returns>An HTMLTable containing al of the items</returns>
        public System.Web.UI.HtmlControls.HtmlTable GetChildrenAsTable(NavBarItems items, string blockname, string selectedcell)
        {
            System.Web.UI.HtmlControls.HtmlTable tbl = new System.Web.UI.HtmlControls.HtmlTable();
            tbl.Border      = 0;
            tbl.CellPadding = 2;
            tbl.CellSpacing = 0;
            tbl.Width       = "100%";

            bool allowed  = !_useroles;
            int  itmcount = 0;

            foreach (NavBarItem itm in items)
            {
                allowed = false;

                if (!this.DesignMode)
                {
                    if (itm.Roles == null || itm.Roles.Equals(string.Empty))
                    {
                        allowed = !_useroles;
                    }
                    else if (itm.Roles != null)
                    {
                        switch (itm.Roles)
                        {
                        case "*":
                            allowed = true;
                            break;

                        case "?":
                            allowed = this.Page.User.Identity.IsAuthenticated;
                            break;

                        default:
                            string[] roles = Convert.ToString(itm.Roles).Split(',');

                            for (int i = 0; i < roles.Length; i++)
                            {
                                if (this.Page.User.IsInRole(roles[i]))
                                {
                                    allowed = true;
                                    break;
                                }
                            }
                            break;
                        }
                    }
                }
                else
                {
                    allowed = true;
                }

                if (allowed)
                {
                    string cellid = blockname + "_nbNavItem_" + (++itmcount).ToString();

                    string selectedstyle = string.Empty;
                    string basestyle     = string.Empty;
                    string hoverstyle    = string.Empty;

                    if (itm.ItemStyle == null || itm.ItemStyle.Selected == null)
                    {
                        if (this.DefaultItemStyle == null || this.DefaultItemStyle.Selected == null)
                        {
                            selectedstyle = string.Empty;
                        }
                        else
                        {
                            selectedstyle = this.DefaultItemStyle.Selected;
                        }
                    }
                    else
                    {
                        selectedstyle = itm.ItemStyle.Selected;
                    }

                    if (itm.ItemStyle == null || itm.ItemStyle.Base == null)
                    {
                        if (this.DefaultItemStyle == null || this.DefaultItemStyle.Base == null)
                        {
                            basestyle = string.Empty;
                        }
                        else
                        {
                            basestyle = this.DefaultItemStyle.Base;
                        }
                    }
                    else
                    {
                        basestyle = itm.ItemStyle.Base;
                    }

                    if (itm.ItemStyle == null || itm.ItemStyle.Hover == null)
                    {
                        if (this.DefaultItemStyle == null || this.DefaultItemStyle.Hover == null)
                        {
                            hoverstyle = string.Empty;
                        }
                        else
                        {
                            hoverstyle = this.DefaultItemStyle.Hover;
                        }
                    }
                    else
                    {
                        hoverstyle = itm.ItemStyle.Hover;
                    }


                    if (selectedcell != string.Empty)
                    {
                        if (selectedcell != cellid)
                        {
                            itm.Selected = false;
                        }
                        else
                        {
                            itm.Selected = true;
                        }
                    }

                    HtmlTableRow tr = new HtmlTableRow();

                    string style = string.Empty;

                    if (itm.Selected)
                    {
                        style = selectedstyle;
                    }
                    else
                    {
                        style = basestyle;
                    }

                    tr.Attributes.Add("class", style);
                    tr.Style.Add("width", "100%");

                    HtmlTableCell td = new HtmlTableCell();
                    td.Style.Add("width", "100%");
                    td.ID = cellid;

                    td.Attributes.Add("class", style);
                    td.Attributes.Add("onmouseover", string.Format("nbItemHighlight(this,'{0}')", hoverstyle));
                    td.Attributes.Add("onmouseout", string.Format("nbItemLowlight(this,'{0}')", style));
                    td.Attributes.Add("selected", itm.Selected.ToString());

                    if (_usereplace)
                    {
                        td.Attributes.Add("onclick", string.Format("nbReplace('{0}', '{1}', '{2}')", cellid, (itm.NavigateUrl == null || itm.NavigateUrl.Equals(string.Empty)) ? "#" : System.Web.HttpUtility.UrlEncode(itm.NavigateUrl), selectedstyle));
                    }
                    else
                    {
                        td.Attributes.Add("onclick", string.Format("nbNavigate('{0}', '{1}', '{2}')", cellid, (itm.NavigateUrl == null || itm.NavigateUrl.Equals(string.Empty)) ? "#" : System.Web.HttpUtility.UrlEncode(itm.NavigateUrl), selectedstyle));
                    }

                    if (itm.Description != null && itm.Description.Length > 0)
                    {
                        td.Attributes.Add("title", System.Web.HttpUtility.HtmlEncode(itm.Description));
                    }

                    HtmlAnchor     a  = new HtmlAnchor();
                    LiteralControl lc = new LiteralControl();

                    a.HRef = string.Format("javascript: {1}('{0}', '{2}', '{3}');", cellid, _usereplace ? "nbReplace" : "nbNavigate", (itm.NavigateUrl == null || itm.NavigateUrl.Equals(string.Empty)) ? "#" : System.Web.HttpUtility.UrlEncode(itm.NavigateUrl), selectedstyle);

                    StringBuilder inner = new StringBuilder();

                    if (itm.Image != null && itm.Image.Length > 0)
                    {
                        inner.AppendFormat("<img src='{0}'/>", itm.Image);
                    }

                    inner.Append("<span class='nbItem'>" + itm.Text + "</span>");

                    lc.Text     = inner.ToString();
                    a.InnerHtml = inner.ToString();

                    td.Controls.Add(lc);


                    tr.Cells.Add(td);
                    tbl.Rows.Add(tr);
                }
            }

            return(tbl);
        }
示例#50
0
        //Creating the HTML header

        public void CreateHeader(ref System.Web.UI.HtmlControls.HtmlTable tblSummary, ref DataTable dtbTemp, string strHeading)
        {
            HtmlTableRow head0       = new HtmlTableRow();
            HtmlTableRow head1       = new HtmlTableRow();
            HtmlTableRow head2       = new HtmlTableRow();
            string       tempColName = string.Empty;
            int          tempSpan    = 0;
            //SalesTurnin_Report Changes.Ch1 :START - Added code not to add the header row for revenue Type in Excel.
            string sales_excel = string.Empty;

            //SalesTurnin_Report Changes.Ch1 :END - Added code not to add the header row for revenue Type in Excel.


            AddColumn(ref head0, strHeading, dtbTemp.Columns.Count + 1, 1, "", "", "left");


            //Creating the header by seperating the names using '|' seperator

            foreach (DataColumn dtCol in dtbTemp.Columns)
            {
                string   colLeft = string.Empty;
                string   colRight;
                string[] strTempArr;

                strTempArr = dtCol.ColumnName.Split('|');

                if (strTempArr.Length > 1)
                {
                    colLeft = strTempArr[0].ToString();
                    //SalesTurnin_Report Changes.Ch1 :START - Added code not to add the header row for revenue Type in Excel.
                    if (colLeft == "PAYMENT TYPE")
                    {
                        sales_excel = colLeft;
                    }
                    //SalesTurnin_Report Changes.Ch1 :END - Added code not to add the header row for revenue Type in Excel.
                    colRight = strTempArr[1].ToString();
                }
                else
                {
                    AddColumn(ref head1, "PAYMENT TYPE", 1, 2, "item_template_header_white");
                    continue;
                }

                tempSpan++;
                if (colLeft != tempColName)
                {
                    if (tempColName != string.Empty)
                    {
                        AddColumn(ref head1, tempColName, tempSpan - 1, "item_template_header_white");
                    }
                    tempColName = colLeft;
                    tempSpan    = 1;
                }
                //AddColumn(ref head2, colRight, 1, "item_template_header_white");
                //SalesTurnin_Report Changes.Ch1 :START - Added code not to add the header row for revenue Type in Excel.
                if (sales_excel != "PAYMENT TYPE")
                {
                    AddColumn(ref head2, colRight, 1, "item_template_header_white");
                }
                //SalesTurnin_Report Changes.Ch1 :END - Added code not to add the header row for revenue Type in Excel.
            }

            if (dtbTemp.Columns.Count > 0)
            {
                AddColumn(ref head1, tempColName, tempSpan, "item_template_header_white");
                //AddColumn(ref head1,"SUBTOTAL",1,2,"collection_summary_footer");
                //SalesTurnin_Report Changes.Ch1 :START - Added code not to add the header row for revenue Type in Excel.
                if (sales_excel != "PAYMENT TYPE")
                {
                    AddColumn(ref head1, "SUBTOTAL", 1, 2, "collection_summary_footer");
                }
                else
                {
                    AddColumn(ref head1, "SUBTOTAL", 1, "item_template_header_white");
                }
                //SalesTurnin_Report Changes.Ch1 :END - Added code not to add the header row for revenue Type in Excel.
            }
            head0.Attributes.Add("class", "item_template_header");
            head1.Attributes.Add("class", "arial_12_bold");
            head1.Attributes.Add("align", "center");
            head2.Attributes.Add("class", "arial_12_bold");
            tblSummary.Rows.Add(head0);
            tblSummary.Rows.Add(head1);
            //tblSummary.Rows.Add(head2);
            //SalesTurnin_Report Changes.Ch1 :START - Added code not to add the header row for revenue Type in Excel.
            if (sales_excel != "PAYMENT TYPE")
            {
                tblSummary.Rows.Add(head2);
            }
            //SalesTurnin_Report Changes.Ch1 :END - Added code not to add the header row for revenue Type in Excel.
        }
示例#51
0
        //Add the data to the HTML table
        public void AddCollSummaryData(ref System.Web.UI.HtmlControls.HtmlTable tblSummary, ref DataTable dtbTemp)
        {
            int intColCount = dtbTemp.Columns.Count - 1;

            // 22% width for payment type column, 15 % width for Total Column
            // 65% is shared by all other data columns
            if (intColCount != 0)
            {
                //For Print Version, Width is assigned in the page itself.
                //For all other pages, Width is explicitly made to "0" in the page load.
                int TableWidth = Convert.ToInt32(tblSummary.Attributes["Width"].ToString());

                int FixedWidth = 0;

                if (tblSummary.Attributes["FixedWidth"] == null)
                {
                    FixedWidth = ((intColCount * 91) + 225);
                }
                else
                {
                    FixedWidth = Convert.ToInt32(tblSummary.Attributes["FixedWidth"].ToString());
                }

                if (TableWidth == 0)
                {
                    tblSummary.Attributes.Add("Width", Convert.ToString((intColCount * 91) + 225));
                }
                else if (((intColCount * 91) + 225) < FixedWidth)
                {
                    tblSummary.Attributes.Add("Width", Convert.ToString((intColCount * 91) + 225));
                }
                else
                {
                    tblSummary.Attributes.Add("Width", FixedWidth.ToString());
                }

                intColCount = Convert.ToInt32(63 / intColCount);
                if (intColCount > 16)
                {
                    intColCount = 16;
                }
            }
            string strWidth = intColCount.ToString() + "%";

            foreach (DataRow dr in dtbTemp.Rows)
            {
                HtmlTableRow hRow  = new HtmlTableRow();
                decimal      dcTot = 0;
                foreach (DataColumn dtCol in dtbTemp.Columns)
                {
                    if (dtCol.ColumnName != "PayType")
                    {
                        dcTot = dcTot + Convert.ToDecimal(dr[dtCol.ColumnName.ToString()].ToString());
                        AddColumn(ref hRow, Convert.ToDecimal(dr[dtCol.ColumnName.ToString()].ToString()).ToString("$##0.00"), 1, 1, "item_template_header_white_nobold", strWidth, "right");
                    }
                    else
                    {
                        AddColumn(ref hRow, "Total " + dr[dtCol.ColumnName.ToString()].ToString(), 1, 1, "item_template_header_white", "135", "left");
                    }
                }
                AddColumn(ref hRow, Convert.ToDecimal(dcTot.ToString()).ToString("$##0.00"), 1, 1, "collection_summary_footer", "", "right");
                tblSummary.Rows.Add(hRow);
            }
        }
示例#52
0
        private void loadPhones(Person person)
        {
            //Work on the loadPhones function
            //BusinessObjects.Person person1 = new Person(1);
            //person = person1;
            person = new Person(1);
            if (person.Phones.Count > 0)
            {
                System.Web.UI.HtmlControls.HtmlTable phoneTable = new System.Web.UI.HtmlControls.HtmlTable();
                phoneTable.Border      = 1;
                phoneTable.CellPadding = 3;
                HtmlTableRow  headerTableRow             = new HtmlTableRow();
                HtmlTableCell phoneIDHeaderTableCell     = new HtmlTableCell();
                HtmlTableCell areaCodeHeaderTableCell    = new HtmlTableCell();
                HtmlTableCell phoneNumberHeaderTableCell = new HtmlTableCell();
                HtmlTableCell extensionHeaderTableCell   = new HtmlTableCell();
                HtmlTableCell phoneTypeIDHeaderTableCell = new HtmlTableCell();
                HtmlTableCell phoneActionHeaderTableCell = new HtmlTableCell();

                phoneIDHeaderTableCell.InnerText     = "Phone ID";
                areaCodeHeaderTableCell.InnerText    = "Area Code";
                phoneNumberHeaderTableCell.InnerText = "Phone Number";
                extensionHeaderTableCell.InnerText   = "Extension";
                phoneTypeIDHeaderTableCell.InnerText = "Phone Type ID";
                phoneActionHeaderTableCell.InnerText = "Action";

                headerTableRow.Cells.Add(phoneIDHeaderTableCell);
                headerTableRow.Cells.Add(areaCodeHeaderTableCell);
                headerTableRow.Cells.Add(phoneNumberHeaderTableCell);
                headerTableRow.Cells.Add(extensionHeaderTableCell);
                headerTableRow.Cells.Add(phoneTypeIDHeaderTableCell);
                headerTableRow.Cells.Add(phoneActionHeaderTableCell);

                phoneTable.Rows.Add(headerTableRow);

                foreach (BusinessObjects.Phone phone in person.Phones)
                {
                    HtmlTableRow  phoneTableRow        = new HtmlTableRow();
                    HtmlTableCell phoneIDTableCell     = new HtmlTableCell();
                    HtmlTableCell areaCodeTableCell    = new HtmlTableCell();
                    HtmlTableCell phoneNumberTableCell = new HtmlTableCell();
                    HtmlTableCell extensionTableCell   = new HtmlTableCell();
                    HtmlTableCell phoneTypeIDTableCell = new HtmlTableCell();
                    HtmlTableCell phoneActionTableCell = new HtmlTableCell();

                    phoneIDTableCell.InnerText     = phone.PhoneID.ToString(); //some time wrap in some control, JQuery
                    areaCodeTableCell.InnerText    = phone.AreaCode.ToString();
                    phoneNumberTableCell.InnerText = phone.PhoneNumber.ToString();
                    extensionTableCell.InnerText   = phone.Extension.ToString();
                    phoneTypeIDTableCell.InnerText = phone.PhoneTypeID.ToString();

                    int            x       = person.ID;
                    int            y       = phone.PhoneID;
                    LiteralControl litEdit = new LiteralControl();

                    phoneTableRow.Cells.Add(phoneIDTableCell);
                    phoneTableRow.Cells.Add(areaCodeTableCell);
                    phoneTableRow.Cells.Add(phoneNumberTableCell);
                    phoneTableRow.Cells.Add(extensionTableCell);
                    phoneTableRow.Cells.Add(phoneTypeIDTableCell);
                    phoneTableRow.Cells.Add(phoneActionTableCell);
                    phoneTable.Rows.Add(phoneTableRow);
                }

                phTelephoneTable.Controls.Add(phoneTable);
            }

            if (person.Phones.Count == 0)
            {
                System.Web.UI.HtmlControls.HtmlTable phoneTable = new System.Web.UI.HtmlControls.HtmlTable();
                phoneTable.Border      = 1;
                phoneTable.CellPadding = 3;
                HtmlTableRow  headerTableRow   = new HtmlTableRow();
                HtmlTableCell messageTableCell = new HtmlTableCell();

                messageTableCell.InnerText = "Sorry there are no results.";

                headerTableRow.Cells.Add(messageTableCell);

                phoneTable.Rows.Add(headerTableRow);

                phTelephoneTable.Controls.Add(phoneTable);
            }
        }
示例#53
0
        private void fillEmailAddresses()
        {
            BusinessObjects.Person person = new BusinessObjects.Person(1);

            if (person.EmailAddresses.Count > 0)
            {
                System.Web.UI.HtmlControls.HtmlTable emailAddressTable = new System.Web.UI.HtmlControls.HtmlTable();
                emailAddressTable.Border      = 1;
                emailAddressTable.CellPadding = 3;
                HtmlTableRow  headerTableRow = new HtmlTableRow();
                HtmlTableCell emailAddressIDHeaderTableCell = new HtmlTableCell();
                HtmlTableCell addressHeaderTableCell        = new HtmlTableCell();
                HtmlTableCell personIDHeaderTableCell       = new HtmlTableCell();
                HtmlTableCell emailActionHeaderTableCell    = new HtmlTableCell();

                emailAddressIDHeaderTableCell.InnerText = "Email Address ID";
                addressHeaderTableCell.InnerText        = "Address";
                personIDHeaderTableCell.InnerText       = "Person ID";
                emailActionHeaderTableCell.InnerText    = "Action";

                headerTableRow.Cells.Add(emailAddressIDHeaderTableCell);
                headerTableRow.Cells.Add(addressHeaderTableCell);
                headerTableRow.Cells.Add(personIDHeaderTableCell);
                headerTableRow.Cells.Add(emailActionHeaderTableCell);

                emailAddressTable.Rows.Add(headerTableRow);

                foreach (BusinessObjects.EmailAddress emailAddress in person.EmailAddresses)
                {
                    HtmlTableRow  emailAddressTableRow    = new HtmlTableRow();
                    HtmlTableCell emailAddressIDTableCell = new HtmlTableCell();
                    HtmlTableCell addressTableCell        = new HtmlTableCell();
                    HtmlTableCell personIDTableCell       = new HtmlTableCell();
                    HtmlTableCell emailActionTableCell    = new HtmlTableCell();

                    emailAddressIDTableCell.InnerText = emailAddress.EmailAddressID.ToString(); //some time wrap in some control, JQuery
                    addressTableCell.InnerText        = emailAddress.Address.ToString();
                    personIDTableCell.InnerText       = emailAddress.PersonID.ToString();
                    //////  emailTableCell.InnerHtml = "<FORM><INPUT Type='BUTTON' VALUE='Delete' ONCLICK='window.location.href='http://www.treasurepointaudio.com''><INPUT Type='BUTTON' VALUE='Update' ONCLICK='window.location.href='http://www.treasurepointaudio.com''></FORM>";
                    int x = person.ID;
                    int y = emailAddress.EmailAddressID;

                    HtmlInputButton btnDelete = new HtmlInputButton();
                    btnDelete.Attributes.Add("value", "Delete");
                    btnDelete.Attributes.Add("onclick", "window.location='EmailForm.aspx?Mode=Delete&PersonID=" + x + "&EmailAddressID=" + y + "'");

                    HtmlInputButton btn4 = new HtmlInputButton();
                    btn4.Attributes.Add("value", "Update");

                    btn4.Attributes.Add("onclick", "window.location='EmailForm.aspx?Mode=Edit&PersonID=" + x + "&EmailAddressID=" + y + "'");
                    emailActionTableCell.Controls.Add(btnDelete);
                    emailActionTableCell.Controls.Add(btn4);

                    emailAddressTableRow.Cells.Add(emailAddressIDTableCell);
                    emailAddressTableRow.Cells.Add(addressTableCell);
                    emailAddressTableRow.Cells.Add(personIDTableCell);
                    emailAddressTableRow.Cells.Add(emailActionTableCell);

                    emailAddressTable.Rows.Add(emailAddressTableRow);
                }
                //this.Controls.Add(emailAddressTable);
                phEmailAddressTable.Controls.Add(emailAddressTable);
            }

            if (person.EmailAddresses.Count == 0)
            {
                System.Web.UI.HtmlControls.HtmlTable emailAddressTable = new System.Web.UI.HtmlControls.HtmlTable();
                emailAddressTable.Border      = 1;
                emailAddressTable.CellPadding = 3;
                HtmlTableRow  headerTableRow   = new HtmlTableRow();
                HtmlTableCell messageTableCell = new HtmlTableCell();

                messageTableCell.InnerText = "Sorry there are no results.";

                headerTableRow.Cells.Add(messageTableCell);

                emailAddressTable.Rows.Add(headerTableRow);
                phEmailAddressTable.Controls.Add(emailAddressTable);
            }
        }
示例#54
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BusinessObjects.Person person = new BusinessObjects.Person(1);

            litPersonID.Text  = person.ID.ToString();
            litTitle.Text     = person.Title;
            litFirstName.Text = person.FirstName;
            litLastName.Text  = person.LastName;

            if (person.Addresses.Count > 0)
            {
                System.Web.UI.HtmlControls.HtmlTable    addressTable    = new System.Web.UI.HtmlControls.HtmlTable();
                System.Web.UI.HtmlControls.HtmlTableRow addressIDRow    = new System.Web.UI.HtmlControls.HtmlTableRow();
                System.Web.UI.HtmlControls.HtmlTableRow addressDataRow  = new System.Web.UI.HtmlControls.HtmlTableRow();
                System.Web.UI.HtmlControls.HtmlTableRow addressDataRow2 = new System.Web.UI.HtmlControls.HtmlTableRow();


                System.Web.UI.HtmlControls.HtmlTableCell addressIDLabelCell = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell str1LabelCell      = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell str2LabelCell      = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell citLabelCell       = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell stLabelCell        = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell zLabelCell         = new System.Web.UI.HtmlControls.HtmlTableCell();

                System.Web.UI.HtmlControls.HtmlTableCell addressIDLiteralCell = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell str1LiteralCell      = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell str2LiteralCell      = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell citLiteralCell       = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell stLiteralCell        = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell zLiteralCell         = new System.Web.UI.HtmlControls.HtmlTableCell();


                Label   lblAddID = new Label();
                Literal litAddID = new Literal();
                Label   lblStr1  = new Label();
                Literal litStr1  = new Literal();
                Label   lblStr2  = new Label();
                Literal litStr2  = new Literal();
                Label   lblCit   = new Label();
                Literal litCit   = new Literal();
                Label   lblSt    = new Label();
                Literal litSt    = new Literal();
                Label   lblZ     = new Label();
                Literal litZ     = new Literal();

                lblAddID.Text = "Address ID: ";
                lblStr1.Text  = "Street 1: ";
                lblStr2.Text  = "Street 2: ";
                lblCit.Text   = "City: ";
                lblSt.Text    = "State: ";
                lblZ.Text     = "Zip: ";
                int i = 0;
                litAddID.Text = person.Addresses[i].AddressID.ToString();
                litStr1.Text  = person.Addresses[i].Street1.ToString();
                litStr2.Text  = person.Addresses[i].Street2.ToString();
                litCit.Text   = person.Addresses[i].City.ToString();
                litSt.Text    = person.Addresses[i].State.ToString();
                litZ.Text     = person.Addresses[i].Zip.ToString();


                addressIDLabelCell.Controls.Add(lblAddID);  //the addressIDLabelCell
                addressIDLiteralCell.Controls.Add(litAddID);
                str1LabelCell.Controls.Add(lblStr1);
                // str1LiteralCell.Controls.Add(litStr1);
                str2LabelCell.Controls.Add(lblStr2);
                //   str2LiteralCell.Controls.Add(litStr2);
                citLabelCell.Controls.Add(lblCit);
                // citLiteralCell.Controls.Add(litCit);
                stLabelCell.Controls.Add(lblSt);
                //  stLiteralCell.Controls.Add(litSt);
                zLabelCell.Controls.Add(lblZ);
                //  zLiteralCell.Controls.Add(litZ);

                //This is what displays the labels on the first row. AddressID, Street, Street, City, State, Zip
                addressTable.Rows.Add(addressIDRow);
                addressIDRow.Cells.Add(addressIDLabelCell);
                addressIDRow.Cells.Add(str1LabelCell);
                addressIDRow.Cells.Add(str2LabelCell);
                addressIDRow.Cells.Add(citLabelCell);
                addressIDRow.Cells.Add(stLabelCell);
                addressIDRow.Cells.Add(zLabelCell);


                foreach (BusinessObjects.PersonAddress personAddresses in person.Addresses)
                {
                    //69 to 99 on webform 3
                    addressDataRow       = new HtmlTableRow();
                    addressIDLiteralCell = new System.Web.UI.HtmlControls.HtmlTableCell();
                    str1LiteralCell      = new System.Web.UI.HtmlControls.HtmlTableCell();
                    str2LiteralCell      = new System.Web.UI.HtmlControls.HtmlTableCell();
                    citLiteralCell       = new System.Web.UI.HtmlControls.HtmlTableCell();
                    stLiteralCell        = new System.Web.UI.HtmlControls.HtmlTableCell();
                    zLiteralCell         = new System.Web.UI.HtmlControls.HtmlTableCell();

                    litAddID.Text = person.Addresses[i].AddressID.ToString();
                    litStr1.Text  = person.Addresses[i].Street1.ToString();
                    litStr2.Text  = person.Addresses[i].Street2.ToString();
                    litCit.Text   = person.Addresses[i].City.ToString();
                    litSt.Text    = person.Addresses[i].State.ToString();
                    litZ.Text     = person.Addresses[i].Zip.ToString();

                    addressIDLiteralCell.Controls.Add(litAddID);
                    //str1LabelCell.Controls.Add(lblStr1);
                    str1LiteralCell.Controls.Add(litStr1);
                    //str2LabelCell.Controls.Add(lblStr2);
                    str2LiteralCell.Controls.Add(litStr2);
                    //citLabelCell.Controls.Add(lblCit);
                    citLiteralCell.Controls.Add(litCit);
                    // stLabelCell.Controls.Add(lblSt);
                    stLiteralCell.Controls.Add(litSt);
                    // zLabelCell.Controls.Add(lblZ);
                    zLiteralCell.Controls.Add(litZ);

                    addressDataRow.Cells.Add(addressIDLiteralCell);
                    addressDataRow.Cells.Add(str1LiteralCell);

                    addressDataRow.Cells.Add(str2LiteralCell);
                    addressDataRow.Cells.Add(citLiteralCell);
                    addressDataRow.Cells.Add(stLiteralCell);
                    addressDataRow.Cells.Add(zLiteralCell);

                    addressTable.Rows.Add(addressDataRow);


                    Page.Form.Controls.Add(addressTable);
                    this.Controls.Add(addressTable);
                }
            }
        }
示例#55
0
        private void fillPersonAddresses()
        {
            BusinessObjects.Person person = new BusinessObjects.Person(1);
            if (person.Addresses.Count > 0)
            {
                System.Web.UI.HtmlControls.HtmlTable addressTable = new System.Web.UI.HtmlControls.HtmlTable();
                addressTable.Border      = 1;
                addressTable.CellPadding = 3; //properties on rows and cells


                HtmlTableRow  headerTableRow               = new HtmlTableRow();
                HtmlTableCell addressIDHeaderTableCell     = new HtmlTableCell();
                HtmlTableCell street1HeaderTableCell       = new HtmlTableCell();
                HtmlTableCell street2HeaderTableCell       = new HtmlTableCell();
                HtmlTableCell cityHeaderTableCell          = new HtmlTableCell();
                HtmlTableCell stateHeaderTableCell         = new HtmlTableCell();
                HtmlTableCell zipHeaderTableCell           = new HtmlTableCell();
                HtmlTableCell addressActionHeaderTableCell = new HtmlTableCell();

                addressIDHeaderTableCell.InnerText     = "AddressID";
                street1HeaderTableCell.InnerText       = "Street 1";
                street2HeaderTableCell.InnerText       = "Street 2";
                cityHeaderTableCell.InnerText          = "City";
                stateHeaderTableCell.InnerText         = "State";
                zipHeaderTableCell.InnerText           = "Zip";
                addressActionHeaderTableCell.InnerText = "Action";

                headerTableRow.Cells.Add(addressIDHeaderTableCell);
                headerTableRow.Cells.Add(street1HeaderTableCell);
                headerTableRow.Cells.Add(street2HeaderTableCell);
                headerTableRow.Cells.Add(cityHeaderTableCell);
                headerTableRow.Cells.Add(stateHeaderTableCell);
                headerTableRow.Cells.Add(zipHeaderTableCell);
                headerTableRow.Cells.Add(addressActionHeaderTableCell);

                addressTable.Rows.Add(headerTableRow);

                foreach (BusinessObjects.PersonAddress personAddress in person.Addresses)
                {
                    HtmlTableRow  addressTableRow        = new HtmlTableRow();
                    HtmlTableCell addressIDTableCell     = new HtmlTableCell();
                    HtmlTableCell street1TableCell       = new HtmlTableCell();
                    HtmlTableCell street2TableCell       = new HtmlTableCell();
                    HtmlTableCell cityTableCell          = new HtmlTableCell();
                    HtmlTableCell stateTableCell         = new HtmlTableCell();
                    HtmlTableCell zipTableCell           = new HtmlTableCell();
                    HtmlTableCell addressActionTableCell = new HtmlTableCell();

                    addressIDTableCell.InnerText = personAddress.AddressID.ToString(); //some time wrap in some control, JQuery
                    street1TableCell.InnerText   = personAddress.Street1.ToString();
                    street2TableCell.InnerText   = personAddress.Street2.ToString();
                    cityTableCell.InnerText      = personAddress.City.ToString();
                    stateTableCell.InnerText     = personAddress.State.ToString();
                    zipTableCell.InnerText       = personAddress.Zip.ToString();

                    PlaceHolder    ph      = new PlaceHolder();
                    LinkButton     lbe     = new LinkButton();
                    LiteralControl litEdit = new LiteralControl();

                    int x = person.ID;
                    // int yy = emailAddress.EmailAddressID;
                    int y = personAddress.AddressID;
                    // addressActionTableCell.InnerHtml = "<INPUT Type='BUTTON' VALUE='Edit' ONCLICK='window.location.href='http://www.treasurepointaudio.com''><INPUT Type='BUTTON' VALUE='Delete' ONCLICK='window.location.href='http://www.treasurepointaudio.com''>";
                    HtmlInputButton btn = new HtmlInputButton();
                    btn.Attributes.Add("value", "Delete");

                    btn.Attributes.Add("onclick", "window.location='AddressForm.aspx?Mode=Delete&PersonID=" + x + "&AddressID=" + y + "'");

                    // btn_delete.Attributes.Add("onclick", "if(confirm('Are you sure that you want to delete this comment?')){return true;} else {return false;};");



                    HtmlInputButton btn2 = new HtmlInputButton();
                    btn2.Attributes.Add("value", "Update");

                    //btn2.Attributes.Add("onclick", "window.location.href='http://www.treasurepointaudio.com");
                    btn2.Attributes.Add("onclick", "window.location='AddressForm.aspx?Mode=Edit&PersonID=" + x + "&AddressID=" + y + "'");

                    addressActionTableCell.Controls.Add(btn);
                    addressActionTableCell.Controls.Add(btn2);
                    addressTableRow.Cells.Add(addressIDTableCell);
                    addressTableRow.Cells.Add(street1TableCell);
                    addressTableRow.Cells.Add(street2TableCell);
                    addressTableRow.Cells.Add(cityTableCell);
                    addressTableRow.Cells.Add(stateTableCell);
                    addressTableRow.Cells.Add(zipTableCell);
                    addressTableRow.Cells.Add(addressActionTableCell);

                    addressTable.Rows.Add(addressTableRow);
                }
                // this.Controls.Add(addressTable);
                phAddressTable.Controls.Add(addressTable);
            }

            if (person.Addresses.Count == 0)
            {
                System.Web.UI.HtmlControls.HtmlTable addressTable = new System.Web.UI.HtmlControls.HtmlTable();
                addressTable.Border      = 1;
                addressTable.CellPadding = 3;
                HtmlTableRow  headerTableRow   = new HtmlTableRow();
                HtmlTableCell messageTableCell = new HtmlTableCell();

                //message results for Addresses Tables if there are no results
                messageTableCell.InnerText = "Sorry there are no results.";
                headerTableRow.Cells.Add(messageTableCell);
                addressTable.Rows.Add(headerTableRow);

                phAddressTable.Controls.Add(addressTable);
            }
        }
示例#56
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            #region 设置所有菜单为隐藏

            tblUserInfo.Visible        = false;
            tblOilReports.Visible      = false;
            tblOilTotalReports.Visible = false;
            tblOilListReports.Visible  = false;
            tblMemberReports.Visible   = false;
            tblSysManage.Visible       = false;

            #endregion

            #region 显示当前登录用户信息

            //Session.RemoveAll();
            if (Session[ConstValue.LOGIN_USER_SESSION] != null)
            {
                Oper operCurrent = Session[ConstValue.LOGIN_USER_SESSION] as Oper;
                //this.lblUserId.Text     = operCurrent.cnvcOperName;
                this.lblUserName.Text = operCurrent.cnvcOperName;

                Hashtable lstDept = new Hashtable();
                DataTable tblDept = DeptFacade.GetAllDept();

                foreach (DataRow row in tblDept.Rows)
                {
                    Dept objDept = new Dept(row);
                    if (null == lstDept[objDept.cnvcDeptID])
                    {
                        lstDept.Add(objDept.cnvcDeptID, objDept);
                    }
                }
                Dept topDept = new Dept();
                topDept.cnvcDeptName = CommonStatic.EnterpriseShortName();
                topDept.cnvcDeptID   = "00";
                lstDept.Add(topDept.cnvcDeptID, topDept);


                //Hashtable lstDept = Application[ConstValue.DEPT_DICTI_NAME] as Hashtable;
                Dept deptCurrent = lstDept[operCurrent.cnvcDeptID] as Dept;

                this.lblDeptName.Text = deptCurrent.cnvcDeptName;
                Session[ConstValue.LOGIN_DEPT_SESSION] = deptCurrent;
            }
            else
            {
                this.lblDeptName.Text = "";
                this.lblUserName.Text = "";
                //this.lblAddDate.Text = "";
                //this.lblLoginTime.Text = "";
                //this.lblLoginCount.Text = "";

                return;
            }

            #endregion



            #region 控制当前显示菜单

            string strShowMenuID = String.Empty;
            if (null != Request[ConstValue.SHOW_MENU_ARGS])
            {
                strShowMenuID = Request[ConstValue.SHOW_MENU_ARGS].ToString();
            }
            switch (strShowMenuID)
            {
            case "tblOilReports":
            case "tblOilTotalReports":
            case "tblOilListReports":
            case "tblMemberReports":
            case "tblSysManage":
                System.Web.UI.HtmlControls.HtmlTable tblCurrent = this.FindControl(strShowMenuID) as HtmlTable;
                tblCurrent.Visible = true;
                SetMenuShowByUserPurview(tblCurrent, tblCurrent, Session[ConstValue.LOGIN_USER_PURVIEW_SESSION] as ArrayList);
                break;
            }
            tblUserInfo.Visible = true;

            #endregion
        }
示例#57
0
    public string get_report_condition(CrystalReportViewer CrystalReportViewer1, string file_name, System.Web.UI.HtmlControls.HtmlTable lb_table)
    {
        // CrystalReport.rpt是水晶报表文件的名称;CrystalReportSource1是从工具箱加到页面上的水晶报表数据源对像。

        string ls_conditon = "";

        try
        {
            CrystalReportSource cs = new CrystalReportSource();
            cs.ReportDocument.Load(file_name);
            cs.ReportDocument.SetDataSource(dt_report);
            cs.DataBind();


            for (int i = 0; i < cs.ReportDocument.ParameterFields.Count; i++)
            {
                //string ls_part .Name;
                ParameterField param = cs.ReportDocument.ParameterFields[i];

                HtmlTableRow tr = new HtmlTableRow();

                HtmlTableCell td1 = new HtmlTableCell();

                td1.InnerHtml = param.PromptText;

                tr.Cells.Add(td1);

                HtmlTableCell td2 = new HtmlTableCell();
                td2.InnerHtml = "<span> =</span>";
                tr.Cells.Add(td2);

                HtmlTableCell td3 = new HtmlTableCell();
                td3.InnerHtml = "<input type=\"text\" >";
                tr.Cells.Add(td3);

                lb_table.Rows.Add(tr);
            }
            return("1");
        }
        catch (Exception e)
        {
            return("-1");
        }
        return("0");
    }
示例#58
0
        /// <summary>
        /// Render this control to the output parameter specified.
        /// </summary>
        /// <param name="output"> The HTML writer to write out to </param>
        protected override void Render(HtmlTextWriter output)
        {
            StringBuilder sb = new StringBuilder();

            System.Reflection.Assembly thisExe;
            thisExe = System.Reflection.Assembly.GetExecutingAssembly();
            string [] resources = thisExe.GetManifestResourceNames();

            for (int i = 0; i < resources.Length; i++)
            {
                if (resources[i].EndsWith("navbar.js"))
                {
                    TextReader sr = new StreamReader(thisExe.GetManifestResourceStream(resources[i]), System.Text.Encoding.UTF8);
                    output.Write(sr.ReadToEnd());
                }
            }

            if (_classnavbar != null && _classnavbar != string.Empty)
            {
                base.Attributes.Add("class", _classnavbar);
            }

            base.AddAttributesToRender(output);

            base.RenderBeginTag(output);

            bool expando = false;

            foreach (NavBarBlock bl in this.Blocks)
            {
                if (bl.Expanded)
                {
                    expando = true;
                    break;
                }
            }

            if (!expando && this.Blocks.Count > 0)
            {
                this.Blocks[0].Expanded = true;
            }

            expando = false;
            int blockid = 0;

            foreach (NavBarBlock bl in this.Blocks)
            {
                bool allowed = !_useroles;

                foreach (NavBarItem itm in bl.Items)
                {
                    if (!this.DesignMode)
                    {
                        if (itm.Roles == null || itm.Roles.Equals(string.Empty))
                        {
                            allowed = !_useroles;
                        }
                        else if (itm.Roles != null)
                        {
                            switch (itm.Roles)
                            {
                            case "*":
                                allowed = true;
                                break;

                            case "?":
                                allowed = this.Page.User.Identity.IsAuthenticated;
                                break;

                            default:
                                string[] roles = Convert.ToString(itm.Roles).Split(',');

                                for (int i = 0; i < roles.Length; i++)
                                {
                                    if (this.Page.User.IsInRole(roles[i]))
                                    {
                                        allowed = true;
                                        break;
                                    }
                                }
                                break;
                            }
                        }
                    }
                    else
                    {
                        allowed = true;
                    }
                }

                if (bl.Items.Count > 0 && allowed)
                {
                    HttpCookie cookie       = this.Parent.Page.Request.Cookies["Expanded"];
                    string     prevexpanded = string.Empty;
                    string     blockname    = string.Format("nbBlock_{0}", (++blockid).ToString());

                    if (cookie != null)
                    {
                        prevexpanded = cookie.Value;
                    }

                    cookie = this.Parent.Page.Request.Cookies["Selected"];
                    string selected = string.Empty;

                    if (cookie != null)
                    {
                        selected = cookie.Value;
                    }

                    output.WriteBeginTag("div");
                    output.Write(" class='block'");
                    output.Write(string.Format(" id='{0}' ", blockname));
                    output.Write(">");

                    string expanded  = string.Empty;
                    string collapsed = string.Empty;

                    if (prevexpanded != string.Empty)
                    {
                        if (prevexpanded == blockname)
                        {
                            bl.Expanded = true;
                        }
                        else
                        {
                            bl.Expanded = false;
                        }
                    }

                    if (bl.BlockStyle == null || bl.BlockStyle.Closed == null)
                    {
                        if (!(this.DefaultBlockStyle == null || this.DefaultBlockStyle.Closed == null))
                        {
                            collapsed = this.DefaultBlockStyle.Closed;
                        }
                    }
                    else
                    {
                        collapsed = this.DefaultBlockStyle.Closed;
                    }

                    if (bl.BlockStyle == null || bl.BlockStyle.Expanded == null)
                    {
                        if (!(this.DefaultBlockStyle == null || this.DefaultBlockStyle.Expanded == null))
                        {
                            expanded = this.DefaultBlockStyle.Expanded;
                        }
                    }
                    else
                    {
                        expanded = this.DefaultBlockStyle.Expanded;
                    }

                    //output.WriteAttribute("expanded", "false");

                    //Block Header
                    if (!bl.Expanded)
                    {
                        output.WriteBeginTag("div");
                        output.WriteAttribute("class", collapsed);
                        output.WriteAttribute("expanded", "false");
                    }
                    else
                    {
                        output.WriteBeginTag("div");
                        output.WriteAttribute("class", expanded);
                        output.WriteAttribute("expanded", "true");
                    }

                    output.WriteAttribute("onclick", string.Format("nbToggleBlock(this, '{0}', '{1}')", collapsed, expanded));
                    output.Write(">");
                    if (bl.Image != null && bl.Image.ToString() != "")
                    {
                        output.Write("<img src='" + bl.Image + "'/>&nbsp;");
                    }

                    output.Write(bl.Text);
                    output.WriteEndTag("div");
                    //End Block Header

                    //Item Area
                    output.WriteBeginTag("div");
                    if (bl.BlockStyle == null || bl.BlockStyle.ItemArea == null)
                    {
                        if (this.DefaultBlockStyle == null || this.DefaultBlockStyle.ItemArea == null)
                        {
                            output.Write(" class=''");
                        }
                        else
                        {
                            output.WriteAttribute("class", this.DefaultBlockStyle.ItemArea);
                        }
                    }
                    else
                    {
                        output.WriteAttribute("class", bl.BlockStyle.ItemArea);
                    }

                    if (!bl.Expanded)
                    {
                        output.WriteAttribute("style", "display:none;overflow-x:hidden; overflow-y: auto");
                    }
                    else
                    {
                        output.WriteAttribute("style", "display:block;overflow-x:hidden; overflow-y: auto");
                    }

                    output.Write(">");

                    System.Web.UI.HtmlControls.HtmlTable tbl = GetChildrenAsTable(bl.Items, blockname, selected);

                    tbl.RenderControl(output);

                    output.WriteEndTag("div");
                    //End Item Area
                    output.WriteEndTag("div");
                }
            }

            base.RenderEndTag(output);
        }