private void AddRubricColumn(string name, string bind)
 {
     BoundColumn col = new BoundColumn();
     col.HeaderText = name;
     col.DataField = bind;
     dgAggregate.Columns.Add(col);
 }
		private void Page_Load(object sender, System.EventArgs e) 
		{
			//Put user code to initialize the page here

			System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1");
			GHTTestBegin(frm);

			GHTActiveSubTest = GHTSubTest1;
			try 
			{
				DataGrid1.DataSource = GHTTests.GHDataSources.DSDataTable();
				System.Web.UI.WebControls.EditCommandColumn c_edt = new System.Web.UI.WebControls.EditCommandColumn();
				System.Web.UI.WebControls.BoundColumn c_id = new System.Web.UI.WebControls.BoundColumn();
				System.Web.UI.WebControls.ButtonColumn c_name = new System.Web.UI.WebControls.ButtonColumn();
				System.Web.UI.WebControls.HyperLinkColumn c_company = new System.Web.UI.WebControls.HyperLinkColumn();

				c_id.DataField = "ID";
				c_name.DataTextField = "Name";
				c_company.DataTextField = "Company";

				DataGrid1.Columns.Add(c_edt);
				DataGrid1.Columns.Add(c_id);
				DataGrid1.Columns.Add(c_name);
				DataGrid1.Columns.Add(c_company);

				DataGrid1.DataBind();;
			}
			catch (Exception ex) 
			{
				GHTSubTestUnexpectedExceptionCaught(ex);
			}

			GHTTestEnd();
		}
Beispiel #3
0
 public void bind()
 {
     SqlConnection con = new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]);
       SqlDataAdapter da = new SqlDataAdapter("Select * from Customers",con);
       DataTable dt = new DataTable("Customers");
       da.Fill(dt);
       if(DataGrid1.Attributes["SortOn"]!=null) dt.DefaultView.Sort=DataGrid1.Attributes["SortOn"];
       BoundColumn col = new BoundColumn();
       col.ReadOnly=true;
       col.HeaderText="SL NO.";
       DataGrid1.Columns.AddAt(0,col);
       TemplateColumn col1 = new TemplateColumn();
       col1.ItemTemplate =LoadTemplate("ItemTemplate.ascx");
       col1.HeaderText="template - from ascx";
       DataGrid1.Columns.Add(col1);
       //E.Item.Cells[0].Text= E.Item.DataSetIndex + 1;
       //http://www.dotnetbips.com/displayarticle.aspx?id=84
       //http://www.dotnetbips.com/displayarticle.aspx?id=85
       TemplateColumn col2 = new TemplateColumn();
       col2.HeaderText  = "template - from code";
       col2.ItemTemplate = new CTemplateColumn("Customer_Name");
       DataGrid1.Columns.Add(col2);
       DataGrid1.DataSource=dt.DefaultView;
       //next 2 lines to check if the pageindex is greater than noof pages when records are deleted from DB
       double actualPageCount = Math.Ceiling(dt.Rows.Count / (double)DataGrid1.PageSize);
       if(DataGrid1.CurrentPageIndex>=actualPageCount) DataGrid1.CurrentPageIndex =(int)actualPageCount - 1;
       DataGrid1.DataBind();
 }
Beispiel #4
0
//        /// <summary>
//        /// 导出到 Excel 并提示下载
//        /// </summary>
//        /// <param name="xgrid">ASPxGrid</param>
//        public void Export(DevExpress.Web.ASPxGrid.ASPxGrid xgrid) {
//            if (xgrid == null)
//                throw new ArgumentNullException("xgrid");
//            if (xgrid.PageCount > 1)
//                throw new ArgumentException("paged xgird not can't be exported.", "xgrid");
//
//            // 添加标题样式
//            xgrid.HeaderStyle.Font.Bold = true;
//            xgrid.HeaderStyle.BackColor = System.Drawing.Color.LightGray;
//
//            RenderExcel(xgrid);
//        }

        /// <summary>
        /// 导出到 Excel 并提示下载
        /// </summary>
        public void Export()
        {
            if (_dataSource == null)
            {
                throw new Exception("数据源尚未初始化");
            }

            if (_fields == null && _titles != null && _titles.Length != _dataSource.Columns.Count)
            {
                throw new Exception("_titles.Length != _dataSource.Columns.Count");
            }
            //去掉限制
            //if (_dataSource.Rows.Count > _maxRecords)
            //    throw new Exception("导出数据条数超过限制。请设置 MaxRecords 属性以定义导出的最多记录数。");

            DataGrid dg = new DataGrid();

            dg.DataSource = _dataSource;

            if (_titles == null)
            {
                dg.AutoGenerateColumns = true;
            }
            else
            {
                dg.AutoGenerateColumns = false;
                int cnt = _titles.Length;

                System.Web.UI.WebControls.BoundColumn col;

                if (_fields == null)
                {
                    for (int i = 0; i < cnt; i++)
                    {
                        col            = new System.Web.UI.WebControls.BoundColumn();
                        col.HeaderText = _titles[i];
                        col.DataField  = _dataSource.Columns[i].ColumnName;
                        dg.Columns.Add(col);
                    }
                }
                else
                {
                    for (int i = 0; i < cnt; i++)
                    {
                        col            = new System.Web.UI.WebControls.BoundColumn();
                        col.HeaderText = _titles[i];
                        col.DataField  = _fields[i];
                        dg.Columns.Add(col);
                    }
                }
            }

            // 添加标题样式
            dg.HeaderStyle.Font.Bold = true;
            dg.HeaderStyle.BackColor = System.Drawing.Color.LightGray;
            dg.ItemDataBound        += new DataGridItemEventHandler(DataGridItemDataBound);

            dg.DataBind();
            RenderExcel(dg);
        }
		private void Page_Load(object sender, EventArgs e)
		{
			HtmlForm form1 = (HtmlForm) (HtmlForm)this.FindControl("Form1");
			this.GHTTestBegin(form1);
			base.GHTActiveSubTest = this.GHTSubTest1;
			try
			{
				this.DataGrid1.DataSource = GHTTests.GHDataSources.DSDataTable();
				BoundColumn column2 = new BoundColumn();
				BoundColumn column3 = new BoundColumn();
				BoundColumn column1 = new BoundColumn();
				column2.DataField = "ID";
				column3.DataField = "Name";
				column1.DataField = "Company";
				this.DataGrid1.Columns.Add(column2);
				this.DataGrid1.Columns.Add(column3);
				this.DataGrid1.Columns.Add(column1);
				this.DataGrid1.DataBind();
			}
			catch (Exception exception2)
			{
				// ProjectData.SetProjectError(exception2);
				Exception exception1 = exception2;
				this.GHTSubTestUnexpectedExceptionCaught(exception1);
				// ProjectData.ClearProjectError();
			}
			this.GHTTestEnd();
		}
Beispiel #6
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            //Put user code to initialize the page here

            System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1");
            GHTTestBegin(frm);

            GHTActiveSubTest = GHTSubTest1;
            try
            {
                DataGrid1.DataSource = GHTTests.GHDataSources.DSDataTable();
                System.Web.UI.WebControls.EditCommandColumn c_edt     = new System.Web.UI.WebControls.EditCommandColumn();
                System.Web.UI.WebControls.BoundColumn       c_id      = new System.Web.UI.WebControls.BoundColumn();
                System.Web.UI.WebControls.ButtonColumn      c_name    = new System.Web.UI.WebControls.ButtonColumn();
                System.Web.UI.WebControls.HyperLinkColumn   c_company = new System.Web.UI.WebControls.HyperLinkColumn();

                c_id.DataField          = "ID";
                c_name.DataTextField    = "Name";
                c_company.DataTextField = "Company";

                DataGrid1.Columns.Add(c_edt);
                DataGrid1.Columns.Add(c_id);
                DataGrid1.Columns.Add(c_name);
                DataGrid1.Columns.Add(c_company);

                DataGrid1.DataBind();;
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTTestEnd();
        }
        protected BoundColumn CreateBoundColumn(DataColumn c, string[] col, int index)
        {
            BoundColumn column = new BoundColumn();
            column.DataField = c.ColumnName;
            column.HeaderText = col[index].ToString();
            column.DataFormatString = setFormating(c);

            return column;
        }
Beispiel #8
0
 private void GenerateCols(DataTable dt,DataGrid dg)
 {
     foreach(DataColumn dc in dt.Columns)
       {
       BoundColumn bc = new BoundColumn();
       bc.HeaderText=dc.ColumnName;
       bc.DataField=dc.ColumnName;
       dg.Columns.Add(bc);
       }
 }
Beispiel #9
0
        /// <summary>
        /// 获得通过的查询
        /// </summary>
        /// <param name="dgList"></param>
        /// <param name="Table_Name"></param>
        /// <param name="CorGuid"></param>
        /// <param name="DateFrom"></param>
        /// <param name="DateTo"></param>
        /// <param name="PageSize"></param>
        /// <param name="CurrentPageIndex"></param>
        /// <param name="TotalNum"></param>
        /// <param name="Message"></param>
        public void GetApprovalList(System.Web.UI.WebControls.DataGrid dgList, string Table_Name, string CorGuid, string DateFrom, string DateTo, int PageSize, int CurrentPageIndex, out int TotalNum, out string Message)
        {
            DataView dvList = new CawApprovalSetDB().Select(Table_Name);
            if(dvList.Count<1)
            {
                Message="审批信息还没有配置,请先至审批配置页面进行审批信息配置";
                TotalNum = 0;
                return;
            }
            //添加隐藏列GUID
            BoundColumn col =new BoundColumn();
            col.DataField = "GUID";
            col.Visible = false;
            dgList.Columns.Add(col);

            string col_En = "COMPANY_NAME," + dvList[0]["COLLIST"].ToString().Trim() + ",SUBMITDATE,DATASTATUS_NAME";
            string col_Cn = "企业名称," + dvList[0]["COLLIST_CN"].ToString().Trim() + ",申请日期,审批状态";
            string[] colList = col_En.Split(',');
            string[] colList_Cn = col_Cn.Split(',');

            //添加显示列
            for (int i = 0; i < colList.Length; i++)
            {
                BoundColumn col1 = new BoundColumn();
                col1.HeaderText = colList_Cn[i];
                col1.DataField = colList[i];
                col1.HeaderStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center;
                col1.ItemStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center;
                dgList.Columns.Add(col1);
            }

            string Where = " AND B.DATASTATUS='2'";
            Where += CorGuid == "" ? "" : " AND A." + dvList[0]["QUERYFIELD"].ToString().Trim() + "='" + CorGuid + "'";

            Where += (DateFrom != "" && DateTo == "") ? " AND B.SUBMITDATE >=TO_DATE('" + DateFrom + "','yyyy-mm-dd')" : "";
            Where += (DateFrom == "" && DateTo != "") ? " AND B.SUBMITDATE <=TO_DATE('" + DateTo + "','yyyy-mm-dd')" : "";
            Where += (DateFrom != "" && DateTo != "") ? " AND B.SUBMITDATE >=TO_DATE('" + DateFrom + "','yyyy-mm-dd') AND B.SUBMITDATE <=TO_DATE('" + DateTo + "','yyyy-mm-dd')" : "";
            string strSql = " SELECT '' AS TMP,A." + dvList[0]["COLLIST"].ToString().Trim().Replace(",",",A.") + ",A." + dvList[0]["KEYFIELD"].ToString().Trim() + " AS GUID,B.DATASTATUS_NAME,TO_CHAR(B.SUBMITDATE,'yyyy-mm-dd') SUBMITDATE,C.NAME AS COMPANY_NAME FROM " + Table_Name + " A INNER JOIN CAW_DATESTATUS B ON A." + dvList[0]["KEYFIELD"].ToString().Trim() + "=B.KEYGUID INNER JOIN CAW_COMPANY C ON A." + dvList[0]["QUERYFIELD"].ToString().Trim() + "=C.GUID" + Where;
            strSql = FrameCommon.GetPageSql(CawConnStr, out TotalNum, CurrentPageIndex, PageSize, strSql, "GUID", " ORDER BY SUBMITDATE DESC");
            Database db = DatabaseFactory.CreateDatabase(CawConnStr);
            DbCommand cmd = db.GetSqlStringCommand(strSql);
            try
            {
                dgList.DataSource = db.ExecuteDataView(cmd);
                dgList.DataBind();
                Message = "";
            }
            catch(Exception err)
            {
                Message = "审批信息配置错误";
                TotalNum = 0;
                return;
            }
        }
        public void bind()
        {
            SqlConnection con = new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]);
            string sql = "Select * from Customers";
            string sortBy = DataGrid1.Attributes["SortOn"];
            if(sortBy!=null && sortBy.Length>0)
            {
                sql  += "order by " + sortBy;
            }
            SqlCommand comm = new SqlCommand(sql,con);
            con.Open();
            SqlDataReader reader = comm.ExecuteReader(CommandBehavior.CloseConnection);

            BoundColumn col = new BoundColumn();
            col.ReadOnly=true;
            col.HeaderText="SL NO.";
            DataGrid1.Columns.AddAt(0,col);
            //            TemplateColumn col1 = new TemplateColumn();
            //            col1.ItemTemplate =LoadTemplate("ItemTemplate.ascx");
            //            col1.HeaderText="template - from ascx";
            //            DataGrid1.Columns.Add(col1);
            //            //E.Item.Cells[0].Text= E.Item.DataSetIndex + 1;
            //            //http://www.dotnetbips.com/displayarticle.aspx?id=84
            //            //http://www.dotnetbips.com/displayarticle.aspx?id=85
            //            TemplateColumn col2 = new TemplateColumn();
            //            col2.HeaderText  = "template - from code";
            //            col2.ItemTemplate = new CTemplateColumn("Customer_Name");
            //            DataGrid1.Columns.Add(col2);
            DataGrid1.VirtualItemCount = DataGrid1.PageSize * 3 ;//3 pages
            DataGrid1.DataSource=reader;
            int loopMax = int.Parse(DataGrid1.Attributes["PageNo"])  * DataGrid1.PageSize;
            for(int i=0;i<loopMax &&  reader.Read();i++);
            //next 2 lines to check if the pageindex is greater than noof pages when records are deleted from DB
            //double actualPageCount = Math.Ceiling(dt.Rows.Count / (double)DataGrid1.PageSize);
            //if(DataGrid1.CurrentPageIndex>=actualPageCount) DataGrid1.CurrentPageIndex =(int)actualPageCount - 1;
            DataGrid1.DataBind();

            if(reader.IsClosed || !reader.Read())
            {
                ArrayList pagers = new ArrayList(2);
                getPager(DataGrid1,pagers);
                foreach(DataGridItem pager in pagers)
                {
                    //item = <TR><TD>&lt;(<:prev)</TD><TD>&nbsp;(a space)</TD><TD>&gt;(>:next)</TD></TR>
                    LinkButton nextLink = (LinkButton)pager.Controls[0]/*tr*/.Controls[2]/*3rd td*/;
                    nextLink.ForeColor=Color.Crimson;
                    //nextLink.Enabled = false;
                    //nextLink.Click = null;
                    //nextLink.Command  = null;
                    nextLink.Attributes.Add("onclick","return false;");
                }
            }
            reader.Close();
        }
 /// <summary>
 /// Agrega una nueva columna al DataGrid
 /// </summary>
 /// <param name="MyDataGrid">Objeto DataGrid a actualizar</param>
 /// <param name="myDatatable">Objeto Datatable con los datos</param>
 /// <param name="objBound_column">Objeto BoundColumn a agregar</param>
 /// <remarks>
 /// <list> Creado: Diciembre 10 de 2013 - Ing. David Alejandro Pineda Diaz </list>
 /// </remarks>
 public static void addBoundColumnToGrid(ref DataGrid MyDataGrid, DataTable myDatatable, BoundColumn objBound_column)
 {
     try
     {
         MyDataGrid.Columns.Add(objBound_column);
         updateGrid(ref MyDataGrid, myDatatable);
     }
     catch (Exception ex)
     {
         throw ex;
        }
 }
Beispiel #12
0
 private System.Web.UI.WebControls.BoundColumn GetColumn(string dataField, string headerText, System.Web.UI.WebControls.HorizontalAlign alignment)
 {
     System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
     colBound.DataField = dataField;
     colBound.HeaderText = headerText;
     colBound.Initialize();
     colBound.HeaderStyle.CssClass = "ektronTitlebar";
     colBound.ItemStyle.Wrap = true;
     colBound.ItemStyle.HorizontalAlign = alignment;
     colBound.ItemStyle.CssClass = "history-list";
     colBound.HeaderStyle.Height = Unit.Empty;
     return colBound;
 }
Beispiel #13
0
		/// <summary>
		/// Adds a bound column to the datagrid with a format string for the
		/// data field. This is used to create hyperlinks to say an email address.
		/// </summary>
		/// <param name="headerText">The header text.</param>
		/// <param name="dataField">The data field.</param>
		/// <param name="dataFormat">The data format.</param>
		/// <param name="readOnly">if set to <c>true</c> [read only].</param>
		public void AddBoundColumn(string headerText, string dataField, string dataFormat, bool readOnly)
		{
			BoundColumn column;
			column = new BoundColumn();
			column.HeaderText = String.Format("<strong>{0}</strong>", headerText);
			column.DataField = dataField;
			column.ReadOnly = readOnly;
			column.HeaderStyle.CssClass = "ms-TPHeader";
			column.ItemStyle.CssClass = "ms-alternating";
			if (dataFormat != String.Empty)
				column.DataFormatString = dataFormat;
			this.Columns.Add(column);
		}
		private void Page_Load(object sender, System.EventArgs e) 
		{
			//Put user code to initialize the page here

			System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1");
			GHTTestBegin(frm);

			GHTActiveSubTest = GHTSubTest1;
			try 
			{
				DataGrid1.DataSource = GHTTests.GHDataSources.DSDataTable();;
				System.Web.UI.WebControls.BoundColumn c_id = new System.Web.UI.WebControls.BoundColumn();
				System.Web.UI.WebControls.BoundColumn c_name = new System.Web.UI.WebControls.BoundColumn();
				System.Web.UI.WebControls.BoundColumn c_company = new System.Web.UI.WebControls.BoundColumn();
				c_id.DataField = "ID";
				c_name.DataField = "Name";
				c_company.DataField = "Company";

				c_id.DataFormatString = "";
				c_name.DataFormatString = "slkdjflkfslkjf slkfjsl ks jlflks d";
				c_company.DataFormatString = "{0:c2}";

				DataGrid1.Columns.Add(c_id);
				DataGrid1.Columns.Add(c_name);
				DataGrid1.Columns.Add(c_company);

				DataGrid1.DataBind();;
				GHTSubTestAddResult(c_id.DataFormatString);
				GHTSubTestAddResult(c_name.DataFormatString);
				GHTSubTestAddResult(c_company.DataFormatString);
			}
			catch (Exception ex) 
			{
				GHTSubTestUnexpectedExceptionCaught(ex);
			}

			GHTActiveSubTest = Ghtsubtest2;
			try 
			{
				DataGrid2.DataSource = GHTTests.GHDataSources.DSDataTable();
				DataGrid2.DataBind();;
			}
			catch (Exception ex) 
			{
				GHTSubTestUnexpectedExceptionCaught(ex);
			}

			GHTTestEnd();
		}
Beispiel #15
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            //Put user code to initialize the page here

            System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1");
            GHTTestBegin(frm);

            GHTActiveSubTest = GHTSubTest1;
            try
            {
                DataGrid1.DataSource = GHTTests.GHDataSources.DSDataTable();;
                System.Web.UI.WebControls.BoundColumn c_id      = new System.Web.UI.WebControls.BoundColumn();
                System.Web.UI.WebControls.BoundColumn c_name    = new System.Web.UI.WebControls.BoundColumn();
                System.Web.UI.WebControls.BoundColumn c_company = new System.Web.UI.WebControls.BoundColumn();
                c_id.DataField      = "ID";
                c_name.DataField    = "Name";
                c_company.DataField = "Company";

                c_id.DataFormatString      = "";
                c_name.DataFormatString    = "slkdjflkfslkjf slkfjsl ks jlflks d";
                c_company.DataFormatString = "{0:c2}";

                DataGrid1.Columns.Add(c_id);
                DataGrid1.Columns.Add(c_name);
                DataGrid1.Columns.Add(c_company);

                DataGrid1.DataBind();;
                GHTSubTestAddResult(c_id.DataFormatString);
                GHTSubTestAddResult(c_name.DataFormatString);
                GHTSubTestAddResult(c_company.DataFormatString);
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTActiveSubTest = Ghtsubtest2;
            try
            {
                DataGrid2.DataSource = GHTTests.GHDataSources.DSDataTable();
                DataGrid2.DataBind();;
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTTestEnd();
        }
Beispiel #16
0
 /// <summary>
 /// 得到相应的字段只读属性
 /// </summary>
 /// <returns></returns>
 private ArrayList GetBoundColumnFieldReadOnly()
 {
     System.Collections.ArrayList __arraylist = new ArrayList();
     foreach (DataGridColumn o in this.Columns)
     {
         System.Web.UI.WebControls.BoundColumn __boundcolumn = o as System.Web.UI.WebControls.BoundColumn;
         if (__boundcolumn != null)
         {
             __arraylist.Add(__boundcolumn.ReadOnly);
         }
         else
         {
             __arraylist.Add(true);
         }
     }
     return(__arraylist);
 }
Beispiel #17
0
 /// <summary>
 /// 得到相应的字段列表
 /// </summary>
 /// <returns></returns>
 private ArrayList GetBoundColumnField()
 {
     System.Collections.ArrayList __arraylist = new ArrayList();
     foreach (DataGridColumn o in this.Columns)
     {
         System.Web.UI.WebControls.BoundColumn __boundcolumn = o as System.Web.UI.WebControls.BoundColumn;
         if (__boundcolumn != null)
         {
             __arraylist.Add(__boundcolumn.DataField);
         }
         else
         {
             System.Web.UI.WebControls.TemplateColumn __templatecolumn = o as System.Web.UI.WebControls.TemplateColumn;
             __arraylist.Add(__templatecolumn.HeaderText);
         }
     }
     return(__arraylist);
 }
        private void populateDataGridWithSqlQueryResults()
        {
            try
            {
                string sqlQueryToexecute = Server.HtmlDecode(txtSqlQueryToExecute.Text);
                XmlNode[] sqlQueryResults = (XmlNode[])Global.objAccountManagement.WS_ExecuteSqlQuery("",sqlQueryToexecute);

                if (sqlQueryResults[0].ChildNodes.Count >0)
                {
                    //Create DataGrid Table Headers
                    DataTable dataTableWithSqlQueryResults = new DataTable();
                    for (int i=0; i < sqlQueryResults[0].ChildNodes.Count;i++)
                    {
                        XmlNode resultItem = sqlQueryResults[0].ChildNodes[i];
                        BoundColumn dynamicDataGridColumn = new BoundColumn();
                        dynamicDataGridColumn.DataField = i.ToString();
                        dynamicDataGridColumn.HeaderText = resultItem.InnerText;
                        dgQueryResult.Columns.Add(dynamicDataGridColumn);
                        dataTableWithSqlQueryResults.Columns.Add(i.ToString());
                    }
                    if (sqlQueryResults.Length>1)
                    {
                        //Populate DataGrid Table
                        for (int j=1; j<sqlQueryResults.Length;j++)
                        {
                            //DataRow dynamicDataRow = dataTableWithSqlQueryResults.NewRow();
                            object[] rowData = new object[sqlQueryResults[j].ChildNodes.Count];
                            for (int i=0; i < sqlQueryResults[j].ChildNodes.Count;i++)
                            {
                                XmlNode resultItem = sqlQueryResults[j].ChildNodes[i];
                                rowData[i] = Server.HtmlEncode(resultItem.InnerText);
                            }
                            dataTableWithSqlQueryResults.Rows.Add(rowData);
                        }
                    }
                    dgQueryResult.DataSource = dataTableWithSqlQueryResults;
                    dgQueryResult.DataBind();
                }
            }
            catch (Exception Ex)
            {
                lblErrorMessage.Text = Ex.Message;
            }
        }
Beispiel #19
0
    private void Display_ViewAllFont()
    {
        TR_ViewAllFont.Visible = true;
            FontData[] font_data_list;
            font_data_list = m_refContApi.GetAllFonts();
            if (!(font_data_list == null))
            {
                System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
                colBound.DataField = "ID";
                colBound.HeaderText = m_refMsg.GetMessage("generic Fontname");
                ViewFontGrid.Columns.Add(colBound);

                colBound = new System.Web.UI.WebControls.BoundColumn();
                colBound.DataField = "TITLE";
                colBound.HeaderText = m_refMsg.GetMessage("generic Font Face Sample");
                ViewFontGrid.Columns.Add(colBound);
                DataTable dt = new DataTable();
                DataRow dr;
                int i = 0;
                dt.Columns.Add(new DataColumn("ID", typeof(string)));
                dt.Columns.Add(new DataColumn("TITLE", typeof(string)));
                for (i = 0; i <= font_data_list.Length - 1; i++)
                {
                    dr = dt.NewRow();
                    dr[0] = "<a href=\"font.aspx?action=View&id=" + font_data_list[i].Id + "\" title=\'" + m_refMsg.GetMessage("click to view font msg") + " \"" + Strings.Replace(font_data_list[i].Face, "\'", "`", 1, -1, 0) + "\"\'>" + font_data_list[i].Face + "</a>";
                    dr[1] = "<font face=\"" + font_data_list[i].Face + "\">" + m_refMsg.GetMessage("sample font face style") + "</font>";

                    dt.Rows.Add(dr);
                }
                ViewFontGrid.BorderColor = System.Drawing.Color.White;
                DataView dv = new DataView(dt);
                ViewFontGrid.DataSource = dv;
                ViewFontGrid.DataBind();
            }
            ViewFontsByGroupToolBar();
    }
 public BoundColumnItem(BoundColumn runtimeColumn)
     : base(runtimeColumn, 1)
 {
 }
 public override DataGridColumnsPage.ColumnItem[] CreateColumns(PropertyDescriptorCollection fields)
 {
     ArrayList list = new ArrayList();
     IEnumerator enumerator = fields.GetEnumerator();
     while (enumerator.MoveNext())
     {
         PropertyDescriptor current = (PropertyDescriptor) enumerator.Current;
         if (BaseDataList.IsBindableType(current.PropertyType))
         {
             BoundColumn runtimeColumn = new BoundColumn {
                 HeaderText = current.Name,
                 DataField = current.Name
             };
             DataGridColumnsPage.ColumnItem item = new DataGridColumnsPage.BoundColumnItem(runtimeColumn);
             item.LoadColumnInfo();
             list.Add(item);
         }
     }
     return (DataGridColumnsPage.ColumnItem[]) list.ToArray(typeof(DataGridColumnsPage.ColumnItem));
 }
 public override DataGridColumnsPage.ColumnItem CreateColumn()
 {
     BoundColumn runtimeColumn = new BoundColumn();
     if (!this.genericBoundColumn)
     {
         runtimeColumn.HeaderText = this.fieldName;
         runtimeColumn.DataField = this.fieldName;
         runtimeColumn.SortExpression = this.fieldName;
     }
     DataGridColumnsPage.ColumnItem item = new DataGridColumnsPage.BoundColumnItem(runtimeColumn);
     item.LoadColumnInfo();
     return item;
 }
Beispiel #23
0
    private void AddUserGroupGrid_Search()
    {
        System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "CHECK";
        colBound.HeaderText = "<input type=\"Checkbox\" name=\"checkall\" onclick=\"CheckAll();\">";
        colBound.HeaderStyle.CssClass = "title-header";
        colBound.ItemStyle.Wrap = false;
        colBound.HeaderStyle.Width = Unit.Percentage(5);
        colBound.ItemStyle.Width = Unit.Percentage(5);
        AddGroupGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "GROUPTITLE";
        colBound.HeaderText = m_refMsg.GetMessage("active directory group title");
        colBound.ItemStyle.Wrap = false;
        colBound.HeaderStyle.CssClass = "title-header";
        colBound.HeaderStyle.Width = Unit.Percentage(15);
        colBound.ItemStyle.Width = Unit.Percentage(15);
        AddGroupGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "DOMAINTITLE";
        colBound.HeaderStyle.CssClass = "title-header";
        colBound.HeaderText = m_refMsg.GetMessage("domain title");
        colBound.ItemStyle.Wrap = false;
        AddGroupGrid.Columns.Add(colBound);

        DataTable dt = new DataTable();
        DataRow dr;
        dt.Columns.Add(new DataColumn("CHECK", typeof(string)));
        dt.Columns.Add(new DataColumn("GROUPTITLE", typeof(string)));
        dt.Columns.Add(new DataColumn("DOMAINTITLE", typeof(string)));

        int i = 0;
        if (!(group_list == null))
        {
            for (i = 0; i <= group_list.Length - 1; i++)
            {
                dr = dt.NewRow();
                dr[0] = "<input type=\"CHECKBOX\" name=\"addgroup" + (i + 1) + "\" value=\"" + group_list[i].GroupPath + "\">";
                dr[1] = group_list[i].GroupName;
                dr[2] = group_list[i].GroupDomain;
                dt.Rows.Add(dr);
            }
        }
        else
        {
            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("no ad groups found");
            dr[1] = "";
            dr[2] = "";
            dt.Rows.Add(dr);
        }
        addgroupcount.Value = i.ToString() + 1;
        DataView dv = new DataView(dt);
        AddGroupGrid.DataSource = dv;
        AddGroupGrid.DataBind();
    }
Beispiel #24
0
    private void Display_ViewAllSubscriptions()
    {
        TR_ViewAllFont.Visible = true;
        SubscriptionData[] subscription_data_list;
        subscription_data_list = m_refContApi.GetAllSubscriptions();
        if (!(subscription_data_list == null))
        {
            System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "NAME";
            colBound.HeaderText = m_refMsg.GetMessage("generic Subscriptionname");
            colBound.ItemStyle.Wrap = false;
            colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
            colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
            colBound.HeaderStyle.VerticalAlign = VerticalAlign.Top;
            colBound.HeaderStyle.Wrap = false;
            ViewSubscriptionGrid.Columns.Add(colBound);
            colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "ID";
            colBound.HeaderText = m_refMsg.GetMessage("generic SubscriptionID");
            colBound.ItemStyle.Wrap = false;
            colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
            colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
            ViewSubscriptionGrid.Columns.Add(colBound);
            colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "ENABLE";
            colBound.HeaderText = m_refMsg.GetMessage("generic Subscriptionenable");
            colBound.ItemStyle.Wrap = false;
            colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
            colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
            ViewSubscriptionGrid.Columns.Add(colBound);
            colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "LanguageId";
            colBound.HeaderText = m_refMsg.GetMessage("generic SubscriptionLanguageID");
            colBound.ItemStyle.Wrap = false;
            colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
            colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
            ViewSubscriptionGrid.Columns.Add(colBound);
            DataTable dt = new DataTable();
            DataRow dr;
            int i = 0;
            dt.Columns.Add(new DataColumn("NAME", typeof(string)));
            dt.Columns.Add(new DataColumn("ID", typeof(string)));
            dt.Columns.Add(new DataColumn("ENABLE", typeof(string)));
            dt.Columns.Add(new DataColumn("LanguageId", typeof(string)));
            for (i = 0; i <= subscription_data_list.Length - 1; i++)
            {
                dr = dt.NewRow();
                dr[0] = "<a href=\"" + PAGE_NAME + "?action=View&id=" + subscription_data_list[i].Id + "\" title=\'" + m_refMsg.GetMessage("click to view subscription msg") + " \"" + Strings.Replace(EkFunctions.HtmlEncode(subscription_data_list[i].Name), "\'", "`", 1, -1, 0) + "\"\'>" + EkFunctions.HtmlEncode(subscription_data_list[i].Name) + "</a>";
                dr[1] = subscription_data_list[i].Id.ToString();
                if (subscription_data_list[i].Enable)
                {
                    dr[2] = "<input type=\"checkbox\" name=\"chkEnable\" CHECKED DISABLED />";
                }
                else
                {
                    dr[2] = "<input type=\"checkbox\" name=\"chkEnable\" DISABLED />";
                }

                dr[3] = subscription_data_list[i].LanguageId;
                dt.Rows.Add(dr);
            }

            ViewSubscriptionGrid.BorderColor = System.Drawing.Color.White;
            DataView dv = new DataView(dt);
            ViewSubscriptionGrid.DataSource = dv;
            ViewSubscriptionGrid.DataBind();
        }

        ViewAllSubscriptionsToolBar();
    }
Beispiel #25
0
    private void PopulatePreviewGrid(XmlConfigData xml_config_data)
    {
        System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "TITLE";
            colBound.HeaderText = m_refMsg.GetMessage("lbl Preview XSLT on empty XML document");
            colBound.ItemStyle.CssClass = "label left";
            colBound.ItemStyle.Wrap = false;
            colBound.HeaderStyle.Height = Unit.Empty;
            colBound.ItemStyle.Height = Unit.Empty;
            PreviewGrid.Columns.Add(colBound);

            DataTable dt = new DataTable();
            DataRow dr;
            dt.Columns.Add(new DataColumn("TITLE", typeof(string)));

            dr = dt.NewRow();
            dr[0] = m_refContentApi.XSLTransform("<root></root>", xml_config_data.PackageDisplayXslt, false, false, null, true, true);
            dt.Rows.Add(dr);

            DataView dv = new DataView(dt);
            PreviewGrid.DataSource = dv;
            PreviewGrid.DataBind();
    }
Beispiel #26
0
    private void LoadContentFlags(ContentFlagData[] FlagList)
    {
        dg_flag.DataSource = this.CreateContentFlagSource(FlagList);
        dg_flag.CellPadding = 3;

        System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "USERNAME";
        colBound.HeaderText = _MessageHelper.GetMessage("display name label");
        //colBound.HeaderStyle.CssClass = "title-header"
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
        colBound.ItemStyle.Wrap = false;
        dg_flag.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "DATETIME";
        colBound.HeaderText = _MessageHelper.GetMessage("generic date no colon");
        //colBound.HeaderStyle.CssClass = "title-header"
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
        colBound.ItemStyle.Wrap = false;
        dg_flag.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "FLAG";
        colBound.HeaderText = _MessageHelper.GetMessage("flag label");
        //colBound.HeaderStyle.CssClass = "title-header"
        colBound.ItemStyle.Wrap = false;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
        colBound.ItemStyle.Wrap = false;
        dg_flag.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "COMMENTS";
        colBound.HeaderText = _MessageHelper.GetMessage("comment text");
        //colBound.HeaderStyle.CssClass = "title-header"
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
        colBound.ItemStyle.Wrap = true;
        dg_flag.Columns.Add(colBound);

        dg_flag.DataBind();
    }
Beispiel #27
0
    private void Display_PropertiesTab(EntryData entry_data_version)
    {
        System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();

            colBound.DataField = "NAME";
            colBound.HeaderText = "";
            colBound.ItemStyle.CssClass = "label";
            PropertiesGrid.Columns.Add(colBound);

            colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "TITLE";
            colBound.HeaderText = "";
            PropertiesGrid.Columns.Add(colBound);

            DataTable dt = new DataTable();
            DataRow dr;

            dt.Columns.Add(new DataColumn("NAME", typeof(string)));
            dt.Columns.Add(new DataColumn("TITLE", typeof(string)));

            int i = 0;

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("content title label");
            dr[1] = entry_data_version.Title;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("content id label");
            dr[1] = entry_data_version.Id;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("content language label");
            dr[1] = entry_data_version.LanguageId;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("lbl calatog entry sku") + "&nbsp;#:";
            dr[1] = entry_data.Sku;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("content status label");
            switch (entry_data_version.Status.ToLower())
            {
                case "a":
                    dr[1] = m_refMsg.GetMessage("status:Approved (Published)");
                    break;
                case "o":
                    dr[1] = m_refMsg.GetMessage("status:Checked Out");
                    break;
                case "i":
                    dr[1] = m_refMsg.GetMessage("status:Checked In");
                    break;
                case "p":
                    dr[1] = m_refMsg.GetMessage("status:Approved (PGLD)");
                    break;
                case "m":
                    dr[1] = "<font color=\"Red\">" + m_refMsg.GetMessage("status:Submitted for Deletion") + "</font>";
                    break;
                case "s":
                    dr[1] = "<font color=\"Red\">" + m_refMsg.GetMessage("status:Submitted for Approval") + "</font>";
                    break;
                case "t":
                    dr[1] = m_refMsg.GetMessage("status:Waiting Approval");
                    break;
                case "d":
                    dr[1] = "Deleted (Pending Start Date)";
                    break;
            }
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("content LUE label");
            dr[1] = entry_data_version.LastEditorFirstName + " " + entry_data_version.LastEditorLastName; //DisplayUserName
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("content LED label");
            dr[1] = entry_data_version.DateModified;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("generic start date label");
            if (entry_data_version.GoLive == DateTime.MinValue || entry_data_version.GoLive == DateTime.MaxValue)
            {
                dr[1] = m_refMsg.GetMessage("none specified msg");
            }
            else
            {
                dr[1] = entry_data_version.GoLive;
            }
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("generic end date label");
            if (entry_data_version.EndDate == DateTime.MinValue || entry_data_version.EndDate == DateTime.MaxValue)
            {
                dr[1] = m_refMsg.GetMessage("none specified msg");
            }
            else
            {
                dr[1] = entry_data_version.EndDate;
            }
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("End Date Action Title");

            if (entry_data_version.EndDate == DateTime.MinValue || entry_data_version.EndDate == DateTime.MaxValue)
            {
                if (entry_data_version.EndDateAction == Ektron.Cms.Common.EkConstants.EndDateActionType_archive_display)
                {
                    dr[1] = m_refMsg.GetMessage("Archive display descrp");
                }
                else if (entry_data_version.EndDateAction == Ektron.Cms.Common.EkConstants.EndDateActionType_refresh)
                {
                    dr[1] = m_refMsg.GetMessage("Refresh descrp");
                }
                else
                {
                    dr[1] = m_refMsg.GetMessage("Archive expire descrp");
                }
            }
            else
            {
                dr[1] = m_refMsg.GetMessage("none specified msg");
            }

            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("content DC label");
            dr[1] = entry_data_version.DateModified; //DisplayDateCreated
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("content approvals label");
            System.Text.StringBuilder approvallist = new System.Text.StringBuilder();
            ApprovalData[] approvaldata;
            approvaldata = m_refContentApi.GetCurrentApprovalInfoByID(ContentId);
            approvallist.Append(m_refMsg.GetMessage("none specified msg"));
            if (!(approvaldata == null))
            {
                if (approvaldata.Length > 0)
                {
                    approvallist.Length = 0;
                    for (i = 0; i <= approvaldata.Length - 1; i++)
                    {
                        if (approvaldata[i].Type == "user")
                        {
                            approvallist.Append("<img src=\"" + imagePath + "user.png\" align=\"absbottom\" alt=\"" + m_refMsg.GetMessage("approver is user") + "\" title=\"" + m_refMsg.GetMessage("approver is user") + "\">");
                        }
                        else
                        {
                            approvallist.Append("<img src=\"" + imagePath + "user.png\" align=\"absbottom\" alt=\"" + m_refMsg.GetMessage("approver is user group") + "\" title=\"" + m_refMsg.GetMessage("approver is user group") + "\">");
                        }
                        if (approvaldata[i].IsCurrentApprover)
                        {
                            approvallist.Append("<span class=\"important\">");
                        }
                        else
                        {
                            approvallist.Append("<span>");
                        }
                        approvallist.Append(approvaldata[i].DisplayUserName + "</span>");
                    }
                }
            }
            dr[1] = approvallist.ToString();
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("xml configuration label");
            dr[1] = "&nbsp;" + entry_data_version.ProductType.Title;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("generic template label");
            dr[1] = "";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("generic Path");
            dr[1] = m_refContentApi.EkContentRef.GetFolderPath(entry_data_version.FolderId);

            DataView dv = new DataView(dt);
            PropertiesGrid.DataSource = dv;
            PropertiesGrid.DataBind();
    }
        private void Page_Load(object sender, System.EventArgs e)
        {
            //Put user code to initialize the page here

            System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1");
            GHTTestBegin(frm);

            GHTActiveSubTest = GHTSubTest1;
            try
            {
                DataGrid1.DataSource = GHTTests.GHDataSources.DSDataTable();

                System.Web.UI.WebControls.BoundColumn c_id = new System.Web.UI.WebControls.BoundColumn();
                c_id.DataField = "ID";
                c_id.ReadOnly  = false;

                DataGrid1.Columns.Add(c_id);
                DataGrid1.DataBind();;
                GHTSubTestAddResult(c_id.ReadOnly.ToString());
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTActiveSubTest = Ghtsubtest2;
            try
            {
                DataGrid2.DataSource = GHTTests.GHDataSources.DSDataTable();

                System.Web.UI.WebControls.BoundColumn c_id = new System.Web.UI.WebControls.BoundColumn();
                c_id.DataField = "ID";
                c_id.ReadOnly  = true;

                DataGrid2.Columns.Add(c_id);
                DataGrid2.DataBind();;
                GHTSubTestAddResult(c_id.ReadOnly.ToString());
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTActiveSubTest = Ghtsubtest3;
            try
            {
                DataGrid3.DataSource = GHTTests.GHDataSources.DSDataTable();
                DataGrid3.DataBind();;
                GHTSubTestAddResult(((System.Web.UI.WebControls.BoundColumn)DataGrid3.Columns[0]).ReadOnly.ToString());
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTActiveSubTest = Ghtsubtest4;
            try
            {
                DataGrid4.DataSource = GHTTests.GHDataSources.DSDataTable();
                DataGrid4.DataBind();;
                GHTSubTestAddResult(((System.Web.UI.WebControls.BoundColumn)DataGrid4.Columns[0]).ReadOnly.ToString());
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }
        }
Beispiel #29
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            //Put user code to initialize the page here

            System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1");
            GHTTestBegin(frm);

            GHTActiveSubTest = GHTSubTest1;
            try
            {
                DataGrid1.DataSource = GHTTests.GHDataSources.DSDataTable();
                System.Web.UI.WebControls.BoundColumn c_id      = new System.Web.UI.WebControls.BoundColumn();
                System.Web.UI.WebControls.BoundColumn c_name    = new System.Web.UI.WebControls.BoundColumn();
                System.Web.UI.WebControls.BoundColumn c_company = new System.Web.UI.WebControls.BoundColumn();
                c_id.DataField      = "ID";
                c_name.DataField    = "Name";
                c_company.DataField = "Company";

                DataGrid1.Columns.Add(c_id);
                DataGrid1.Columns.Add(c_name);
                DataGrid1.Columns.Add(c_company);

                DataGrid1.DataBind();;

                GHTSubTestAddResult(c_id.DataField);
                GHTSubTestAddResult(c_name.DataField);
                GHTSubTestAddResult(c_company.DataField);
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTActiveSubTest = Ghtsubtest2;
            try
            {
                DataGrid2.DataSource = GHTTests.GHDataSources.DSDataTable();
                System.Web.UI.WebControls.BoundColumn c_empty = new System.Web.UI.WebControls.BoundColumn();
                c_empty.DataField = "";

                DataGrid2.Columns.Add(c_empty);
                DataGrid2.DataBind();;
                GHTSubTestAddResult(c_empty.DataField);
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTActiveSubTest = Ghtsubtest3;
            try
            {
                DataGrid3.DataSource = GHTTests.GHDataSources.DSDataTable();
                System.Web.UI.WebControls.BoundColumn c_ne = new System.Web.UI.WebControls.BoundColumn();
                c_ne.DataField = "NotExist";

                DataGrid3.Columns.Add(c_ne);
                DataGrid3.DataBind();;


                GHTSubTestAddResult(c_ne.DataField);
                GHTSubTestExpectedExceptionNotCaught("HttpException");
            }
            catch (HttpException eex)
            {
                GHTSubTestExpectedExceptionCaught(eex);
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTActiveSubTest = Ghtsubtest4;
            try
            {
                DataGrid4.DataSource = GHTTests.GHDataSources.DSDataTable();
                DataGrid4.DataBind();;
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTActiveSubTest = Ghtsubtest5;
            try
            {
                DataGrid5.DataSource = GHTTests.GHDataSources.DSDataTable();
                DataGrid5.DataBind();
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTActiveSubTest = Ghtsubtest6;
            try
            {
                DataGrid6.DataSource = GHTTests.GHDataSources.DSDataTable();
                DataGrid6.DataBind();
                GHTSubTestExpectedExceptionNotCaught("HttpException");
            }
            catch (HttpException eex)
            {
                GHTSubTestExpectedExceptionCaught(eex);
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTTestEnd();
        }
Beispiel #30
0
        private void DefineDGStructure()
        {
            int ObjectTypeId = int.Parse(pc["Subscription_ObjectType"]);
            DataTable source = SystemEvents.GetPersonalSubscriptionsDT(ObjectTypeId);

            // Data Grid definition
            grdMain.Columns.Clear();

            BoundColumn idCol = new BoundColumn();
            idCol.DataField = "EventTypeId";
            idCol.Visible = false;
            grdMain.Columns.Add(idCol);

            BoundColumn titleCol = new BoundColumn();
            titleCol.DataField = "Title";
            titleCol.HeaderStyle.CssClass = "ibn-vh2";
            titleCol.ItemStyle.CssClass = "ibn-vb2";
            titleCol.HeaderText = LocRM.GetString("SystemEvent");
            titleCol.ReadOnly = true;
            grdMain.Columns.Add(titleCol);

            foreach (DataColumn roleCol in source.Columns)
            {
                if (!roleCol.ColumnName.ToLower().StartsWith("role_"))
                    continue;

                TemplateColumn imageCol = new TemplateColumn();
                imageCol.HeaderStyle.Width = Unit.Pixel(75);
                imageCol.ItemStyle.Width = Unit.Pixel(75);
                imageCol.ItemTemplate = new DataGridImageTemplate(roleCol.ColumnName);
                imageCol.EditItemTemplate = new DataGridCheckBoxTemplate(roleCol.ColumnName);
                imageCol.HeaderStyle.CssClass = "ibn-vh3";
                imageCol.ItemStyle.CssClass = "ibn-vb2";
                imageCol.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
                imageCol.HeaderText = LocRM.GetString(roleCol.ColumnName + "_singular");
                grdMain.Columns.Add(imageCol);
            }

            TemplateColumn buttonCol = new TemplateColumn();
            buttonCol.HeaderStyle.Width = Unit.Pixel(50);
            buttonCol.ItemStyle.Width = Unit.Pixel(50);
            buttonCol.ItemTemplate = new DataGridActionsTemplate(LocRM.GetString("RestoreDefaults"), LocRM.GetString("Edit"));
            buttonCol.EditItemTemplate = new DataGridEditActionsTemplate(LocRM.GetString("Save"), LocRM.GetString("Cancel"));
            buttonCol.HeaderStyle.CssClass = "ibn-vh3";
            buttonCol.ItemStyle.CssClass = "ibn-vb2";
            buttonCol.HeaderText = "";
            grdMain.Columns.Add(buttonCol);

            BindData(source);
        }
Beispiel #31
0
    private void PopulateDisplayGrid(XmlConfigData xml_config_data)
    {
        Collection xml_data_logical_path = new Collection();
            xml_data_logical_path = (Collection)xml_config_data.LogicalPathComplete;
            System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "TITLE";
            colBound.ItemStyle.Width = 200;
            colBound.HeaderStyle.CssClass = "center";
            colBound.ItemStyle.CssClass = "right";
            colBound.HeaderText = m_refMsg.GetMessage("lbl xslt");
            DisplayGrid.Columns.Add(colBound);

            colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "VALUE";
            colBound.HeaderStyle.CssClass = "center";
            colBound.ItemStyle.CssClass = "left";
            colBound.HeaderText = m_refMsg.GetMessage("generic path");
            DisplayGrid.Columns.Add(colBound);

            colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "DEFAULT";
            colBound.ItemStyle.Width = 50;
            colBound.HeaderStyle.CssClass = "center";
            colBound.ItemStyle.CssClass = "center";
            colBound.HeaderText = m_refMsg.GetMessage("lbl default");
            DisplayGrid.Columns.Add(colBound);

            DataTable dt = new DataTable();
            DataRow dr;
            bool bValidDefaultXslt = false;
            dt.Columns.Add(new DataColumn("TITLE", typeof(string)));
            dt.Columns.Add(new DataColumn("VALUE", typeof(string)));
            dt.Columns.Add(new DataColumn("DEFAULT", typeof(string)));

            string defaultCheck = "<img alt=\"Default\" title=\"Default\" src=\"" + _ContentApi.ApplicationPath + "images/ui/icons/check.png\" />";

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("xslt 1 label");
            dr[2] = "&#160;";
            if (xml_config_data.DefaultXslt == "1")
            {
                if (xml_data_logical_path["Xslt1"].ToString() != "")
                {
                    bValidDefaultXslt = true;
                    dr[2] += defaultCheck;
                }
            }
            dr[1] = xml_data_logical_path["Xslt1"];
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("xslt 2 label");
            dr[2] = "&#160;";
            if (xml_config_data.DefaultXslt == "2")
            {
                if (xml_data_logical_path["Xslt2"].ToString() != "")
                {
                    bValidDefaultXslt = true;
                    dr[2] += defaultCheck;
                }
            }
            dr[1] = xml_data_logical_path["Xslt2"];
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("xslt 3 label");
            dr[2] = "&#160;";
            if (xml_config_data.DefaultXslt == "3")
            {
                if (xml_data_logical_path["Xslt3"].ToString() != "")
                {
                    bValidDefaultXslt = true;
                    dr[2] += defaultCheck;
                }
            }
            dr[1] = xml_data_logical_path["Xslt3"];
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("lbl XSLT packaged") + ":";
            dr[2] = "&#160;";
            if (xml_config_data.DefaultXslt == "0")
            {
                dr[2] += defaultCheck;
            }
            else
            {
                if (!(bValidDefaultXslt))
                {
                    dr[2] += defaultCheck;
                }
            }
            dr[1] = "&nbsp;";
            dt.Rows.Add(dr);

            if (xml_config_data.PackageXslt.Length > 0)
            {
                //dr = dt.NewRow
                //dr(0) = ""
                //dr(1) = "REMOVE-ITEM"
                //dt.Rows.Add(dr)

                h3Xpaths.InnerText = "XPaths";

                string xPaths = string.Empty;

                int counter = 1;
                foreach (object item in m_refContentApi.GetXPaths(xml_config_data.PackageXslt))
                {
                    xPaths += "<li" + (counter % 2 == 0 ? " class=\"stripe\">" : ">") + Convert.ToString(item) + "</li>";
                    counter++;
                }
                litXpaths.Text = xPaths;

                //dr = dt.NewRow
                //dr(0) = "XPaths:"
                //dr(2) = "&#160;"
                //Dim item As Object
                //dr(1) = ""
                //For Each item In m_refContentApi.GetXPaths(xml_config_data.PackageXslt)
                //    dr(1) += Convert.ToString(item) & "<br/>"
                //Next
                //dt.Rows.Add(dr)
            }
            DataView dv = new DataView(dt);
            DisplayGrid.DataSource = dv;
            DisplayGrid.DataBind();
    }
        private string LoadInformation(DataTable table)
        {
            DataGrid grid = new DataGrid();
            BoundColumn col;

            col = new BoundColumn();
            col.DataField = "Name";
            col.HeaderText = "Name";
            col.ItemStyle.CssClass = "name";
            col.ItemStyle.Width = new Unit(400);
            grid.Columns.Add(col);

            col = new BoundColumn();
            col.DataField = "Value";
            col.HeaderText = "Value";
            col.ItemStyle.CssClass = "value";
            col.ItemStyle.Width = new Unit(624);
            grid.Columns.Add(col);

            grid.AutoGenerateColumns = false;
            grid.HeaderStyle.CssClass = "header";
            grid.DataSource = new DataView(table);
            grid.DataBind();

            foreach (DataGridItem item in grid.Items)
            {
                if (item.Cells.Count == 2)
                {
                    TableCell cell = item.Cells[1];
                    //  change true/false style
                    switch (cell.Text.ToLower())
                    {
                        case "true":
                            cell.CssClass = "value_true";
                            break;

                        case "false":
                            cell.CssClass = "value_false";
                            break;
                    }

                    ////  wrap <pre> for text contain newline.
                    //if (cell.Text.IndexOf(Environment.NewLine) >= 0)
                    //{
                    //    cell.Wrap = true;
                    //    cell.Text = string.Format("{0}", cell.Text);
                    //}
                }
            }

            HtmlGenericControl title = new HtmlGenericControl("h1");
            title.InnerText = _context.Server.HtmlEncode(table.TableName);
            title.Attributes.Add("class", "title");

            HtmlGenericControl div = new HtmlGenericControl("div");
            div.Attributes.Add("class", "section");
            div.Controls.Add(new HtmlGenericControl("p"));
            div.Controls.Add(title);
            div.Controls.Add(grid);
            div.Controls.Add(new HtmlGenericControl("p"));

            StringBuilder generatedHtml = new StringBuilder();
            HtmlTextWriter htw = new HtmlTextWriter(new StringWriter(generatedHtml));
            div.RenderControl(htw);
            string output = generatedHtml.ToString();
            return output;
            //divCenter.Controls.Add(div);
        }
Beispiel #33
0
    private void PopulatePropertiesGrid(XmlConfigData xml_config_data, long entryId, string subscriptionProvider)
    {
        Collection xml_data_logical_path = new Collection();
            xml_data_logical_path = (Collection)xml_config_data.LogicalPathComplete;
            System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "TITLE";
            colBound.ItemStyle.CssClass = "label";
            PropertiesGrid.Columns.Add(colBound);

            colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "VALUE";
            PropertiesGrid.Columns.Add(colBound);

            DataTable dt = new DataTable();
            DataRow dr;
            dt.Columns.Add(new DataColumn("TITLE", typeof(string)));
            dt.Columns.Add(new DataColumn("VALUE", typeof(string)));

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("generic title label");
            dr[1] = xml_config_data.Title;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("id label");
            dr[1] = xml_config_data.Id;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("lbl product type class");
            dr[1] = Util_ShowType(entryId);
            dt.Rows.Add(dr);

            if (entryId == Convert.ToInt64(EkEnumeration.CatalogEntryType.SubscriptionProduct))
            {
                dr = dt.NewRow();
                dr[0] = m_refMsg.GetMessage("lbl commerce subscription provider");
                dr[1] = subscriptionProvider;
                dt.Rows.Add(dr);
            }

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("description label");
            dr[1] = xml_config_data.Description;
            dt.Rows.Add(dr);

            if (xml_config_data.PackageDisplayXslt.Length > 0)
            {
                //dr = dt.NewRow
                //dr(0) = ""
                //dr(1) = "REMOVE-ITEM"
                //dt.Rows.Add(dr)
            }
            else
            {

                StringBuilder sb = new StringBuilder();
                dr = dt.NewRow();
                dr[0] = m_refMsg.GetMessage("editor info label");
                sb.Append(" <div class=\"innerTable\">");
                sb.Append("     <table>");
                sb.Append("         <tbody>");
                sb.Append("             <tr>");
                sb.Append("                 <th>" + m_refMsg.GetMessage("edit xslt label") + "</th>");
                sb.Append("                 <td>" + ((xml_data_logical_path["EditXslt"].ToString() == string.Empty) ? "-" : (xml_data_logical_path["EditXslt"])) + "</td>");
                sb.Append("             </tr>");
                sb.Append("             <tr>");
                sb.Append("                 <th>" + m_refMsg.GetMessage("save xslt label") + "</th>");
                sb.Append("                 <td>" + ((xml_data_logical_path["SaveXslt"].ToString() == string.Empty) ? "-" : (xml_data_logical_path["SaveXslt"])) + "</td>");
                sb.Append("             </tr>");
                sb.Append("             <tr>");
                sb.Append("                 <th>" + m_refMsg.GetMessage("advanced config label") + "</th>");
                sb.Append("                 <td>" + ((xml_data_logical_path["XmlAdvConfig"].ToString() == string.Empty) ? "-" : (xml_data_logical_path["XmlAdvConfig"])) + "</td>");
                sb.Append("             </tr>");
                sb.Append("         </tbody>");
                sb.Append("     </table>");
                sb.Append(" </div>");

                dr[1] = sb.ToString();
                dt.Rows.Add(dr);

                dr = dt.NewRow();
                dr[0] = m_refMsg.GetMessage("validation info label");

                sb = new StringBuilder();
                sb.Append(" <div class=\"innerTable\">");
                sb.Append("     <table");
                sb.Append("         <tbody>");
                sb.Append("             <tr>");
                sb.Append("                 <th>" + m_refMsg.GetMessage("xml schema label") + "</th>");
                sb.Append("                 <td>" + ((xml_data_logical_path["XmlSchema"].ToString() == string.Empty) ? "-" : (xml_data_logical_path["XmlSchema"])) + "</td>");
                sb.Append("             </tr>");
                sb.Append("             <tr>");
                sb.Append("                 <th>" + m_refMsg.GetMessage("target namespace label") + "</th>");
                sb.Append("                 <td>" + ((xml_data_logical_path["XmlNameSpace"].ToString() == string.Empty) ? "-" : (xml_data_logical_path["XmlNameSpace"])) + "</td>");
                sb.Append("             </tr>");
                sb.Append("         </tbody>");
                sb.Append("     </table>");
                sb.Append(" </div>");

                dr[1] = sb.ToString();
                dt.Rows.Add(dr);

            }

            DataView dv = new DataView(dt);
            PropertiesGrid.DataSource = dv;
            PropertiesGrid.DataBind();
    }
Beispiel #34
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            //Put user code to initialize the page here

            System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1");
            GHTTestBegin(frm);

            GHTActiveSubTest = GHTSubTest1;
            try
            {
                DataGrid1.DataSource = GHTTests.GHDataSources.DSDataTable();
                System.Web.UI.WebControls.EditCommandColumn c_edit    = new System.Web.UI.WebControls.EditCommandColumn();
                System.Web.UI.WebControls.BoundColumn       c_company = new System.Web.UI.WebControls.BoundColumn();
                c_edit.EditText     = "edit this row";
                c_edit.CancelText   = "";
                c_edit.ButtonType   = ButtonColumnType.LinkButton;
                c_company.DataField = "Company";

                DataGrid1.Columns.Add(c_edit);
                DataGrid1.Columns.Add(c_company);
                DataGrid1.EditItemIndex = 2;
                DataGrid1.DataBind();;
                GHTSubTestAddResult(c_edit.CancelText);
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTActiveSubTest = Ghtsubtest2;
            try
            {
                DataGrid2.DataSource = GHTTests.GHDataSources.DSDataTable();
                System.Web.UI.WebControls.EditCommandColumn c_edit    = new System.Web.UI.WebControls.EditCommandColumn();
                System.Web.UI.WebControls.BoundColumn       c_company = new System.Web.UI.WebControls.BoundColumn();
                c_edit.EditText     = "edit this row";
                c_edit.CancelText   = "cancel edit this row";
                c_company.DataField = "Company";

                DataGrid2.Columns.Add(c_edit);
                DataGrid2.Columns.Add(c_company);
                DataGrid2.EditItemIndex = 2;
                DataGrid2.DataBind();;
                GHTSubTestAddResult(c_edit.CancelText);
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTActiveSubTest = Ghtsubtest3;
            try
            {
                DataGrid3.DataSource = GHTTests.GHDataSources.DSDataTable();
                System.Web.UI.WebControls.EditCommandColumn c_edit    = new System.Web.UI.WebControls.EditCommandColumn();
                System.Web.UI.WebControls.BoundColumn       c_company = new System.Web.UI.WebControls.BoundColumn();
                c_edit.EditText     = "edit this row";
                c_edit.CancelText   = "cancel text with !@#$%^&*()_+_+";
                c_company.DataField = "Company";

                DataGrid3.Columns.Add(c_edit);
                DataGrid3.Columns.Add(c_company);
                DataGrid3.EditItemIndex = 2;
                DataGrid3.DataBind();;
                GHTSubTestAddResult(c_edit.CancelText);
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTActiveSubTest = Ghtsubtest4;
            try
            {
                DataGrid4.DataSource    = GHTTests.GHDataSources.DSDataTable();
                DataGrid4.EditItemIndex = 2;
                DataGrid4.DataBind();;
                GHTSubTestAddResult(((System.Web.UI.WebControls.EditCommandColumn)DataGrid4.Columns[0]).CancelText);
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTActiveSubTest = Ghtsubtest5;
            try
            {
                DataGrid5.DataSource    = GHTTests.GHDataSources.DSDataTable();
                DataGrid5.EditItemIndex = 2;
                DataGrid5.DataBind();
                GHTSubTestAddResult(((System.Web.UI.WebControls.EditCommandColumn)DataGrid5.Columns[0]).CancelText);
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTActiveSubTest = Ghtsubtest6;
            try
            {
                DataGrid6.DataSource    = GHTTests.GHDataSources.DSDataTable();
                DataGrid6.EditItemIndex = 2;
                DataGrid6.DataBind();
                GHTSubTestAddResult(((System.Web.UI.WebControls.EditCommandColumn)DataGrid6.Columns[0]).CancelText);
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTTestEnd();
        }
Beispiel #35
0
    private void AddUserGroupGrid_None()
    {
        System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "GROUPTITLE";
        colBound.HeaderText = m_refMsg.GetMessage("active directory group title");
        colBound.HeaderStyle.CssClass = "title-header";
        colBound.ItemStyle.Wrap = false;
        AddGroupGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "DOMAINTITLE";
        colBound.HeaderText = m_refMsg.GetMessage("domain title");
        colBound.ItemStyle.Wrap = false;
        colBound.HeaderStyle.CssClass = "title-header";
        AddGroupGrid.Columns.Add(colBound);

        DataTable dt = new DataTable();
        DataRow dr;
        dt.Columns.Add(new DataColumn("GROUPTITLE", typeof(string)));
        dt.Columns.Add(new DataColumn("DOMAINTITLE", typeof(string)));

        dr = dt.NewRow();
        int i;
        dr[0] = "<input type=\"Text\" name=\"groupname\" maxlength=\"255\" size=\"25\" onkeypress=\"return CheckKeyValue(event,\'34\');\">";
        dr[1] = "<select name=\"domainname\">";
        if (!(domain_list == null))
        {
            if (m_refContentApi.RequestInformationRef.ADAdvancedConfig == false)
            {
                dr[1] += "<option selected value=\"All Domains\">" + m_refMsg.GetMessage("all domain select caption") + "</option>";
            }
            for (i = 0; i <= domain_list.Length - 1; i++)
            {
                dr[1] += "<option value=\"" + domain_list[i].Name + "\">" + domain_list[i].Name + "</option>";
            }
        }
        dr[1] += "</select>";
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr[0] = "<input type=\"submit\" name=\"search\" value=\"" + m_refMsg.GetMessage("generic Search") + "\">";
        dr[1] = "";
        dt.Rows.Add(dr);
        DataView dv = new DataView(dt);
        AddGroupGrid.DataSource = dv;
        AddGroupGrid.DataBind();
    }
Beispiel #36
0
    private void Populate_CustomRoleListingGrid(bool bShowCheckBox)
    {
        DataTable dt = new DataTable();
            int idx;
            string strName;
            long nId;
            string strDesc;
            System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();

            colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "CUSTOM_ROLE_NAME";
            colBound.HeaderText = "Custom Role Name";
            colBound.ItemStyle.Wrap = false;
            colBound.HeaderStyle.CssClass = "title-header";
            colBound.HeaderStyle.HorizontalAlign = HorizontalAlign.Left;
            colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
            CustomRoleListingGrid.Columns.Add(colBound);

            dt = new DataTable();
            DataRow dr;
            string strNameId;
            dt.Columns.Add(new DataColumn("CUSTOM_ROLE_NAME", typeof(string)));

            if ((m_UserRolePermissionData != null) && (m_UserRolePermissionData.GetLength(0) > 0))
            {

                for (idx = 1; idx <= m_UserRolePermissionData.GetLength(0) - 1; idx++)
                {
                    strName = m_UserRolePermissionData[idx].RolePermissionName;
                    nId = m_UserRolePermissionData[idx].RolePermissionId;
                    strDesc = m_UserRolePermissionData[idx].RolePermissionDescription;

                    //strTypeIcon = IIf(m_RoleMembers(idx).MemberType = RoleMemberData.RoleMemberType.User, "user.png", "users.png")
                    dr = dt.NewRow();
                    //dr(0) = IIf(bShowCheckBox, "<input type=""checkbox"" name=""frm_fixme"" id=""frm_fixme"">&nbsp;", "")
                    if (bShowCheckBox)
                    {
                        strNameId = (string) ("member_user_id" + EkFunctions.HtmlEncode(strName));
                        dr[0] = "&nbsp;<input type=\"checkbox\" name=\"" + strNameId + "\" id=\"" + strNameId + "\">&nbsp;" + EkFunctions.HtmlEncode(strName);
                    }
                    else
                    {
                        dr[0] = "&nbsp;<a href=\"roles.aspx?action=custompermissions&LangType=" + ContentLanguage + "&id=" + nId + "&name=" + EkFunctions.HtmlEncode(strName) + "\" title=\'" + "Manage Custom Role Members" + "\' onclick=\"return;\">" + AntiXss.HtmlEncode(strName) + "</a>";
                    }
                    dt.Rows.Add(dr);
                }

            }

            DataView dv = new DataView(dt);
            CustomRoleListingGrid.DataSource = dv;
            CustomRoleListingGrid.DataBind();
    }
Beispiel #37
0
    private void Populate_AddUserToGroupGrid()
    {
        string HeaderText = "<a href=\"users.aspx?action=AddUserToGroup&OrderBy={0}&grouptype=" + m_intGroupType + "&LangType=" + ContentLanguage + "&id=" + uId + "\" title=\"" + m_refMsg.GetMessage("click to sort msg") + "\">{1}</a>";
        string Icon = "user.png";
        System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
        if (m_intGroupType == 1)
        {
            Icon = "userMembership.png";
        }
        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "CHECK";
        colBound.HeaderText = "<input type=checkbox name=checkall id=checkall onclick=\"checkAll(\'\');\">";
        colBound.HeaderStyle.CssClass = "title-header";
        colBound.ItemStyle.Wrap = false;
        colBound.HeaderStyle.Width = Unit.Percentage(5);
        colBound.ItemStyle.Width = Unit.Percentage(5);
        AddGroupGrid.Columns.Add(colBound);
        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "USERNAME";
        colBound.HeaderText = string.Format(HeaderText, "user_name", m_refMsg.GetMessage("generic username"));
        colBound.HeaderStyle.CssClass = "title-header";
        colBound.ItemStyle.Wrap = false;
        AddGroupGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "LASTNAME";
        colBound.HeaderText = string.Format(HeaderText, "last_name", m_refMsg.GetMessage("generic lastname"));
        colBound.ItemStyle.Wrap = false;
        colBound.HeaderStyle.CssClass = "title-header";
        AddGroupGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "FIRSTNAME";
        colBound.HeaderText = string.Format(HeaderText, "first_name", m_refMsg.GetMessage("generic firstname"));
        colBound.ItemStyle.Wrap = false;
        colBound.HeaderStyle.CssClass = "title-header";
        AddGroupGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "LANGUAGE";
        colBound.HeaderText = m_refMsg.GetMessage("generic Language");
        colBound.ItemStyle.Wrap = false;
        colBound.HeaderStyle.CssClass = "title-header";
        AddGroupGrid.Columns.Add(colBound);

        DataTable dt = new DataTable();
        DataRow dr;
        dt.Columns.Add(new DataColumn("CHECK", typeof(string)));
        dt.Columns.Add(new DataColumn("USERNAME", typeof(string)));
        dt.Columns.Add(new DataColumn("LASTNAME", typeof(string)));
        dt.Columns.Add(new DataColumn("FIRSTNAME", typeof(string)));
        dt.Columns.Add(new DataColumn("LANGUAGE", typeof(string)));
        PageSettings();
        int i;
        if (!(user_list == null))
        {
            for (i = 0; i <= user_list.Length - 1; i++)
            {
                dr = dt.NewRow();
                dr["CHECK"] = "<input type=\"checkbox\" name=\"selected_users\" id=\"selected_users\" value=\"" + user_list[i].Id + "\" onclick=\"checkAll(\'selected_users\');\">";
                dr["USERNAME"] = "******"" + AppImgPath + "../UI/Icons/" + Icon + "\" border=\"0\" align=\"absbottom\">" + user_list[i].Username + "</img>";
                dr["LASTNAME"] = user_list[i].LastName;
                dr["FIRSTNAME"] = user_list[i].FirstName;
                if (user_list[i].LanguageId == 0)
                {
                    dr["LANGUAGE"] = m_refMsg.GetMessage("app default msg");
                }
                else
                {
                    dr["LANGUAGE"] = user_list[i].LanguageName;
                }
                dt.Rows.Add(dr);
            }
        }

        DataView dv = new DataView(dt);
        AddGroupGrid.DataSource = dv;
        AddGroupGrid.DataBind();
    }
Beispiel #38
0
    private void Populate_AddApprovals(ApprovalData[] approval_data)
    {
        System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "TITLE";
            colBound.HeaderText = m_refMsg.GetMessage("user or group name title");
            colBound.ItemStyle.Wrap = false;
            colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
            colBound.HeaderStyle.CssClass = "title-header";
            AddApprovalsGrid.Columns.Add(colBound);

            colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "ID";
            colBound.HeaderText = m_refMsg.GetMessage("generic ID");
            colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
            colBound.HeaderStyle.CssClass = "title-header";
            colBound.ItemStyle.Wrap = false;
            AddApprovalsGrid.Columns.Add(colBound);

            AddApprovalsGrid.BorderColor = System.Drawing.Color.White;

            DataTable dt = new DataTable();
            DataRow dr;

            dt.Columns.Add(new DataColumn("TITLE", typeof(string)));
            dt.Columns.Add(new DataColumn("ID", typeof(string)));

            bool bInherited = false;
            if (ItemType == "folder")
            {
                bInherited = folder_data.Inherited;
            }
            else
            {
                bInherited = content_data.IsInherited;
            }
            int i;
            if (!(approval_data == null))
            {
                for (i = 0; i <= approval_data.Length - 1; i++)
                {
                    dr = dt.NewRow();
                    if (approval_data[i].UserId != 0)
                    {
                        dr[0] = "<a href=\"content.aspx?LangType=" + ContentLanguage + "&action=DoAddItemApproval&item_id=" + approval_data[i].UserId + "&base=user&id=" + m_intId + "&type=" + ItemType + "\" title=\"" + m_refMsg.GetMessage("alt add button text (user approvals)") + "\" OnClick=\"javascript:return CheckApprovalAddition(\'user\');\">";
                        dr[0] += "<img class=\"imgUsers\" src=\"" + m_refContentApi.AppPath + "images/UI/Icons/user.png\" align=\"absbottom\" alt=\"" + m_refMsg.GetMessage("alt add button text (user approvals)") + "\" title=\"" + m_refMsg.GetMessage("alt add button text (user approvals)") + "\"/>" + approval_data[i].DisplayUserName + "</a>";
                        dr[1] = approval_data[i].UserId;
                    }
                    else
                    {

                        if (approval_data[i].GroupId != 0)
                        {
                            dr[0] = "<a href=\"content.aspx?LangType=" + ContentLanguage + "&action=DoAddItemApproval&item_id=" + approval_data[i].GroupId + "&base=group&id=" + m_intId + "&type=" + ItemType + "\" title=\"" + m_refMsg.GetMessage("alt add button text (usergroup approvals)") + "\" OnClick=\"javascript:return CheckApprovalAddition(\'group\');\">";
                            dr[0] += "<img class=\"imgUsers\" src=\"" + m_refContentApi.AppPath + "images/UI/Icons/users.png\" align=\"absbottom\" alt=\"" + m_refMsg.GetMessage("alt add button text (usergroup approvals)") + "\" title=\"" + m_refMsg.GetMessage("alt add button text (usergroup approvals)") + "\"/>" + approval_data[i].DisplayUserGroupName + "</a>";
                            dr[1] = approval_data[i].GroupId;
                        }
                    }
                    dt.Rows.Add(dr);
                }
            }

            DataView dv = new DataView(dt);
            AddApprovalsGrid.DataSource = dv;
            AddApprovalsGrid.DataBind();
    }