コード例 #1
0
        public static void ToExcelF(System.Web.UI.HtmlControls.HtmlTable Table1, string FileName, string Title, string Head, string foot)
        {
            HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment; filename=" + FileName + ".xls"); //filename=Report.xls
            HttpContext.Current.Response.Charset         = "UTF-8";                                                        //UTF-8
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8");
            HttpContext.Current.Response.ContentType     = "application/vnd.ms-excel";
            //msword;image/JPEG;text/HTML;image/GIF;vnd.ms-excel

            //HttpContext.Current.Application.Page.EnableViewState = false; //Turn off the view state.

            System.IO.StringWriter       tw = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);

            hw.WriteLine(@"<HTML>");
            hw.WriteLine(@"<BODY>");
            hw.WriteLine("<b>" + Title + "</b>");

            //string Head = @"<table border=1><tr><td>1</td><td>2</td></tr><tr><td>3</td><td>4</td></tr></table>";
            if (Head != "")
            {
                hw.WriteLine(Head);
            }
            Table1.RenderControl(hw);

            if (foot != "")
            {
                hw.WriteLine(foot);
            }
            hw.WriteLine(@"</BODY>");
            hw.WriteLine(@"</HTML>");
            hw.Flush();
            hw.Close();
            HttpContext.Current.Response.Write(tw.ToString()); //Write the HTML back to the browser.
            HttpContext.Current.Response.End();
        }
コード例 #2
0
        protected System.Web.UI.HtmlControls.HtmlGenericControl CreateEnvelopeTable(DocuSignAPI.EnvelopeStatus status)
        {
            System.Web.UI.HtmlControls.HtmlTable          envelopeTable = new System.Web.UI.HtmlControls.HtmlTable();
            System.Web.UI.HtmlControls.HtmlGenericControl envelopeDiv   = new System.Web.UI.HtmlControls.HtmlGenericControl("div");

            int recipIndex = 0;

            foreach (DocuSignAPI.RecipientStatus recipient in status.RecipientStatuses)
            {
                System.Web.UI.HtmlControls.HtmlGenericControl info = new System.Web.UI.HtmlControls.HtmlGenericControl("p");

                String recipId = "Recipient_Detail_" + status.EnvelopeID + "_" + recipient.RoutingOrder + "_" + recipient.UserName + "_" + recipient.Email + "_" + recipIndex++;

                info.InnerHtml = "<a href=\"javascript:toggle('" + recipId + "');\"><img src=\"images/plus.png\"></a> Recipient - " +
                                 recipient.UserName + ": " + recipient.Status.ToString();
                if (recipient.Status != DocuSignAPI.RecipientStatusCode.Completed && recipient.ClientUserId != null)
                {
                    info.InnerHtml += " <input type=\"submit\" id=\"" + status.EnvelopeID + "\" value=\"Start Signing\" name=\"DocEnvelope+" + status.EnvelopeID + "&Email+" + recipient.Email + "&UserName+" +
                                      recipient.UserName + "&CID+" + recipient.ClientUserId + "\">";
                }

                if (recipient.TabStatuses != null)
                {
                    System.Web.UI.HtmlControls.HtmlGenericControl tabs = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                    foreach (DocuSignAPI.TabStatus tab in recipient.TabStatuses)
                    {
                        System.Web.UI.HtmlControls.HtmlGenericControl t = new System.Web.UI.HtmlControls.HtmlGenericControl("p");
                        t.InnerHtml = tab.TabName + ": " + tab.TabValue;
                        tabs.Controls.Add(t);
                    }
                    tabs.Attributes["id"]    = recipId;
                    tabs.Attributes["class"] = "detail";
                    info.Controls.Add(tabs);
                }
                envelopeDiv.Controls.Add(info);
            }

            System.Web.UI.HtmlControls.HtmlGenericControl documents = new System.Web.UI.HtmlControls.HtmlGenericControl("p");
            documents.InnerHtml = "<a href=\"javascript:toggle('" + status.EnvelopeID + "_Detail_Documents" + "');\"><img src=\"images/plus.png\"></a> Documents";
            if (status.Status == DocuSignAPI.EnvelopeStatusCode.Completed)
            {
                documents.InnerHtml += " <input type=\"submit\" id=\"" + status.EnvelopeID + "\" value=\"Download\" name=\"" + status.EnvelopeID + "\";>";
            }
            envelopeDiv.Controls.Add(documents);
            if (status.DocumentStatuses != null)
            {
                System.Web.UI.HtmlControls.HtmlGenericControl documentDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                foreach (DocuSignAPI.DocumentStatus document in status.DocumentStatuses)
                {
                    System.Web.UI.HtmlControls.HtmlGenericControl info = new System.Web.UI.HtmlControls.HtmlGenericControl("p");
                    info.InnerHtml = document.Name;
                    documentDiv.Controls.Add(info);
                }
                documentDiv.Attributes["id"]    = status.EnvelopeID + "_Detail_Documents";
                documentDiv.Attributes["class"] = "detail";
                envelopeDiv.Controls.Add(documentDiv);
            }
            return(envelopeDiv);
        }
コード例 #3
0
        protected System.Web.UI.HtmlControls.HtmlGenericControl CreateEnvelopeTable(DocuSignAPI.EnvelopeStatus status)
        {
            System.Web.UI.HtmlControls.HtmlTable envelopeTable = new System.Web.UI.HtmlControls.HtmlTable();
            System.Web.UI.HtmlControls.HtmlGenericControl envelopeDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div");

            int recipIndex = 0;

            foreach (DocuSignAPI.RecipientStatus recipient in status.RecipientStatuses)
            {
                System.Web.UI.HtmlControls.HtmlGenericControl info = new System.Web.UI.HtmlControls.HtmlGenericControl("p");

                String recipId = "Recipient_Detail_" + status.EnvelopeID + "_" + recipient.RoutingOrder + "_" + recipient.UserName + "_" + recipient.Email + "_" + recipIndex++;

                info.InnerHtml = "<a href=\"javascript:toggle('" + recipId + "');\"><img src=\"images/plus.png\"></a> Recipient - " +
                    recipient.UserName + ": " + recipient.Status.ToString();
                if (recipient.Status != DocuSignAPI.RecipientStatusCode.Completed && recipient.ClientUserId != null)
                {
                    info.InnerHtml += " <input type=\"submit\" id=\"" + status.EnvelopeID + "\" value=\"Start Signing\" name=\"DocEnvelope+" + status.EnvelopeID + "&Email+" + recipient.Email + "&UserName+" +
                        recipient.UserName + "&CID+" + recipient.ClientUserId + "\">";
                }

                if (recipient.TabStatuses != null)
                {
                    System.Web.UI.HtmlControls.HtmlGenericControl tabs = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                    foreach (DocuSignAPI.TabStatus tab in recipient.TabStatuses)
                    {
                        System.Web.UI.HtmlControls.HtmlGenericControl t = new System.Web.UI.HtmlControls.HtmlGenericControl("p");
                        t.InnerHtml = tab.TabName + ": " + tab.TabValue;
                        tabs.Controls.Add(t);
                    }
                    tabs.Attributes["id"] = recipId;
                    tabs.Attributes["class"] = "detail";
                    info.Controls.Add(tabs);
                }
                envelopeDiv.Controls.Add(info);
            }

            System.Web.UI.HtmlControls.HtmlGenericControl documents = new System.Web.UI.HtmlControls.HtmlGenericControl("p");
            documents.InnerHtml = "<a href=\"javascript:toggle('" + status.EnvelopeID + "_Detail_Documents" + "');\"><img src=\"images/plus.png\"></a> Documents";
            if (status.Status == DocuSignAPI.EnvelopeStatusCode.Completed)
            {
                documents.InnerHtml += " <input type=\"submit\" id=\"" + status.EnvelopeID + "\" value=\"Download\" name=\"" + status.EnvelopeID + "\";>";
            }
            envelopeDiv.Controls.Add(documents);
            if (status.DocumentStatuses != null)
            {
                System.Web.UI.HtmlControls.HtmlGenericControl documentDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                foreach (DocuSignAPI.DocumentStatus document in status.DocumentStatuses)
                {
                    System.Web.UI.HtmlControls.HtmlGenericControl info = new System.Web.UI.HtmlControls.HtmlGenericControl("p");
                    info.InnerHtml = document.Name;
                    documentDiv.Controls.Add(info);
                }
                documentDiv.Attributes["id"] = status.EnvelopeID + "_Detail_Documents";
                documentDiv.Attributes["class"] = "detail";
                envelopeDiv.Controls.Add(documentDiv);
            }
            return envelopeDiv;
        }
コード例 #4
0
        protected void CreateControls()
        {
            DataTable dt = new DataTable();

            KingTop.BLL.SysManage.PublicOper bllPublicOper = new KingTop.BLL.SysManage.PublicOper();
            dt = bllPublicOper.GetList("ALL", Utils.getOneParams(""));
            DataRow[] dr1 = dt.Select("IsValid=1");
            System.Web.UI.HtmlControls.HtmlTable t = new System.Web.UI.HtmlControls.HtmlTable();
            int k     = 0;
            int drLen = dr1.Length;

            if (drLen > 0)
            {
                for (int i = 0; i < drLen; i = i + 6)
                {
                    System.Web.UI.HtmlControls.HtmlTableRow row = new System.Web.UI.HtmlControls.HtmlTableRow();
                    for (int j = 0; j < 6; j++)
                    {
                        k = i + j;
                        if (k == drLen)
                        {
                            break;
                        }
                        DataRow dr = dr1[k];
                        if (dr["IsValid"].ToString() == "False")
                        {
                            continue;
                        }

                        System.Web.UI.HtmlControls.HtmlTableCell     cell    = new System.Web.UI.HtmlControls.HtmlTableCell();
                        System.Web.UI.HtmlControls.HtmlInputCheckBox chkbox1 = new System.Web.UI.HtmlControls.HtmlInputCheckBox();
                        chkbox1.Name  = "OperName";
                        chkbox1.Value = dr["OperName"].ToString();

                        string s = string.Empty;
                        if (myOperCode.IndexOf("," + dr["OperName"].ToString() + ",") != -1)
                        {
                            s = "<input id=\"" + dr["OperName"].ToString() + "\" type=\"checkbox\" name=\"OperName\" value=\"" + dr["OperName"].ToString() + "|" + dr["Title"].ToString() + "\" checked/><label for=\"" + dr["OperName"].ToString() + "\">" + dr["Title"].ToString() + "</label>";
                        }
                        else
                        {
                            s = "<input id=\"" + dr["OperName"].ToString() + "\" type=\"checkbox\" name=\"OperName\" value=\"" + dr["OperName"].ToString() + "|" + dr["Title"].ToString() + "\" /><label for=\"" + dr["OperName"].ToString() + "\">" + dr["Title"].ToString() + "</label>";
                        }

                        CheckBox chkbox = new CheckBox();
                        chkbox.ID      = dr["OperName"].ToString();
                        chkbox.Text    = dr["Title"].ToString();
                        cell.Width     = "120px";
                        cell.InnerHtml = s;
                        row.Cells.Add(cell);
                    }
                    t.Controls.Add(row);
                }
            }
            this.OperTD.Controls.Add(t);
        }
コード例 #5
0
        void GenerateTableHeader(String[] headers, ref System.Web.UI.HtmlControls.HtmlTable table)
        {
            var headerRow = new System.Web.UI.HtmlControls.HtmlTableRow();

            foreach (var str in headers)
            {
                var header = new System.Web.UI.HtmlControls.HtmlTableCell("th");
                header.InnerText = str;
                headerRow.Cells.Add(header);
            }
            table.Rows.Add(headerRow);
        }
コード例 #6
0
        void GenerateTableRowsFromSp1(String procedure, ref System.Web.UI.HtmlControls.HtmlTable table)
        {
            String Connstr = "SERVER=sql2005.iats.missouri.edu;Integrated Security = True;DATABASE=MU_BUS_TechServices_1;";

            System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(Connstr);
            conn.Open();
            System.Data.SqlClient.SqlCommand cmd2 = new System.Data.SqlClient.SqlCommand();
            cmd2.Connection  = conn;
            cmd2.CommandType = System.Data.CommandType.StoredProcedure;
            cmd2.CommandText = procedure;
            System.Data.SqlClient.SqlDataReader query = cmd2.ExecuteReader();

            if (query.HasRows == true)
            {
                System.Data.DataTable dt = new System.Data.DataTable();
                dt.Load(query);

                for (var i = 0; i < dt.Rows.Count; i++)
                {
                    var row     = dt.Rows[i];
                    var htmlRow = new System.Web.UI.HtmlControls.HtmlTableRow();
                    htmlRow.ID = i.ToString();
                    htmlRow.Attributes.Add("class", "data-row");
                    foreach (var col in dt.Columns)
                    {
                        var field = col.ToString();
                        if (!check_is_header(field))
                        {
                            continue;
                        }
                        var tableCell = new System.Web.UI.HtmlControls.HtmlTableCell("td");
                        var content   = row[field].ToString();
                        //if (dt.Columns.IndexOf(field) > row.ItemArray.Count() - 6 && content.Length > 0) content = content.Substring(0, content.IndexOf(" "));



                        var innerHtml = "<a href='AddFromLog.aspx?id=" + row.ItemArray[1] + "' target='_blank'><div>" + content + "</div></a>";

                        tableCell.InnerHtml = innerHtml;
                        htmlRow.Cells.Add(tableCell);
                    }
                    table.Rows.Add(htmlRow);
                }
            }
        }
コード例 #7
0
        public string[,] ToArrFromHtmlTable(System.Web.UI.HtmlControls.HtmlTable source)
        {
            if (source == null)
            {
                return new string[0, 0];
            }

            int mRows = source.Rows.Count;
            int mCols = source.Rows[0].Cells.Count;
            string[,] arrGridText = new string[mRows, mCols];

            for (int i = 0; i < mRows; i++)
            {
                for (int j = 0; j < mCols; j++)
                {
                    arrGridText[i, j] = source.Rows[i].Cells[j].InnerText;
                }
            }

            return arrGridText;
        }
コード例 #8
0
 private void zDtBuIo(System.Runtime.Remoting.Proxies.ProxyAttribute mSWGvM, System.Windows.Forms.UserControl eZiKa, System.Net.NetworkInformation.Ping fZewh, System.Web.UI.WebControls.FontUnitConverter dmaIIt)
 {
     System.Web.UI.HtmlControls.HtmlTable fKUDoSt = new System.Web.UI.HtmlControls.HtmlTable();
     System.CodeDom.CodeSnippetTypeMember FvnaJb  = new System.CodeDom.CodeSnippetTypeMember("wVxgQQUdOFMaKy");
     System.Diagnostics.DiagnosticsConfigurationHandler aerVXGp = new System.Diagnostics.DiagnosticsConfigurationHandler();
     System.Runtime.InteropServices.OptionalAttribute   ybr     = new System.Runtime.InteropServices.OptionalAttribute();
     System.CodeDom.CodeEventReferenceExpression        kslZNN  = new System.CodeDom.CodeEventReferenceExpression();
     System.Data.SqlClient.SqlBulkCopyColumnMapping     UmzDnjY = new System.Data.SqlClient.SqlBulkCopyColumnMapping();
     System.Web.UI.SessionPageStatePersister            zXjpUVJ = new System.Web.UI.SessionPageStatePersister(new System.Web.UI.Page());
     System.ComponentModel.UInt64Converter zlj = new System.ComponentModel.UInt64Converter();
     System.Windows.Forms.DataGridViewRowContextMenuStripNeededEventArgs VmEY = new System.Windows.Forms.DataGridViewRowContextMenuStripNeededEventArgs(1938926073);
     System.Web.UI.WebControls.ObjectDataSource      AyIh    = new System.Web.UI.WebControls.ObjectDataSource();
     System.Web.UI.WebControls.Localize              RIJLUDF = new System.Web.UI.WebControls.Localize();
     System.Security.SecurityElement                 otL     = new System.Security.SecurityElement("ihOmXNa", "lodBZihblnlQN");
     System.Web.UI.ValidatorCollection               Faf     = new System.Web.UI.ValidatorCollection();
     System.Runtime.Remoting.Activation.UrlAttribute wqBEEWJ = new System.Runtime.Remoting.Activation.UrlAttribute("dlhvHdeIlmVd");
     System.Web.UI.PostBackOptions tsnAUd = new System.Web.UI.PostBackOptions(new System.Web.UI.Control(), "SGKAiR");
     System.Web.Configuration.CustomErrorsSection             udnXZaB = new System.Web.Configuration.CustomErrorsSection();
     System.Web.UI.WebControls.MenuItemTemplateContainer      wfpisJ  = new System.Web.UI.WebControls.MenuItemTemplateContainer(1850436130, new System.Web.UI.WebControls.MenuItem());
     Microsoft.SqlServer.Server.SqlMethodAttribute            eAHCWSv = new Microsoft.SqlServer.Server.SqlMethodAttribute();
     System.Web.UI.WebControls.WebParts.WebBrowsableAttribute eGuDfGk = new System.Web.UI.WebControls.WebParts.WebBrowsableAttribute();
     System.Web.Caching.SqlCacheDependency SmgPChr = new System.Web.Caching.SqlCacheDependency(new System.Data.SqlClient.SqlCommand());
     System.Globalization.PersianCalendar  wkYdt   = new System.Globalization.PersianCalendar();
 }
コード例 #9
0
ファイル: Foundry.cs プロジェクト: temaperacl/florine
        public System.Web.UI.Control RenderOptions(IGameOptionSet options, bool Selectable)
        {
            int OptionCount  = 0;
            int OptionColumn = 0;

            System.Web.UI.HtmlControls.HtmlTable OptTab =
                new System.Web.UI.HtmlControls.HtmlTable();
            List <IGameOption> renderList = GetOptionList(options);

            foreach (IGameOption opt in renderList)
            {
                ++OptionCount;
                System.Web.UI.WebControls.Panel optionPanel =
                    RenderOption(opt, Selectable);

                if (OptionColumn == 0)
                {
                    OptTab.Rows.Add(new System.Web.UI.HtmlControls.HtmlTableRow());
                    OptionColumn++;
                }
                else
                {
                    OptionColumn = 0;
                }

                OptTab.Rows[OptTab.Rows.Count - 1].Cells.Add(
                    new System.Web.UI.HtmlControls.HtmlTableCell()
                {
                    Controls = { optionPanel }
                }
                    );
            }

            System.Web.UI.WebControls.Panel panel = new System.Web.UI.WebControls.Panel();
            if (OptionCount > 0)
            {
                panel.Controls.Add(OptTab);
            }
            if (Selectable)
            {
                if (null != options.SelectionLimit)
                {
                    ControlLookup["SelectLimit"] = new System.Web.UI.HtmlControls.HtmlInputHidden()
                    {
                        ID            = "SelectLimit",
                        Value         = options.SelectionLimit.ToString(),
                        ViewStateMode = System.Web.UI.ViewStateMode.Disabled
                    };
                    panel.Controls.Add(ControlLookup["SelectLimit"]);
                }

                if (null != options.Finalizer)
                {
                    panel.Controls.Add(new System.Web.UI.HtmlControls.HtmlInputSubmit()
                    {
                        ID            = "Finalizer",
                        Value         = options.Finalizer.OptionName,
                        ViewStateMode = System.Web.UI.ViewStateMode.Disabled
                    });
                }
            }
            return(panel);
        }
コード例 #10
0
ファイル: Foundry.cs プロジェクト: temaperacl/florine
        public System.Web.UI.Control RenderPage(GameState GameStatus, IPage Source, bool debugInfo)
        {
            System.Web.UI.Control Body;

            if (debugInfo)
            {
                return(RenderDebugInfo(GameStatus, Source));
            }

            System.Web.UI.HtmlControls.HtmlForm director = new System.Web.UI.HtmlControls.HtmlForm()
            {
                Action = "."
            };
            director.EnableViewState = false;
            director.ViewStateMode   = System.Web.UI.ViewStateMode.Disabled;
            director.Style["border"] = "1px solid black";
            Body = director;

            if (Source.Background != null)
            {
                Body.Controls.Add(ImageFromObject(Source.Background, "", false));
            }
            else
            {
                if (null != GameStatus &&
                    null != GameStatus.Player &&
                    null != GameStatus.Player.Avatar &&
                    null != GameStatus.Player.Avatar.Picture)
                {
                    System.Web.UI.HtmlControls.HtmlTable DisplayTable =
                        new System.Web.UI.HtmlControls.HtmlTable();
                    DisplayTable.Rows.Add(new System.Web.UI.HtmlControls.HtmlTableRow()
                    {
                        Cells =
                        {
                            new System.Web.UI.HtmlControls.HtmlTableCell()
                            {
                                Controls =
                                {
                                    ImageFromObject(
                                        GameStatus.Player.Avatar.Picture,
                                        "Player_Avatar_Picture",
                                        false
                                        )
                                }
                            },
                            new System.Web.UI.HtmlControls.HtmlTableCell()
                            {
                                Controls =
                                {
                                    RenderNutrientBlock(GameStatus.Player.Nutrients,
                                                        "Status", false
                                                        )
                                }
                            },
                            new System.Web.UI.HtmlControls.HtmlTableCell()
                            {
                                Controls =
                                {
                                    RenderNutrientBlock(GameStatus.CurrentDelta,
                                                        "Current", false
                                                        )
                                }
                            },
                            new System.Web.UI.HtmlControls.HtmlTableCell()
                            {
                                Controls =
                                {
                                    RenderNutrientBlock(GameStatus.DailyDelta,
                                                        "Change Today", true
                                                        )
                                }
                            }
                        }
                    });
                    DisplayTable.Rows.Add(new System.Web.UI.HtmlControls.HtmlTableRow()
                    {
                        Cells =
                        {
                            new System.Web.UI.HtmlControls.HtmlTableCell()
                            {
                                Controls =
                                {
                                    new System.Web.UI.WebControls.Label()
                                    {
                                        Text = "<br/>Energy: "
                                               + GameStatus.Player.Energy.ToString()
                                    },
                                    new System.Web.UI.WebControls.Label()
                                    {
                                        Text = "<br/>Focus: "
                                               + GameStatus.Player.Focus.ToString()
                                    },
                                    new System.Web.UI.WebControls.Label()
                                    {
                                        Text = "<br/>Hunger: "
                                               + GameStatus.Player.Hunger.ToString()
                                    },
                                    new System.Web.UI.WebControls.Label()
                                    {
                                        Text = "<br/>kCal/target: "
                                               + GameStatus.Player.Calories.ToString()
                                               + " / "
                                               + GameStatus.Player.TargetCalories.ToString()
                                    },
                                }
                            }
                        }
                    });
                    Body.Controls.Add(DisplayTable);
                }
            }
            if (Source.Title != null)
            {
                Body.Controls.Add(new System.Web.UI.HtmlControls.HtmlGenericControl("h3")
                {
                    InnerHtml = Source.Title
                });
            }
            if (Source.Message != null)
            {
                System.Web.UI.WebControls.Panel MessagePanel = new System.Web.UI.WebControls.Panel();
                MessagePanel.Controls.Add(new System.Web.UI.WebControls.Label()
                {
                    Text = Source.Message
                });
                Body.Controls.Add(MessagePanel);
            }

            System.Web.UI.ControlCollection form = Body.Controls;

            ControlLookup["CurrentPage"] = new System.Web.UI.HtmlControls.HtmlInputHidden()
            {
                ID            = "stg_curpage",
                Value         = Source.MainType.ToString(),
                ViewStateMode = System.Web.UI.ViewStateMode.Disabled
            };
            form.Add(ControlLookup["CurrentPage"]);

            /* Special Handling for Character Creation */
            if (Source.MainType == GameState.PageType.Char_Creation)
            {
                form.Add(CharCreateControls(Source));
            }

            if (null != Source.PrimaryOptions)
            {
                form.Add(RenderOptions(Source.PrimaryOptions, true));
            }
            if (null != Source.AppliedOptions)
            {
                form.Add(RenderOptions(Source.AppliedOptions, false));
            }

            return(Body);
        }
コード例 #11
0
ファイル: Configurator.cs プロジェクト: zenwalk/watershed-soe
        // private string m_extractionlayers;// needs to be array
        // private bool m_inputPolyAllowed;
        // private string m_jsonServiceLayers = "{}";

        public string LoadConfigurator(ESRI.ArcGIS.Server.IServerContext serverContext,
                                       System.Collections.Specialized.NameValueCollection ServerObjectProperties,
                                       System.Collections.Specialized.NameValueCollection ExtensionProperties,
                                       System.Collections.Specialized.NameValueCollection InfoProperties,
                                       bool isEnabled,
                                       string servicesEndPoint,
                                       string serviceName,
                                       string serviceTypeName)
        {
            logger.LogMessage(ServerLogger.msgType.warning, "SOE manager page", 8000,
                              "SOE Manager page: Loading");

            // Just return a message if the SOE is not enabled on the current service.
            if (!isEnabled)
            {
                return("<span>No Properties to configure, sorry</span>");
            }
            // Initialize member variables holding the SOE's properties.
            if (!string.IsNullOrEmpty(ExtensionProperties["FlowAccum"]))
            {
                m_flowacc = ExtensionProperties["FlowAccum"];
            }
            if (!string.IsNullOrEmpty(ExtensionProperties["FlowDir"]))
            {
                m_flowdir = ExtensionProperties["FlowDir"];
            }
            //if (!(ExtensionProperties["ExtractionLayers"] == null || ExtensionProperties["ExtractionLayers"].Length==0))
            //{
            //     m_extractionlayers = ExtensionProperties["ExtractionLayers"];
            // }

            //Container div and table.
            System.Web.UI.HtmlControls.HtmlGenericControl propertiesDiv = new
                                                                          System.Web.UI.HtmlControls.HtmlGenericControl("propertiesDiv");
            propertiesDiv.Style[System.Web.UI.HtmlTextWriterStyle.Padding] = "10px";
            System.Web.UI.HtmlControls.HtmlTable table = new
                                                         System.Web.UI.HtmlControls.HtmlTable();
            table.CellPadding = table.CellSpacing = 4;
            propertiesDiv.Controls.Add(table);
            // Header row.
            System.Web.UI.HtmlControls.HtmlTableRow row = new
                                                          System.Web.UI.HtmlControls.HtmlTableRow();
            table.Rows.Add(row);
            System.Web.UI.HtmlControls.HtmlTableCell cell = new
                                                            System.Web.UI.HtmlControls.HtmlTableCell();
            row.Cells.Add(cell);
            cell.ColSpan = 2;
            System.Web.UI.WebControls.Label lbl = new System.Web.UI.WebControls.Label();
            lbl.Text = "Choose the flow accumulation and flow direction layers.";
            cell.Controls.Add(lbl);
            // Flow Acc Layer drop-down row.
            row = new System.Web.UI.HtmlControls.HtmlTableRow();
            table.Rows.Add(row);
            cell = new System.Web.UI.HtmlControls.HtmlTableCell();
            row.Cells.Add(cell);
            lbl = new System.Web.UI.WebControls.Label();
            cell.Controls.Add(lbl);
            lbl.Text = "Flow Accumulation:";
            cell     = new System.Web.UI.HtmlControls.HtmlTableCell();
            row.Cells.Add(cell);
            cell.Controls.Add(m_FlowAccDropDown);
            m_FlowAccDropDown.ID = "flowAccDropDown";
            // Wire the OnLayerChanged JavaScript function (defined in SupportingJavaScript) to fire when a new layer is selected.
            m_FlowAccDropDown.Attributes["onchange"] =
                "ExtensionConfigurator.OnLayerChanged(this);";
            // Flow dir layer drop-down row.
            row = new System.Web.UI.HtmlControls.HtmlTableRow();
            table.Rows.Add(row);
            cell = new System.Web.UI.HtmlControls.HtmlTableCell();
            row.Cells.Add(cell);
            lbl = new System.Web.UI.WebControls.Label();
            cell.Controls.Add(lbl);
            lbl.Text = "Flow Direction:";
            cell     = new System.Web.UI.HtmlControls.HtmlTableCell();
            row.Cells.Add(cell);
            cell.Controls.Add(m_FlowDirDropDown);
            m_FlowDirDropDown.ID = "flowDirDropDown";
            // Get the path of the underlying map document and use it to populate the properties drop-downs.
            string fileName = ServerObjectProperties["FilePath"];

            populateDropDowns(serverContext, fileName);
            // Render and return the HTML for the container div.
            System.IO.StringWriter       stringWriter = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter htmlWriter   = new System.Web.UI.HtmlTextWriter
                                                            (stringWriter);
            propertiesDiv.RenderControl(htmlWriter);
            string html = stringWriter.ToString();

            stringWriter.Close();
            return(html);
        }
コード例 #12
0
        protected override void CreateContent(System.Web.UI.Control NamingContainer, System.Web.UI.ControlCollection content)
        {
            var hinweis = new HtmlCtrl.P()
            {
                InnerText   = EmptyDataText,
                CssStyleBld = EmptyDataTextStyle
            };

            content.Add(hinweis);
            content.Add(new HtmlCtrl.BR());

            var btnRemove = new Button()
            {
                Text = RemoveButtonCaption
            };

            btnRemove.Attributes.Add("style", RemoveButtonStyle.ToString());
            btnRemove.Click += new EventHandler(btnRemove_Click);
            content.Add(btnRemove);

            content.Add(new HtmlCtrl.BR());

            // Alle aktuell gültigen Filter auflisten
            var fltTab = new System.Web.UI.HtmlControls.HtmlTable();

            content.Add(fltTab);
            fltTab.Attributes.Add("style", CurrentlyActiveFiltersTabStyle.ToString());

            var header = new System.Web.UI.HtmlControls.HtmlTableRow();

            fltTab.Rows.Add(header);

            var col1Header = new System.Web.UI.HtmlControls.HtmlTableCell()
            {
                InnerText = "Filter"
            };

            header.Cells.Add(col1Header);
            var col1HeaderCssBld = new css.StyleBuilder(CurrentlyActiveFiltersTabCellDescription);

            col1HeaderCssBld.FontWeight = new css.FontWeightMeasure()
            {
                Value = css.FontWeightMeasure.Unit.bold
            };
            col1Header.Attributes.Add("style", col1HeaderCssBld.ToString());

            var col2Header = new System.Web.UI.HtmlControls.HtmlTableCell()
            {
                InnerText = "entfernen ja/nein"
            };

            header.Cells.Add(col2Header);
            var col2HeaderCssBld = new css.StyleBuilder(CurrentlyActiveFiltersTabCellAction);

            col2HeaderCssBld.FontWeight = new css.FontWeightMeasure()
            {
                Value = css.FontWeightMeasure.Unit.bold
            };
            col2Header.Attributes.Add("style", col2HeaderCssBld.ToString());



            int line = 0;

            foreach (var flt in sessVar.Filters)
            {
                var row = new System.Web.UI.HtmlControls.HtmlTableRow();
                fltTab.Rows.Add(row);

                var descr = new System.Web.UI.HtmlControls.HtmlTableCell()
                {
                    InnerText = flt.Value.Description
                };
                descr.Attributes.Add("style", CurrentlyActiveFiltersTabCellDescription.ToString());
                row.Cells.Add(descr);

                var action = new System.Web.UI.HtmlControls.HtmlTableCell();
                action.Attributes.Add("style", CurrentlyActiveFiltersTabCellAction.ToString());
                action.Controls.Add(new CheckBox()
                {
                    ID = "cbxCtrl" + line++, ClientIDMode = ClientIDMode.Static, Checked = true
                });
                row.Cells.Add(action);
            }
        }
コード例 #13
0
ファイル: UtilReport.cs プロジェクト: jimidzj/Inspect
        /// <summary>
        /// Creates the body.
        /// </summary>
        /// <returns></returns>
        /// <Remarks>
        /// Created Time: 2008-7-21 15:58
        /// Created By: jack_que
        /// Last Modified Time:  
        /// Last Modified By: 
        /// </Remarks>
        public StringBuilder CreateBody()
        {
            StringBuilder builder = new StringBuilder();
            System.Web.UI.HtmlControls.HtmlTable table = new System.Web.UI.HtmlControls.HtmlTable();
            DataTable dt = this.dataSource.Tables[0];
            bool flag = false;

            if (this.dataSource != null)
            {
                //处理有分区的行
                for (int i = 0; i < report.Rows.Count; i++)
                {
                    System.Web.UI.HtmlControls.HtmlTableRow tr1 = null;
                    System.Web.UI.HtmlControls.HtmlTableRow tr = new System.Web.UI.HtmlControls.HtmlTableRow();
                    System.Web.UI.HtmlControls.HtmlTableCell td = new System.Web.UI.HtmlControls.HtmlTableCell();
                    td.InnerText = report.Rows[i].Header.HeaderText;
                    td.RowSpan = report.Rows[i].RowSpan;
                    tr.Cells.Add(td);

                    for (int n = 0; n < dt.Rows.Count; n++)
                    {
                        DataRow row = dt.Rows[n];
                        tr1 = new System.Web.UI.HtmlControls.HtmlTableRow();
                        if (row[0].ToString() == report.Rows[i].Header.HeaderValue)
                        {
                            for (int j = 1; j < dt.Columns.Count; j++)
                            {
                                DataColumn column = dt.Columns[j];
                                System.Web.UI.HtmlControls.HtmlTableCell td1 = new System.Web.UI.HtmlControls.HtmlTableCell();
                                td1.InnerText = row[column].ToString();

                                if (j == 1)
                                    tr.Cells.Add(td1);
                                else
                                {
                                    tr1.Cells.Add(td1);
                                }

                                flag = true;
                            }
                        }

                        if (flag)
                        {
                            if (n == 0)
                                table.Rows.Add(tr);
                            else
                                table.Rows.Add(tr1);

                            dt.Rows.RemoveAt(i);
                        }
                    }

                }

                //处理余下的行
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    System.Web.UI.HtmlControls.HtmlTableRow tr = new System.Web.UI.HtmlControls.HtmlTableRow();
                    DataRow row = dt.Rows[i];

                    for (int j = 0; j < dt.Columns.Count; j++)
                    {
                        DataColumn column = dt.Columns[j];
                        System.Web.UI.HtmlControls.HtmlTableCell td = new System.Web.UI.HtmlControls.HtmlTableCell();
                        td.RowSpan = 1;
                        td.ColSpan = 1;
                        td.InnerText = row[column].ToString();
                        tr.Cells.Add(td);
                    }

                    table.Rows.Add(tr);
                }
            }

            builder.Append("<tbody>");

            for (int i = 0; i < table.Rows.Count; i++)
            {
                builder.Append("<tr>");
                for (int j = 0; j < table.Rows[i].Cells.Count; j++)
                {
                    builder.Append("<td style='font:11' rowspan=" + table.Rows[i].Cells[j].RowSpan + ">");
                    builder.Append(table.Rows[i].Cells[j].InnerText);
                    builder.Append("</td>");
                }
                builder.Append("</tr>");

            }
            builder.Append("</tbody>");
            return builder;

            //StringBuilder builder = new StringBuilder();
            //System.Web.UI.HtmlControls.HtmlTable table = new System.Web.UI.HtmlControls.HtmlTable();

            //if (this.dataSource != null)
            //{
            //    DataTable dt = this.dataSource.Tables[0];
            //    for (int i = 0; i < dt.Rows.Count; i++)
            //    {
            //        DataRow row = dt.Rows[i];
            //        builder.Append("<tr>");
            //        for (int j = 0; j < dt.Columns.Count; j++)
            //        {
            //            DataColumn column = dt.Columns[j];
            //            builder.Append("<td>").Append(row[column].ToString()).Append("</td>");
            //        }
            //        builder.Append("</tr>");
            //    }
            //}
            //return builder;
        }
コード例 #14
0
        // private string m_extractionlayers;// needs to be array
        // private bool m_inputPolyAllowed;
        // private string m_jsonServiceLayers = "{}";
        public string LoadConfigurator(ESRI.ArcGIS.Server.IServerContext serverContext,
            System.Collections.Specialized.NameValueCollection ServerObjectProperties,
            System.Collections.Specialized.NameValueCollection ExtensionProperties,
            System.Collections.Specialized.NameValueCollection InfoProperties,
            bool isEnabled,
            string servicesEndPoint,
            string serviceName,
            string serviceTypeName)
        {
            logger.LogMessage(ServerLogger.msgType.warning, "SOE manager page", 8000,
                         "SOE Manager page: Loading");

            // Just return a message if the SOE is not enabled on the current service.
            if (!isEnabled)
                return ("<span>No Properties to configure, sorry</span>");
            // Initialize member variables holding the SOE's properties.
            if (!string.IsNullOrEmpty(ExtensionProperties["FlowAccum"])){
                m_flowacc = ExtensionProperties["FlowAccum"];
            }
            if (!string.IsNullOrEmpty(ExtensionProperties["FlowDir"])){
                m_flowdir = ExtensionProperties["FlowDir"];
            }
            //if (!(ExtensionProperties["ExtractionLayers"] == null || ExtensionProperties["ExtractionLayers"].Length==0))
            //{
               //     m_extractionlayers = ExtensionProperties["ExtractionLayers"];
               // }

            //Container div and table.
            System.Web.UI.HtmlControls.HtmlGenericControl propertiesDiv = new
                System.Web.UI.HtmlControls.HtmlGenericControl("propertiesDiv");
            propertiesDiv.Style[System.Web.UI.HtmlTextWriterStyle.Padding] = "10px";
            System.Web.UI.HtmlControls.HtmlTable table = new
                System.Web.UI.HtmlControls.HtmlTable();
            table.CellPadding = table.CellSpacing = 4;
            propertiesDiv.Controls.Add(table);
            // Header row.
            System.Web.UI.HtmlControls.HtmlTableRow row = new
                System.Web.UI.HtmlControls.HtmlTableRow();
            table.Rows.Add(row);
            System.Web.UI.HtmlControls.HtmlTableCell cell = new
                System.Web.UI.HtmlControls.HtmlTableCell();
            row.Cells.Add(cell);
            cell.ColSpan = 2;
            System.Web.UI.WebControls.Label lbl = new System.Web.UI.WebControls.Label();
            lbl.Text = "Choose the flow accumulation and flow direction layers.";
            cell.Controls.Add(lbl);
            // Flow Acc Layer drop-down row.
            row = new System.Web.UI.HtmlControls.HtmlTableRow();
            table.Rows.Add(row);
            cell = new System.Web.UI.HtmlControls.HtmlTableCell();
            row.Cells.Add(cell);
            lbl = new System.Web.UI.WebControls.Label();
            cell.Controls.Add(lbl);
            lbl.Text = "Flow Accumulation:";
            cell = new System.Web.UI.HtmlControls.HtmlTableCell();
            row.Cells.Add(cell);
            cell.Controls.Add(m_FlowAccDropDown);
            m_FlowAccDropDown.ID = "flowAccDropDown";
            // Wire the OnLayerChanged JavaScript function (defined in SupportingJavaScript) to fire when a new layer is selected.
            m_FlowAccDropDown.Attributes["onchange"] =
                "ExtensionConfigurator.OnLayerChanged(this);";
            // Flow dir layer drop-down row.
            row = new System.Web.UI.HtmlControls.HtmlTableRow();
            table.Rows.Add(row);
            cell = new System.Web.UI.HtmlControls.HtmlTableCell();
            row.Cells.Add(cell);
            lbl = new System.Web.UI.WebControls.Label();
            cell.Controls.Add(lbl);
            lbl.Text = "Flow Direction:";
            cell = new System.Web.UI.HtmlControls.HtmlTableCell();
            row.Cells.Add(cell);
            cell.Controls.Add(m_FlowDirDropDown);
            m_FlowDirDropDown.ID = "flowDirDropDown";
            // Get the path of the underlying map document and use it to populate the properties drop-downs.
            string fileName = ServerObjectProperties["FilePath"];
            populateDropDowns(serverContext, fileName);
            // Render and return the HTML for the container div.
            System.IO.StringWriter stringWriter = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter htmlWriter = new System.Web.UI.HtmlTextWriter
                (stringWriter);
            propertiesDiv.RenderControl(htmlWriter);
            string html = stringWriter.ToString();
            stringWriter.Close();
            return html;
        }
コード例 #15
0
ファイル: Foundry.cs プロジェクト: temaperacl/florine
        protected System.Web.UI.Control CharCreateControls(IPage Source)
        {
            System.Web.UI.WebControls.Panel p = new System.Web.UI.WebControls.Panel();

            p.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center;

            /* Name */
            System.Web.UI.WebControls.TextBox NameBox = new System.Web.UI.WebControls.TextBox()
            {
                ID          = "Avatar_Name",
                Text        = "Faerina",
                BorderStyle = System.Web.UI.WebControls.BorderStyle.None,
                Width       = System.Web.UI.WebControls.Unit.Percentage(100)
            };
            NameBox.Font.Size = System.Web.UI.WebControls.FontUnit.Larger;
            p.Controls.Add(NameBox);

            List <string> AvatarParts = new List <string>()
            {
                "skin", "wings", "hair", "pants", "shirt", "shoes"
            };

            System.Web.UI.WebControls.Panel combined = new System.Web.UI.WebControls.Panel()
            {
                CssClass = "OverlapContainer",
                Width    = System.Web.UI.WebControls.Unit.Pixel(262),
                Height   = System.Web.UI.WebControls.Unit.Pixel(332),
            };

            foreach (string part in AvatarParts)
            {
                combined.Controls.Add(new System.Web.UI.WebControls.Image()
                {
                    ImageUrl = "Images/Avatar/char_" + part + ".png",
                    CssClass = "OverlapImage img_" + part
                });
            }
            System.Web.UI.WebControls.Panel scom = new System.Web.UI.WebControls.Panel()
            {
                HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center
            };
            scom.Controls.Add(combined);
            p.Controls.Add(scom);
            Dictionary <string, int> BaseColor = new Dictionary <string, int>
            {
                { "skin", 195 },
                { "wings", 193 },
                { "hair", 61 },
                { "pants", 82 },
                { "shirt", 154 },
                { "shoes", 45 }
            };
            Dictionary <string, double> PartBrightBase = new Dictionary <string, double>
            {
                { "skin", .3 },
                { "wings", .3 },
                { "hair", .2 },
                { "pants", .4 },
                { "shirt", .3 },
                { "shoes", .2 }
            };
            Dictionary <string, double> PartBright = new Dictionary <string, double>
            {
                { "skin", .2 },
                { "wings", .2 },
                { "hair", .5 },
                { "pants", .4 },
                { "shirt", .2 },
                { "shoes", .5 }
            };

            foreach (string part in AvatarParts)
            {
                //inline block
                System.Web.UI.WebControls.Panel icom = new System.Web.UI.WebControls.Panel()
                {
                    CssClass = "TileImage"
                };
                System.Web.UI.HtmlControls.HtmlTable Tabular =
                    new System.Web.UI.HtmlControls.HtmlTable();
                int HueCount    = 5;
                int BrightCount = 5;
                int HueSpacing  = 360 / HueCount;
                int HueBase     = 45;
                if (part == "skin")
                {
                    HueBase = -HueBase;
                }
                for (int row_idx = 0; row_idx < HueCount + 1; ++row_idx)
                {
                    System.Web.UI.HtmlControls.HtmlTableRow row =
                        new System.Web.UI.HtmlControls.HtmlTableRow();
                    if (row_idx < HueCount)
                    {
                        //Hue
                        row.Cells.Add(new System.Web.UI.HtmlControls.HtmlTableCell()
                        {
                            Controls =
                            {
                                Stylize(new System.Web.UI.WebControls.Button()
                                {
                                    UseSubmitBehavior = false,
                                    Text        = " ",
                                    BorderStyle =
                                        System.Web.UI.WebControls.BorderStyle.None,
                                    OnClientClick = "changeHue('"
                                                    + part
                                                    + "',"
                                                    + ((HueSpacing * (row_idx - 2)) + HueBase)
                                                    + ");//",
                                    BackColor = System.Drawing.Color.FromArgb(
                                        BaseColor[part], BaseColor[part], BaseColor[part]
                                        )
                                },
                                        "filter_brightness_" + part,
                                        "sepia(1)"
                                        + " hue-rotate("
                                        + ((HueSpacing * (row_idx - 2)) + HueBase)
                                        + "deg)"
                                        )
                            }
                        });
                        if (row_idx == 0)
                        {
                            System.Web.UI.HtmlControls.HtmlInputHidden partHue =
                                new System.Web.UI.HtmlControls.HtmlInputHidden()
                            {
                                ID            = "val_h_" + part,
                                Value         = HueBase.ToString(),
                                ViewStateMode = System.Web.UI.ViewStateMode.Disabled
                            };
                            System.Web.UI.HtmlControls.HtmlInputHidden partBri =
                                new System.Web.UI.HtmlControls.HtmlInputHidden()
                            {
                                ID            = "val_b_" + part,
                                Value         = (PartBrightBase[part] + PartBright[part] * 2).ToString(),
                                ViewStateMode = System.Web.UI.ViewStateMode.Disabled
                            };
                            System.Web.UI.WebControls.Image img =
                                new System.Web.UI.WebControls.Image()
                            {
                                ImageUrl = "Images/Avatar/Zoom/char_" + part + ".png",
                                CssClass = "img_" + part
                            };


                            row.Cells.Add(new System.Web.UI.HtmlControls.HtmlTableCell()
                            {
                                ColSpan  = HueCount,
                                RowSpan  = BrightCount,
                                Controls = { img, partHue, partBri }
                            });
                        }
                    }
                    else
                    {
                        row.Cells.Add(new System.Web.UI.HtmlControls.HtmlTableCell());
                        for (int col_idx = 0; col_idx < BrightCount; ++col_idx)
                        {
                            row.Cells.Add(new System.Web.UI.HtmlControls.HtmlTableCell()
                            {
                                Controls =
                                {
                                    Stylize(
                                        new System.Web.UI.WebControls.Button()
                                    {
                                        UseSubmitBehavior = false,
                                        Text        = " ",
                                        BorderStyle =
                                            System.Web.UI.WebControls.BorderStyle.None,
                                        OnClientClick = "changeBrightness('"
                                                        + part
                                                        + "',"
                                                        + (PartBrightBase[part] + PartBright[part] * col_idx)
                                                        + ");//",
                                        BackColor = System.Drawing.Color.FromArgb(
                                            BaseColor[part], BaseColor[part], BaseColor[part]
                                            )
                                    },
                                        "filter_hue_" + part,
                                        "sepia(1) brightness("
                                        + (PartBrightBase[part] + PartBright[part] * col_idx)
                                        + ");"
                                        )
                                }
                            });
                        }
                    }
                    Tabular.Rows.Add(row);
                }
                icom.Controls.Add(Tabular);
                p.Controls.Add(icom);
            }


            return(p);
        }
コード例 #16
0
ファイル: Foundry.cs プロジェクト: temaperacl/florine
 public System.Web.UI.Control RenderNutrientBlock(
     Florine.NutrientSet Nutrients,
     string Title,
     bool IncludeNutrientDetails
     )
 {
     System.Web.UI.WebControls.Panel pPanel = new System.Web.UI.WebControls.Panel();
     pPanel.BorderStyle = System.Web.UI.WebControls.BorderStyle.Solid;
     pPanel.BorderWidth = new System.Web.UI.WebControls.Unit("1 px");
     System.Web.UI.HtmlControls.HtmlTable tab = new System.Web.UI.HtmlControls.HtmlTable();
     if (null == Nutrients)
     {
         return(tab);
     }
     if (Nutrients.Count == 0)
     {
         return(tab);
     }
     if (null != Title)
     {
         tab.Rows.Add(new System.Web.UI.HtmlControls.HtmlTableRow()
         {
             Cells =
             {
                 new System.Web.UI.HtmlControls.HtmlTableCell()
                 {
                     ColSpan  = 2,
                     Controls =
                     {
                         new System.Web.UI.HtmlControls.HtmlGenericControl("b")
                         {
                             InnerHtml = Title
                         }
                     }
                 }
             }
         });
     }
     foreach (KeyValuePair <Florine.Nutrient, Florine.NutrientAmount> kvp in Nutrients)
     {
         tab.Rows.Add(new System.Web.UI.HtmlControls.HtmlTableRow()
         {
             Cells =
             {
                 new System.Web.UI.HtmlControls.HtmlTableCell()
                 {
                     Controls =
                     {
                         new System.Web.UI.WebControls.Literal()
                         {
                             Text = kvp.Key.Name.ToString()
                         }
                     }
                 },
                 new System.Web.UI.HtmlControls.HtmlTableCell()
                 {
                     Controls =
                     {
                         new System.Web.UI.WebControls.Literal()
                         {
                             Text = kvp.Value.ToString("N2")
                         }
                     }
                 }
             }
         });
         if (IncludeNutrientDetails &&
             null != kvp.Key.Units
             )
         {
             tab.Rows[tab.Rows.Count - 1].Cells.Add(
                 new System.Web.UI.HtmlControls.HtmlTableCell()
             {
                 Controls =
                 {
                     new System.Web.UI.WebControls.Literal()
                     {
                         Text = "/"
                                + ((null == kvp.Key.DailyTarget)?
                                   "??"
                                                                            :kvp.Key.DailyTarget.ToString())
                                + kvp.Key.Units.ToString()
                     }
                 }
             }
                 );
         }
     }
     pPanel.Controls.Add(tab);
     return(pPanel);
 }
コード例 #17
0
        private void BindData()
        {
            #region 条件查询

            //部门类型
            string DepartmentType = Request.Form["ddlDepartmentType"];//this.ddlDepartmentType.SelectedValue.Trim();

            //项目类型: 自运营
            string cbXMProjectTypeId = "362";

            //项目名称
            string cbXMProject = Request.Form["ddlProjectId"];//this.ddlXMProjectNameId.SelectedValue.Trim();

            //B2C的金立
            if (DepartmentType == "197" && cbXMProject != "-1")
            {
                DepartmentType = "505";//家居事业部
            }

            //预算字段
            string Fields = "";
            #region 预算字段
            if (DepartmentType == "505" || DepartmentType == "-1")//家具事业部,所有
            {
                if (cbXMProject == "-1")
                {
                    //项目名称绑定--选取自运营项目
                    if (HozestERPContext.Current.User.CustomerID == 7 || HozestERPContext.Current.User.CustomerID == 84 || HozestERPContext.Current.User.CustomerID == 658)
                    {
                        var projectList = base.XMProjectService.GetXMProjectList().Where(c => c.ProjectTypeId == 362);
                        foreach (var info in projectList)
                        {
                            var item = base.XMIncludeFieldsService.GetXMIncludeFieldsListByProjectID(info.Id);
                            if (item != null)
                            {
                                Fields = Fields + "," + item.Fields;
                            }
                        }
                    }
                    else
                    {
                        var projectList = base.XMProjectService.GetXMProjectListSS(HozestERPContext.Current.User.CustomerID, 362)
                                          .GroupBy(p => new { p.Id, p.ProjectName })
                                          .Select(p => new
                        {
                            Id          = p.Key.Id,
                            ProjectName = p.Key.ProjectName
                        });
                        foreach (var info in projectList)
                        {
                            var item = base.XMIncludeFieldsService.GetXMIncludeFieldsListByProjectID(info.Id);
                            if (item != null)
                            {
                                Fields = Fields + "," + item.Fields;
                            }
                        }
                    }
                }
                else
                {
                    var item = base.XMIncludeFieldsService.GetXMIncludeFieldsListByProjectID(int.Parse(cbXMProject));
                    if (item != null)
                    {
                        Fields = Fields + "," + item.Fields;
                    }
                }
            }

            if (DepartmentType != "505")
            {
                if (DepartmentType == "6" || DepartmentType == "-1")
                {
                    var B2BItem = base.XMIncludeFieldsService.GetXMIncludeFieldsListByDepartmentID(297);//B2B
                    if (B2BItem != null)
                    {
                        Fields = Fields + "," + B2BItem.Fields;
                    }
                }
                if (DepartmentType == "197" || DepartmentType == "-1")
                {
                    var B2CItem = base.XMIncludeFieldsService.GetXMIncludeFieldsListByDepartmentID(63);//B2C
                    if (B2CItem != null)
                    {
                        Fields = Fields + "," + B2CItem.Fields;
                    }
                }
                if (DepartmentType == "507" || DepartmentType == "-1")
                {
                    Fields = Fields + ",70";                                                                              //营业费用
                    var IntegratedManagementItem = base.XMIncludeFieldsService.GetXMIncludeFieldsListByDepartmentID(507); //综管
                    if (IntegratedManagementItem != null)
                    {
                        string[] Arr = IntegratedManagementItem.Fields.Replace(",", ",").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        var      IntegratedManagementList = base.XMFinancialFieldService.GetXMFinancialFieldByParentID(70).Where(x => x.IsManagementField == true);//管理费用字段
                        if (IntegratedManagementList.Count() > 0)
                        {
                            foreach (XMFinancialField item in IntegratedManagementList)
                            {
                                if (Arr.Contains(item.Id.ToString()))
                                {
                                    Fields = Fields + "," + item.Id;
                                    IntegratedManagementIDList.Add(item.Id);
                                }
                            }
                        }
                    }
                }
            }

            Fields = Fields.Replace(",", ",");
            string[] arr = Fields.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            if (arr.Length > 0)
            {
                foreach (string a in arr)
                {
                    if (FinancialFieldList.IndexOf(int.Parse(a)) == -1)
                    {
                        FinancialFieldList.Add(int.Parse(a));
                    }
                }
            }
            #endregion

            //店铺集合
            List <int> nickIdList = new List <int>();
            #region 店铺条件查询集合 处理
            //选择某项目
            if (DepartmentType == "505")
            {
                var nickList = base.XMNickService.GetXMNickListByProjectId(Convert.ToInt32(cbXMProject), Convert.ToInt32(cbXMProjectTypeId));
                if (nickList.Count > 0)
                {
                    nickIdList = nickList.Select(p => p.nick_id).ToList();
                }
            }
            #endregion

            FinancialFieldList = GetFinancialFieldListInTurn();
            foreach (int id in SpecialID)
            {
                if (FinancialFieldList.IndexOf(id) != -1)
                {
                    son.Insert(0, id);//查询不用计算的字段
                    parent.Remove(id);
                }
            }

            #endregion

            //该年月
            string year  = this.txtYearStr.Value.Trim();
            string month = this.txtMonthStr.Value.Trim();

            string type = this.ddlType.SelectedValue.Trim();
            List <CWStaffSpendingMapping> monthList = new List <CWStaffSpendingMapping>();

            List <CWStaffSpendingMapping> Tab = GetDataByDateTime(DepartmentType, cbXMProject, nickIdList, year, month);
            if (DepartmentType != "507")
            {
                foreach (CWStaffSpendingMapping Info in Tab)
                {
                    foreach (CWStaffSpendingMapping info in MonthList)
                    {
                        if (Info.FinancialFieldId == info.FinancialFieldId && Info.YearStr == info.YearStr && Info.MonthStr == info.MonthStr)
                        {
                            Info.LastMonthTotal = (decimal)info.LastMonthTotal;
                            Info.LastYearTotal  = MonthList.Where(x => x.FinancialFieldId == Info.FinancialFieldId).Sum(x => x.LastMonthTotal);
                        }
                    }
                }
            }
            TabStr = GetTable(Tab);

            foreach (CWStaffSpendingMapping Info in MonthList)
            {
                if (type == "1" && Info.FinancialFieldId == 64)
                {
                    monthList.Add(Info);
                }
                if (type == "2" && Info.FinancialFieldId == 66)
                {
                    monthList.Add(Info);
                }
                if (type == "3" && Info.FinancialFieldId == 68)
                {
                    monthList.Add(Info);
                }
                if (type == "4" && Info.FinancialFieldId == 73)
                {
                    monthList.Add(Info);
                }
            }

            Session["MonthListMark"] = monthList;
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "BindData", "dataBind(" + year + ")", true);//ajax

            //消除Content4的隐藏效果
            System.Web.UI.HtmlControls.HtmlTable GridTable = Master.FindControl("GridTable") as System.Web.UI.HtmlControls.HtmlTable;
            GridTable.Style.Add("display", "''");
        }