<table style="width:100%;"> <tr> <td class="style9"> Basic information </td> <td class="style7"> </td> <td class="style6"> </td> <td> </td> </tr> <tr> <td class="style4"> </td> <td class="style7"> </td> <td class="style6"> </td> <td> </td> </tr> <tr> <td class="style4"> Name :</td> <td class="style7"> <telerik:RadTextBox ID="RadTextBox1" Runat="server"> </telerik:RadTextBox> </td> <td class="style6"> Departement :</td> <td> <telerik:RadComboBox ID="RadComboBox2" Runat="server" DataSourceID="SqlDataSource2" DataTextField="U_Dep" Width="200px"> </telerik:RadComboBox> </td> </tr> <tr> <td class="style4"> Title :</td> <td class="style7"> <telerik:RadComboBox ID="RadComboBox1" Runat="server" DataSourceID="SqlDataSource1" DataTextField="U_Title" DataValueField="U_Title" Width="230px"> </telerik:RadComboBox> </td> <td class="style6"> Internal Mail : </td> <td> <telerik:RadTextBox ID="RadTextBox4" Runat="server"> </telerik:RadTextBox> </td> </tr> <tr> <td class="style4"> Manager Name :</td> <td class="style7"> <telerik:RadComboBox ID="RadComboBox3" Runat="server" DataSourceID="SqlDataSource4" DataTextField="U_Manger_Name" DataValueField="U_Manger_Name"> </telerik:RadComboBox> </td> <td class="style6"> Manager Internal Mail :</td> <td> <telerik:RadTextBox ID="RadTextBox13" Runat="server"> </telerik:RadTextBox> </td> </tr> <tr> <td class="style5"> System Password :</td> <td class="style7"> <telerik:RadTextBox ID="RadTextBox2" Runat="server"> </telerik:RadTextBox> </td> <td class="style6"> Region :</td> <td> <telerik:RadComboBox ID="RadComboBox4" Runat="server" DataSourceID="SqlDataSource3" DataTextField="U_Region" DataValueField="U_Region"> </telerik:RadComboBox> </td> </tr> <tr> <td class="style5"> Work Mobile Number :</td> <td class="style7"> <telerik:RadTextBox ID="RadTextBox3" Runat="server"> </telerik:RadTextBox> </td> <td class="style6"> </td> <td> </td> </tr> <tr> <td class="style5"> </td> <td class="style7"> </td> <td class="style6"> </td> <td> </td> </tr> <tr> <td class="style8"> Personal Information </td> <td class="style7"> </td> <td class="style6"> </td> <td> </td> </tr> <tr> <td class="style5"> </td> <td class="style7"> </td> <td class="style6"> </td> <td> </td> </tr> <tr> <td class="style5"> National ID Number :</td> <td class="style7"> <telerik:RadTextBox ID="RadTextBox6" Runat="server"> </telerik:RadTextBox> </td> <td class="style6"> National ID Expire Date :</td> <td> <telerik:RadDatePicker ID="RadDatePicker1" Runat="server"> </telerik:RadDatePicker> </td> </tr> <tr> <td class="style5"> Address :</td> <td class="style7"> <telerik:RadTextBox ID="RadTextBox7" Runat="server"> </telerik:RadTextBox> </td> <td class="style6"> Sex :</td> <td> <telerik:RadComboBox ID="RadComboBox6" Runat="server"> <Items> <telerik:RadComboBoxItem runat="server" Text="Male" Value="Male" /> <telerik:RadComboBoxItem runat="server" Text="Female" Value="Female" /> </Items> </telerik:RadComboBox> </td> </tr> <tr> <td class="style5"> Marital Status :</td> <td class="style7"> <telerik:RadComboBox ID="RadComboBox5" Runat="server"> <Items> <telerik:RadComboBoxItem runat="server" Text="Single" Value="Single" /> <telerik:RadComboBoxItem runat="server" Text="Married" Value="Married" /> <telerik:RadComboBoxItem runat="server" Text="Divorced" Value="Divorced" /> <telerik:RadComboBoxItem runat="server" Text="Widowed" Value="Widowed" /> </Items> </telerik:RadComboBox> </td> <td class="style6"> Private Mobile Number :</td> <td> <telerik:RadTextBox ID="RadTextBox8" Runat="server"> </telerik:RadTextBox> </td> </tr> <tr> <td class="style5"> Picture : </td> <td class="style7"> <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server"> </telerik:RadAsyncUpload> </td> <td class="style6"> </td> <td> </td> </tr> <tr> <td class="style8"> </td> <td class="style7"> </td> <td class="style6"> </td> <td> </td> </tr> <tr> <td class="style8"> HR Information :</td> <td class="style7"> </td> <td class="style6"> </td> <td> </td> </tr> <tr> <td class="style5"> </td> <td class="style7"> </td> <td class="style6"> </td> <td> </td> </tr> <tr> <td class="style5"> Start Date :</td> <td class="style7"> <telerik:RadDatePicker ID="RadDatePicker2" Runat="server"> </telerik:RadDatePicker> </td> <td class="style6"> Status :</td> <td> <telerik:RadComboBox ID="RadComboBox7" Runat="server"> <Items> <telerik:RadComboBoxItem runat="server" Text="Normal user" Value="Normal user" /> <telerik:RadComboBoxItem runat="server" Text="Admin" Value="Admin" /> </Items> </telerik:RadComboBox> </td> </tr> <tr> <td class="style5"> Insurance Number :</td> <td class="style7"> <telerik:RadTextBox ID="RadTextBox9" Runat="server"> </telerik:RadTextBox> </td> <td class="style6"> Insurance Date :</td> <td> <telerik:RadDatePicker ID="RadDatePicker3" Runat="server"> </telerik:RadDatePicker> </td> </tr> <tr> <td class="style5"> Annual Vacation Balance :</td> <td class="style7"> <telerik:RadTextBox ID="RadTextBox10" Runat="server"> </telerik:RadTextBox> </td> <td class="style6"> Incident Vacation Balance :</td> <td> <telerik:RadTextBox ID="RadTextBox12" Runat="server"> </telerik:RadTextBox> </td> </tr> <tr> <td class="style5"> Day Off :</td> <td class="style7"> <telerik:RadComboBox ID="RadComboBox8" Runat="server"> <Items> <telerik:RadComboBoxItem runat="server" Text="Saturday" Value="Saturday" /> <telerik:RadComboBoxItem runat="server" Text="Sunday" Value="Sunday" /> <telerik:RadComboBoxItem runat="server" Text="Monday" Value="Monday" /> <telerik:RadComboBoxItem runat="server" Text="Tuesday" Value="Tuesday" /> <telerik:RadComboBoxItem runat="server" Text="Wednesday" Value="Wednesday" /> <telerik:RadComboBoxItem runat="server" Text="Thursday" Value="Thursday" /> <telerik:RadComboBoxItem runat="server" Text="Friday" Value="Friday" /> </Items> </telerik:RadComboBox> </td> <td class="style6"> </td> <td> </td> </tr> <tr> <td class="style5"> Qualifications : </td> <td class="style7"> <telerik:RadTextBox ID="RadTextBox11" Runat="server"> </telerik:RadTextBox> </td> <td class="style6"> </td> <td> </td> </tr> <tr> <td class="style5"> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT DISTINCT [U_Title] FROM [Users] ORDER BY [U_Title]"> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT DISTINCT [U_Dep] FROM [Users] ORDER BY [U_Dep]"> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT DISTINCT [U_Region] FROM [Users] ORDER BY [U_Region]"> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT DISTINCT [U_Manger_Name] FROM [Users] ORDER BY [U_Manger_Name]"> </asp:SqlDataSource> </td> <td class="style7"> <asp:Button ID="Button1" runat="server" onclick="Button1_Click1" style="width: 56px" Text="Button" /> </td> <td class="style6"> <telerik:RadTextBox ID="RadTextBox14" Runat="server"> </telerik:RadTextBox> </td> <td> </td> </tr> </table>const int MaxTotalBytes = 1048576; int totalBytes;public bool? IsRadAsyncValid{ get { if (Session["IsRadAsyncValid"] == null) { Session["IsRadAsyncValid"] = true; } return Convert.ToBoolean(Session["IsRadAsyncValid"].ToString()); } set { Session["IsRadAsyncValid"] = value; }}public static string ConnectionString{ get { return ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; }}protected override void OnLoad(EventArgs e){ base.OnLoad(e); IsRadAsyncValid = null;}protected void Button1_Click1(object sender, EventArgs e){ if (!IsRadAsyncValid.Value) { Response.Write("The length of the uploaded file must be less than 1 MB"); return; } using (SqlConnection conn = new SqlConnection(ConnectionString)) { conn.Open(); SqlCommand cmd = new SqlCommand("INSERT INTO [Users] ([U_Name], [U_Dep], [U_Title], [U_Internal_Mail], [U_Password], [U_Region], [U_Manger_Mail], [U_Manger_Name], [U_Status], [U_Week_End], [U_Balance], [U_Incednt], [Image], [Personal_ID], [ID_Expire_Date], [Sex], [Insurance_Number], [Insurance_Date], [Address], [Marital_Status], [Qualifications], [Work_Mobile_Number], [Private_Mobile_Number], [U_Start_Date]) VALUES (@U_Name, @U_Dep, @U_Title, @U_Internal_Mail, @U_Password, @U_Region, @U_Manger_Mail, @U_Manger_Name, @U_Status, @U_Week_End, @U_Balance, @U_Incednt, @Image, @Personal_ID, @ID_Expire_Date, @Sex, @Insurance_Number, @Insurance_Date, @Address, @Marital_Status, @Qualifications, @Work_Mobile_Number, @Private_Mobile_Number, @U_Start_Date)", conn); cmd.Parameters.AddWithValue("@U_Name", RadTextBox1.Text); cmd.Parameters.AddWithValue("@U_Dep", RadComboBox2.Text); cmd.Parameters.AddWithValue("@U_Title", RadComboBox1.Text); cmd.Parameters.AddWithValue("@U_Internal_Mail",RadTextBox4.Text ); cmd.Parameters.AddWithValue("@U_Password",RadTextBox2.Text); cmd.Parameters.AddWithValue("@U_Region",RadComboBox4.Text ); cmd.Parameters.AddWithValue("@U_Manger_Mail",RadTextBox13.Text ); cmd.Parameters.AddWithValue("@U_Manger_Name",RadComboBox3.Text ); cmd.Parameters.AddWithValue("@U_Status",RadComboBox7.Text ); cmd.Parameters.AddWithValue("@U_Week_End", RadComboBox8.Text); cmd.Parameters.AddWithValue("@U_Balance",RadTextBox10.Text); cmd.Parameters.AddWithValue("@U_Incednt", RadTextBox12.Text); cmd.Parameters.AddWithValue("@Personal_ID", RadTextBox6.Text); cmd.Parameters.AddWithValue("@ID_Expire_Date", RadDatePicker1.SelectedDate); cmd.Parameters.AddWithValue("@Sex", RadComboBox6.Text); cmd.Parameters.AddWithValue("@Insurance_Number",RadTextBox9.Text); cmd.Parameters.AddWithValue("@Insurance_Date", RadDatePicker3.SelectedDate); cmd.Parameters.AddWithValue("@Address", RadTextBox7.Text); cmd.Parameters.AddWithValue("@Marital_Status", RadComboBox5.Text); cmd.Parameters.AddWithValue("@Qualifications", RadTextBox11.Text); cmd.Parameters.AddWithValue("@Work_Mobile_Number",RadTextBox3.Text); cmd.Parameters.AddWithValue("@Private_Mobile_Number",RadTextBox8.Text); cmd.Parameters.AddWithValue("@U_Start_Date", RadDatePicker2.SelectedDate); cmd.Parameters.AddWithValue("@Image", RadAsyncUpload1); cmd.ExecuteScalar(); }}
public partial class CustomFeedUserControl : UserControl { private const string ActivityName = "ActivityName"; private const string SiteName = "SiteName"; private const string Date = "Date"; private const string ActivitySummary = "ActivitySummary"; private DataTable sitedetailstable; private ActivityManager activityManager; private ActivityEventsCollection activityEvents; private Boolean error = false; private string errorText = ""; SyndicationItem syndicationItem; List<String> categories = new List<string>(); SPWebApplication webapp = SPContext.Current.Site.WebApplication; private String Email = ""; protected void Page_Load(object sender, EventArgs e) { //if (!Page.IsPostBack) Nothing here as i am creating the grid ondemand //{ // LoadData(); // RadGridSiteDetails.Visible = false; //} } void LoadData() { RadGridSiteDetails.DataSource = Sitedetailstable.DefaultView; } public void LoadDatasource(String userloginname) { string siteUrl = SPContext.Current.Site.Url; SPSecurity.RunWithElevatedPrivileges(delegate { using (SPSite site = new SPSite(siteUrl)) { try { SPServiceContext context = SPServiceContext.GetContext(site); UserProfileManager userProfileManager = new UserProfileManager(context); UserProfile profile = userProfileManager.GetUserProfile(userloginname); if (profile != null) { test.Text = profile.DisplayName; this.activityManager = new ActivityManager(profile); this.activityEvents = this.activityManager.GetActivitiesByUser(profile); } } catch (UserNotFoundException ex) { this.error = true; this.errorText = ex.Message; } catch (NullReferenceException ex) { this.error = true; this.errorText = ex.Message; } } }); } private DataTable ReturnUserDatadetails( ) { sitedetailstable = new DataTable(); string sitetitle = null; string summary; sitedetailstable.Columns.Add(ActivityName, System.Type.GetType("System.String")); sitedetailstable.Columns.Add(SiteName, System.Type.GetType("System.String")); sitedetailstable.Columns.Add(Date, System.Type.GetType("System.String")); sitedetailstable.Columns.Add(ActivitySummary, System.Type.GetType("System.String")); if (this.activityEvents.Count > 0) { foreach (ActivityEvent activityEvent in this.activityEvents) { syndicationItem = activityEvent.CreateSyndicationItem(this.activityManager.ActivityTypes, ContentType.Html); Sitetitle = syndicationItem.Summary.Text.ToString(); summary = Regex.Replace(syndicationItem.Summary.Text; if ((Sitetitle != null) && (Sitetitle != "")) { DataRow newrow = Sitedetailstable.NewRow(); newrow[ActivityName] = activityEvent.Name; newrow[SiteName] = Sitetitle; newrow[Date] = activityEvent.PublishDate.HasValue ? activityEvent.PublishDate.Value.ToLocalTime().ToString("dd MMM yyyy hh:mm tt") : string.Empty; newrow[ActivitySummary] = summary.Substring(summary.IndexOf(":") + 1); categories.Add(activityEvent.Name.ToString()); Sitedetailstable.Rows.Add(newrow); } } } return Sitedetailstable; } protected void RadGridSiteDetails_SortCommand(object sender, Telerik.Web.UI.GridSortCommandEventArgs e) { LoadData(); } // this is the button event that gets clicked from the user to generate reporty protected void UserReport_Click(object sender, EventArgs e) { Email = UserEmailInput.Text; SPPrincipalInfo user = SPUtility.ResolvePrincipal(webapp, null, Email, SPPrincipalType.User, SPPrincipalSource.All, true); if (user != null) { LoadDatasource(user.LoginName); LoadData(); RadGridSiteDetails.Visible = true; } else { test.Text = "No user Found with that Email Address"; } } protected void RadGridSiteDetails_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e) { LoadData(); } }using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using Telerik.Web.UI;using System.Data; namespace Project1{ public partial class frmUserGroupPrivillage : System.Web.UI.Page { private DataTable table; private bool displayNullDataSourceErrorMessage = false; // enable error message to // be hidden the first time the page is loaded private string groupID, groupName; protected void Page_Load(object sender, EventArgs e) { // reset error and status messages' visibility errorMessage.Visible = false; statusMessage.Visible = false; //get module authorization for the logged in user Authorization a = new Authorization(); bool[] authorization = a.GetModuleAuthorization(userID, "UserGroupPrivilege"); if (authorization != null) { // is the user is allowed to view this page? if (authorization[0]) { //the user is allowed to view this page DisplayUserContent(authorization); } else { // the user is not allowed to view this page. //Hence redirect user to main page Response.Redirect("Default.aspx"); } } else { //unable to get authorization information errorMessage.Text = a.authorizationErrorMessage; errorMessage.Visible = true; } } //Post: display or not display add, edit and delete buttons based on user's // privilege level private void DisplayUserContent(bool[] authorization) { // should update button inside edit form to be be displayed? if (authorization[2]) { GridColumn editColumn = RadGrid1.Columns.FindByUniqueName("EditCommandColumn"); editColumn.Visible = true; } } protected void RadComboBox1_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) { displayNullDataSourceErrorMessage = true; errorMessage.Visible = false; groupID = e.Value.Trim(); groupName = e.Text.Trim(); // rebind the grid if and only if the table is successfully populated if (PopulateTable(groupID, groupName)) { RadGrid1.Rebind(); // make the grid visible not that it has data to display RadGrid1.Visible = true; } } // pre: invoked by radgrid1 when when it found that there is no data source during data binding // post: returns the datasource for the grid protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { if (table != null) { RadGrid1.DataSource = table; } else { // do not display the error message when the user first viewed the module if (displayNullDataSourceErrorMessage) { // the data table is null errorMessage.Text = "Error. Unable to get grid data source from DataTable. The User Group Privilege cannot be displayed"; errorMessage.Visible = true; errorMessage.Focus(); } } } // pre: info: asuthorization information from database. // accessType: 1 to indicate view, 2 to indicate add, 3 to indicate edit, 4 to indicate delete // post: returns the boolen status for the view, add, edit, OR delete privilege private bool GetBoolStatus(string info, int accessType) { bool status = false; char[] c = info.ToCharArray(); switch (accessType) { case 1: { // caller method wants to know the View status status = (c[0] == '1'); break; } case 2: { // caller method wants to know the View status status = (c[2] == '1'); break; } case 3: { // caller method wants to know the View status status = (c[4] == '1'); break; } case 4: { // caller method wants to know the View status status = (c[6] == '1'); break; } default: { //should not get here break; } } return status; } protected void RadGrid1_EditCommand(object sender, GridCommandEventArgs e) { bool b = PopulateTable(groupID, groupName); } // post : return true if the table is successfully populated private bool PopulateTable(string userGroupID, string userGroupName) { string query = "SELECT RTRIM(user_group_id) AS user_group_id, RTRIM(user_group) AS user_group " + "WHERE user_group_id = '" + userGroupID + "'"; int recordCount = 0; db db = new db(); if (db.Load()) { // query record corresponding to the selected userID ONLY if (db.QuerySQL(query, ref recordCount) && recordCount == 1) { // create a new data table table = new DataTable(); // declare columns for table table.Columns.Add("Module Name", typeof(string)); table.Columns.Add("View", typeof(bool)); table.Columns.Add("Add", typeof(bool)); table.Columns.Add("Edit", typeof(bool)); table.Columns.Add("Delete", typeof(bool)); // get the number of columns in "records" table int tableColumnsCount = db.SqlDataSet.Tables["records"].Columns.Count; //get the selected group's privilege information DataRow tempRow = db.SqlDataSet.Tables["records"].Rows[0]; // add records to the table by iterating the tempRow DataColumn tempColumn; for (int i = 0; i < tableColumnsCount; i++) { //get the column in at position i inside table tempColumn = db.SqlDataSet.Tables["records"].Columns[i]; // get the COLUMN NAME for tempColumn DEBUG string moduleInfo = tempColumn.ColumnName.Trim(); switch (moduleInfo) { case "user_group": { // do nothing break; } case "user_group_id": { // do nothing break; } default: { // variables to hold the privilage information in bool type bool viewStatus = false; //dummy default value because the compiler refused to compile bool addStatus = false; //dummy default value because the compiler refused to compile bool editStatus = false; //dummy default value because the compiler refused to compile bool deleteStatus = false; //dummy default value because the compiler refused to compile // switch based on the COLUMN NAME for the columns with 0 is set to indicate true if (moduleInfo.Equals("reconcile") || moduleInfo.Equals("report") || moduleInfo.Equals("admin"))) { // get the value in tempRow at column position i. Set status to true if the value is "0" viewStatus = "0".Equals(tempRow[tempColumn].ToString().Trim()); } // switch based on the COLUMN NAME for the columns with 1 is set to indicate true if (moduleInfo.Equals("SpeedKey") || moduleInfo.Equals("WebReports")) { // get the value in the cell at tempRow and tempColumn. Set status to true if the value is "1" string info = tempRow[tempColumn].ToString().Trim(); viewStatus = GetBoolStatus(info, 1); addStatus = GetBoolStatus(info, 2); editStatus = GetBoolStatus(info, 3); deleteStatus = GetBoolStatus(info, 4); } //add a new row to table table.Rows.Add(moduleInfo, viewStatus, addStatus, editStatus, deleteStatus); break; } } } return true; } else { //either the connection cannot be opened or there is more than one record returned if (recordCount == 1 || recordCount == 0) { //connection could not be opened errorMessage.Text = db.LastError; errorMessage.Visible = true; errorMessage.Focus(); } else { // there is more than one record returned errorMessage.Text = "Error. There is more than one privilege information for UserGroup " + userGroupName + ". " + "Please ensure that there is only one privilege information per user group."; errorMessage.Visible = true; errorMessage.Focus(); } } return false; } else { // cannot load db errorMessage.Text = db.LastError; errorMessage.Visible = true; errorMessage.Focus(); return false; } } }}<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="frmUserGroupPrivilege.aspx.cs" Inherits="Project1.frmUserGroupPrivillage" %><asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> <style type="text/css"> .style1 { width: 98%; } </style></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="Title" runat="server"> User Group Privilege Management</asp:Content><asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server"> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadComboBox1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="errorMessage" /> <telerik:AjaxUpdatedControl ControlID="RadComboBox1" /> <telerik:AjaxUpdatedControl ControlID="statusMessage" /> <telerik:AjaxUpdatedControl ControlID="Label1" /> <telerik:AjaxUpdatedControl ControlID="Label2" /> <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadGrid1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="errorMessage" /> <telerik:AjaxUpdatedControl ControlID="statusMessage" /> <telerik:AjaxUpdatedControl ControlID="Label1" /> <telerik:AjaxUpdatedControl ControlID="Label2" /> <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager><br /> <table align="center" class="style1"> <tr> <td> <asp:Label ID="errorMessage" runat="server" Text="Error Message" Visible="False" CssClass="frmElement_ErrorText"></asp:Label> <br /> To begin, please select a user group from the combo box below:<br /> <br /> <telerik:RadComboBox ID="RadComboBox1" Runat="server" EmptyMessage="Select User Group to be viewed" Skin="Vista" DataSourceID="GroupNameDataSource" DataTextField="user_group" DataValueField="user_group_id" onselectedindexchanged="RadComboBox1_SelectedIndexChanged" AutoPostBack="True" Width="250px"> </telerik:RadComboBox><br /> <br /> <telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" GridLines="None" Skin="Vista" onneeddatasource="RadGrid1_NeedDataSource" AutoGenerateEditColumn="True" oneditcommand="RadGrid1_EditCommand" Visible="False"><MasterTableView AllowFilteringByColumn="True" AllowSorting="True" AutoGenerateColumns="True" AllowPaging="True" EditMode="InPlace"><CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings><RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"><HeaderStyle Width="20px"></HeaderStyle></RowIndicatorColumn><ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"><HeaderStyle Width="20px"></HeaderStyle></ExpandCollapseColumn> <Columns> <telerik:GridEditCommandColumn ButtonType="ImageButton" CancelImageUrl="Images/Cancel.gif" EditImageUrl="Images/Edit.gif" FilterControlAltText="Filter EditCommandColumn column" InsertImageUrl="Images/Update.gif" UpdateImageUrl="Images/Update.gif" Visible="False"> <ItemStyle HorizontalAlign="Center" Width="30px" /> </telerik:GridEditCommandColumn> </Columns><EditFormSettings><EditColumn FilterControlAltText="Filter EditCommandColumn column" UniqueName="EditCommandColumn1"></EditColumn></EditFormSettings></MasterTableView><FilterMenu EnableImageSprites="False"></FilterMenu> </telerik:RadGrid> <br /> <asp:Label ID="statusMessage" runat="server" ForeColor="#006600" Text="StatusMessage" Visible="False"></asp:Label> <br /> <asp:Label ID="Label1" runat="server" Text="Label1"></asp:Label> <br /> <asp:Label ID="Label2" runat="server" Text="Label2"></asp:Label> </td> </tr> </table> <asp:SqlDataSource ID="GroupNameDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnectionString %>" SelectCommand="SELECT RTRIM(user_group_id) AS user_group_id, RTRIM(user_group) AS user_groupFROM User_Group ORDER BY (user_group) "></asp:SqlDataSource><br /> </asp:Content><telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="Progress" UniqueName="StatusIndicator"> <ItemTemplate> <center> <telerik:RadLinearGauge runat="server" ID="RadLinearGauge1" Scale-Vertical="false" Scale-MajorTicks-Visible="false" Scale-Labels-Visible="false" Width="120px" Height="20px"> <Pointer Shape="BarIndicator"> <Track Opacity="0.4" /> </Pointer> <Scale Min="0" Max="100"> <Ranges> <telerik:GaugeRange Color="#c20000" From="0" To="100" /> </Ranges> </Scale> </telerik:RadLinearGauge> </center> </ItemTemplate> <HeaderStyle Width="100px" HorizontalAlign="Center" /> </telerik:GridTemplateColumn>protected void OnItemDataBound1(object sender, GridItemEventArgs e) { if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) { GridDataItem item = e.Item as GridDataItem; DataRowView currentRow = (DataRowView)item.DataItem; decimal currValue = decimal.Parse(currentRow.Row["pc"].ToString()); RadLinearGauge radialGauge1 = (RadLinearGauge)item.FindControl("RadLinearGauge1"); radialGauge1.Pointer.Value = currValue; } }<telerik:RadGrid ID="grdCaptDiaria" runat="server" AutoGenerateColumns="False"
AllowPaging="True" PageSize="10">
<HeaderStyle BorderStyle="Solid" BorderWidth="1px" Height="30px" HorizontalAlign="Center"
BorderColor="#B0B0B0" BackColor="#EBEBEB" Font-Bold="True" Font-Italic="False"
Font-Names="Arial,Helvetica,sans-serif" Font-Overline="False" Font-Size="10px"
Font-Strikeout="False" Font-Underline="False" ForeColor="#666666" Wrap="True" />
<ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" ForeColor="#999999" Wrap="True" />
<PagerStyle Mode="NumericPages" PagerTextFormat="{4}Página {0} de {1}, registros del {2} al {3} de {5}" />
<MasterTableView TableLayout="Fixed" NoMasterRecordsText="No existen Moliendas con los filtros proporcionados">
<Columns>
<telerik:GridBoundColumn HeaderText="Concepto" DataField="concepto" />
<telerik:GridTemplateColumn HeaderText="Unidad" HeaderStyle-Width="25%">
<ItemTemplate>
<asp:Label ID="lblUnidad" runat="server" Text="Ton"></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Valor" DataField="valor" HeaderStyle-Width="25%">
<ItemTemplate>
<asp:TextBox ID="txtValor" runat="server"></asp:TextBox>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="No Captura" HeaderStyle-Width="25%">
<ItemTemplate>
<asp:CheckBox ID="chkNoCaptura" Checked="false" OnChange="javascript:enableTextBox();" on runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
 
</MasterTableView>