or

| function UpdateValue(id,c, val) |
| { |
| var url = "fn.aspx"; |
| var pars = 'fn=u'; |
| pars = pars + '&' + 'id=' + id + '&c=' + c + '&val=' + val; |
| var myAjax = new Ajax.Request( |
| url, |
| { |
| method: 'post', |
| parameters: pars, |
| onComplete: response |
| }); |
| } |
| function UpdateValue(id,c, val) |
| { |
| var pars = 'fn=u'; |
| pars = pars + '&' + 'id=' + id + '&c=' + c + '&val=' + val; |
| var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>"); |
| ajaxManager.ajaxRequest(pars); |
| } |
| Protected Sub ddlCountries_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) |
| Try |
| Dim dropdown As DropDownList = DirectCast(sender, DropDownList) |
| Dim tc As GridTableCell = DirectCast(dropdown.Parent, GridTableCell) |
| Dim dataItem As GridDataItem = DirectCast(tc.Parent, GridDataItem) |
| col1Value = dataItem.GetDataKeyValue("col1") |
| col2Value = dataItem.GetDataKeyValue("col2") |
| recordtimestampValue = dataItem.GetDataKeyValue("record_timestamp") |
| ' Update the database and get the new timestamp value |
| ' Update the grid item to have the new timestamp value stored in the data keys ????? |
| Catch ex As Exception |
| ' handle error |
| Finally |
| End Try |
| End Sub |
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContactHistory.aspx.cs" |
| Inherits="xxx.yyy.UI.ClientService.ContactHistory" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <title></title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
| </telerik:RadScriptManager> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnablePageHeadUpdate="False" |
| DefaultLoadingPanelID="RadAjaxLoadingPanel1"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="NoteType"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="AddNote" /> |
| <telerik:AjaxUpdatedControl ControlID="Note" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="AddNote"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="Note" /> |
| <telerik:AjaxUpdatedControl ControlID="HistoryList" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="MessageSource"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="HistoryList" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="HistoryList"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="HistoryList" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| <asp:Panel ID="Panel1" runat="server"> |
| <table width="100%"> |
| <tr> |
| <td> |
| <asp:Label ID="Label1" runat="server" Text="Note Type:"></asp:Label> |
| </td> |
| <td style="text-align: left;"> |
| <telerik:RadComboBox ID="NoteType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="NoteType_SelectedIndexChanged"> |
| <Items> |
| <telerik:RadComboBoxItem Text="-- Select --" Value="0" Selected="true" /> |
| <telerik:RadComboBoxItem Text="Admin" Value="Admin" /> |
| <telerik:RadComboBoxItem Text="Inbound" Value="Inbound" /> |
| <telerik:RadComboBoxItem Text="Outbound" Value="Outbound" /> |
| </Items> |
| </telerik:RadComboBox> |
| </td> |
| <td> |
| <asp:Button ID="AddNote" runat="server" Text="Add Note" OnClick="AddNote_Click" Enabled="False" /> |
| </td> |
| </tr> |
| <tr> |
| <td colspan="3"> |
| <telerik:RadEditor ID="Note" runat="server" Height="150" Width="100%" EditModes="Preview"> |
| <Tools> |
| <telerik:EditorToolGroup> |
| <telerik:EditorTool Name="AjaxSpellCheck" Text="SpellCheck" /> |
| </telerik:EditorToolGroup> |
| </Tools> |
| <Content> |
| </Content> |
| </telerik:RadEditor> |
| </td> |
| </tr> |
| <tr> |
| <td colspan="3"> |
| |
| </td> |
| </tr> |
| <tr> |
| <td colspan="3"> |
| <asp:Panel ID="Panel2" runat="server" GroupingText="Message Filter"> |
| <br /> |
| <table> |
| <tr> |
| <td> |
| <asp:Label ID="Label2" runat="server" Text="Message Source:"></asp:Label> |
| </td> |
| <td> |
| <telerik:RadComboBox ID="MessageSource" runat="server" AutoPostBack="True" OnSelectedIndexChanged="MessageSource_SelectedIndexChanged"> |
| <Items> |
| <telerik:RadComboBoxItem Value="all" Text="All" /> |
| <telerik:RadComboBoxItem Value="call" Text="Call" Selected="true" /> |
| <telerik:RadComboBoxItem Value="claim" Text="Claim" /> |
| </Items> |
| </telerik:RadComboBox> |
| </td> |
| </tr> |
| </table> |
| </asp:Panel> |
| </td> |
| </tr> |
| <tr> |
| <td colspan="3"> |
| <telerik:RadGrid ID="HistoryList" runat="server" DataSourceID="dsContactHistory" |
| GridLines="None" AutoGenerateColumns="False" Width="100%"> |
| <MasterTableView CellSpacing="-1" CommandItemDisplay="Top" DataKeyNames="ContactHistoryID" |
| DataSourceID="dsContactHistory"> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px" /> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px" /> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridBoundColumn DataField="ContactHistoryID" DataType="System.Int32" HeaderText="ContactHistoryID" |
| ReadOnly="True" SortExpression="ContactHistoryID" UniqueName="ContactHistoryID" |
| Visible="false"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="LogDate" DataType="System.DateTime" HeaderText="Log Date" |
| SortExpression="LogDate" UniqueName="LogDate" DataFormatString="{0:ddd dd-MMM-yyyy hh:mm}" |
| ItemStyle-Wrap="false"> |
| <ItemStyle Wrap="False" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name" SortExpression="UserName" |
| UniqueName="UserName" ItemStyle-Wrap="false"> |
| <ItemStyle Wrap="False" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Description" HeaderText="Description" SortExpression="Description" |
| UniqueName="Description"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| <CommandItemTemplate> |
| <table style="width: 100%; text-align: right;"> |
| <tr> |
| <td> |
| <img style="border: 0px" width="12" height="12" alt="" src="../App_Themes/OTSSTheme/Images/Refresh.gif" /><asp:LinkButton |
| ID="LinkButton4" runat="server" CommandName="RebindGrid">Refresh list</asp:LinkButton> |
| </td> |
| </tr> |
| </table> |
| </CommandItemTemplate> |
| </MasterTableView> |
| </telerik:RadGrid> |
| <asp:ObjectDataSource ID="dsContactHistory" runat="server" OldValuesParameterFormatString="original_{0}" |
| SelectMethod="GetDataByCallDetailIDMessageSource" TypeName="xxx.yyy.Data.FusionDataTableAdapters.ContactHistoryListTableAdapter"> |
| <SelectParameters> |
| <asp:Parameter Name="CallDetailID" Type="Int32" /> |
| <asp:ControlParameter ControlID="MessageSource" Name="MessageSource" PropertyName="SelectedValue" |
| Type="String" /> |
| </SelectParameters> |
| </asp:ObjectDataSource> |
| </td> |
| </tr> |
| </table> |
| </asp:Panel> |
| <telerik:RadFormDecorator ID="DecorateTelerik" runat="server" Skin="Telerik" /> |
| <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"> |
| </telerik:RadAjaxLoadingPanel> |
| </form> |
| </body> |
| </html> |
| Protected Sub Calendar_AppointmentDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.SchedulerEventArgs) Handles Calendar.AppointmentDataBound |
| 'Grab details about the appointments appearance |
| Dim apptComputer As String = e.Appointment.DataItem("computer_name").ToString |
| Dim apptProject As String = e.Appointment.DataItem("project_name").ToString |
| Dim apptRelease As String = e.Appointment.DataItem("release_name").ToString |
| Dim apptType As Integer = e.Appointment.DataItem("appointment_type").ToString |
| Dim apptColour As String = "White" |
| Dim apptStatus As Integer = e.Appointment.DataItem("Status").ToString |
| Dim strStatus As String = "Scheduled" |
| Dim strCSSClass As String = "rsCategoryBlue" |
| e.Appointment.Subject = "Project: " & apptProject & Chr(13) & "Release: " & apptRelease & Chr(13) & "Computer: " & apptComputer |
| 'Grab the appointment colour if it is assigned if not then |
| 'leave the setting as white (generic). |
| If e.Appointment.DataItem("colour").ToString() <> "" Then |
| apptColour = e.Appointment.DataItem("colour").ToString() |
| End If |
| 'apptStatus dictates the text colour of the appointment. |
| '1 - Scheduled = Blue |
| '2 - Failed = Red |
| '3 - Passed = Green |
| Select Case apptStatus |
| Case 1 'Scheduled |
| strStatus = "Scheduled" |
| Case 2 'Failed |
| strStatus = "Failed" |
| Case 3 'Passed |
| strStatus = "Passed" |
| End Select |
| 'apptColour dictates the background colour of the appointment |
| 'apptType dictates the icon displayed in the top left corner of the appointment |
| Select Case apptType |
| Case 1 'Generic Appointment |
| Case 2 'QualityControl |
| strCSSClass = "Quality_" & apptColour & "_" & strStatus & "_AppointmentStyle" |
| Case 3 'CompatibilityCheck |
| strCSSClass = "Compatible_" & apptColour & "_" & strStatus & "_AppointmentStyle" |
| Case 4 'PackageApp |
| strCSSClass = "Package_" & apptColour & "_" & strStatus & "_AppointmentStyle" |
| Case 5 'Release |
| strCSSClass = "Release_" & apptColour & "_" & strStatus & "_AppointmentStyle" |
| End Select |
| e.Appointment.CssClass = strCSSClass |
| End Sub |
| Protected Sub Calendar_OnAppointmentInsert(ByVal sender As Object, ByVal e As Telerik.Web.UI.SchedulerCancelEventArgs) Handles Calendar.AppointmentInsert |
| Dim sdsProjectAppointments As New SqlDataSource |
| Dim strConnection As String = ConfigurationManager.ConnectionStrings("RR3ConnectionString").ConnectionString |
| Dim myRecurrenceParentID As String = "" |
| 'Check to see if the appointment has a RecurrenceParentID |
| 'If so then set the variable if not then leave as "". Avoids passing null to USP. |
| If e.Appointment.RecurrenceParentID <> Nothing Then |
| 'If DirectCast(e.Appointment.RecurrenceParentID, Guid) <> Nothing Then |
| myRecurrenceParentID = e.Appointment.RecurrenceParentID.ToString |
| End If |
| sdsProjectAppointments.ConnectionString = strConnection |
| sdsProjectAppointments.InsertCommand = "usp_insert_project_appointment" |
| sdsProjectAppointments.InsertCommandType = SqlDataSourceCommandType.StoredProcedure |
| 'Set the SQLDataSource Parameters. The first set of parameters are grabbed from |
| 'the new ExceptionAppointment part of the RecurrenceExceptionCreatedEventArgs. |
| 'This contains the new records indivdual start and end times etc... |
| sdsProjectAppointments.InsertParameters.Add("Subject", e.Appointment.Subject.ToString) |
| sdsProjectAppointments.InsertParameters.Add("start", e.Appointment.Start.ToString) |
| sdsProjectAppointments.InsertParameters("start").DbType = DbType.DateTime |
| sdsProjectAppointments.InsertParameters.Add("end", e.Appointment.End.ToString) |
| sdsProjectAppointments.InsertParameters("end").DbType = DbType.DateTime |
| sdsProjectAppointments.InsertParameters.Add("recurrencerule", e.Appointment.RecurrenceRule.ToString) |
| sdsProjectAppointments.InsertParameters.Add("recurrenceparentid", myRecurrenceParentID) |
| 'Now stuff in the parameters we got from our select statement |
| sdsProjectAppointments.InsertParameters.Add("project_guid", "00000000-0000-0000-0000-000000000000") |
| sdsProjectAppointments.InsertParameters.Add("parent_project_guid", "00000000-0000-0000-0000-000000000000") |
| sdsProjectAppointments.InsertParameters.Add("release_guid", "00000000-0000-0000-0000-000000000000") |
| sdsProjectAppointments.InsertParameters.Add("app_env_guid", "00000000-0000-0000-0000-000000000000") |
| sdsProjectAppointments.InsertParameters.Add("env_comp_guid", "00000000-0000-0000-0000-000000000000") |
| sdsProjectAppointments.InsertParameters.Add("computer_guid", "00000000-0000-0000-0000-000000000000") |
| sdsProjectAppointments.InsertParameters.Add("status", "1") 'Scheduled |
| sdsProjectAppointments.InsertParameters.Add("appointment_type", "7") 'Type 7 is an informational appointment for the build and release teams |
| sdsProjectAppointments.InsertParameters.Add("colour", "White") 'Unallocated |
| 'Call the update method of the SQLDataSource |
| Try |
| sdsProjectAppointments.Insert() |
| Catch ex As Exception |
| MsgBox("An unhandled exception has occurred. " & ex.Message) |
| End Try |
| End Sub |
| <telerik:RadListView ID="RadListView1" runat="server" ClientDataKeyNames="ID"> |
| </telerik:RadListView> |
| <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> |
| <script type="text/javascript"> |
| function GetClientDataKeyValueForFirstItem() |
| { |
| var clientDataKeyValues = $find("<%= RadListView1.ClientID %>").get_clientDataKeyValue(); |
| var firstItemKeyValue = clientDataKeyValues[0]["ID"]; |
| } |
| </script> |
| </telerik:RadCodeBlock> |