or
<
asp:EntityDataSource
ID
=
"edsBackups"
runat
=
"server"
EntitySetName
=
"Backups"
ConnectionString
=
"name=ControlwareEntities"
DefaultContainerName
=
"ControlwareEntities"
EnableFlattening
=
"False"
EnableUpdate
=
"True"
EntityTypeFilter
=
""
OrderBy
=
"it.DateTime DESC"
Select
=
""
>
</
asp:EntityDataSource
>
<
telerik:RadGrid
runat
=
"server"
ID
=
"cg"
DataSourceID
=
"edsBackups"
OnUpdateCommand
=
"cg_UpdateCommand"
OnDeleteCommand
=
"cg_DeleteCommand"
AllowPaging
=
"True"
AllowSorting
=
"True"
>
<
MasterTableView
DataKeyNames
=
"ID"
>
<
CommandItemTemplate
>
<
div
style
=
"padding: 5px 5px;"
>
<
asp:LinkButton
ID
=
"LinkButton2"
runat
=
"server"
OnClick
=
"bBackup_OnClick"
><
img
style
=
"border:0px;vertical-align:middle;"
alt
=
""
width
=
"15"
src
=
"/Styles/glyphicons/glyphicons_342_hdd.png"
/> <
asp:Literal
ID
=
"Literal1"
meta:resourcekey
=
"NewBackup"
runat
=
"server"
Text
=
"New"
></
asp:Literal
></
asp:LinkButton
>
<
asp:LinkButton
ID
=
"btnEditSelected"
runat
=
"server"
CommandName
=
"EditSelected"
><
img
style
=
"border:0px;vertical-align:middle;"
alt
=
""
width
=
"15"
src
=
"/Styles/glyphicons/glyphicons_030_pencil.png"
/> <
asp:Literal
ID
=
"Literal2"
meta:resourcekey
=
"EditBackup"
runat
=
"server"
Text
=
"Edit"
></
asp:Literal
></
asp:LinkButton
>
<
asp:LinkButton
ID
=
"LinkButton1"
runat
=
"server"
CommandName
=
"DeleteSelected"
><
img
style
=
"border:0px;vertical-align:middle;"
alt
=
""
width
=
"15"
src
=
"/Styles/glyphicons/glyphicons_016_bin.png"
/> <
asp:Literal
ID
=
"Literal3"
meta:resourcekey
=
"DeleteBackup"
runat
=
"server"
Text
=
"Delete"
></
asp:Literal
></
asp:LinkButton
>
<
asp:LinkButton
ID
=
"LinkButton5"
runat
=
"server"
OnClick
=
"bRestore_OnClick"
><
img
style
=
"border:0px;vertical-align:middle;"
alt
=
""
width
=
"15"
src
=
"/Styles/glyphicons/glyphicons_082_roundabout.png"
/> <
asp:Literal
ID
=
"Literal4"
meta:resourcekey
=
"RestoreBackup"
runat
=
"server"
Text
=
"RestoreBackup"
></
asp:Literal
></
asp:LinkButton
>
<
asp:LinkButton
ID
=
"LinkButton4"
runat
=
"server"
CommandName
=
"RebindGrid"
><
div
style
=
"float:right"
><
img
style
=
"border:0px;vertical-align:middle"
alt
=
""
width
=
"15"
src
=
"/Styles/glyphicons/glyphicons_081_refresh.png"
/> <
asp:Literal
ID
=
"Literal5"
meta:resourcekey
=
"RefreshBackup"
runat
=
"server"
Text
=
"Refresh"
></
asp:Literal
></
asp:LinkButton
>
</
div
>
</
CommandItemTemplate
>
<
EditFormSettings
EditFormType
=
"Template"
InsertCaption
=
"New"
CaptionFormatString
=
"Edit"
>
<
FormTemplate
>
<
div
style
=
"padding: 5px"
>
<
table
id
=
"Table2"
width
=
"100%"
border
=
"0"
style
=
"border-collapse: collapse; padding: 5px"
>
<
tr
>
<
td
colspan
=
"2"
><
b
>Backup:</
b
></
td
>
</
tr
>
<
tr
>
<
td
>Created On:</
td
>
<
td
><
asp:Label
runat
=
"server"
Text='<%# Eval("DateTime") %>'></
asp:Label
></
td
>
</
tr
>
<
tr
>
<
td
>Name:</
td
>
<
td
><
asp:TextBox
ID
=
"TextBox1"
Style
=
"width: 200px;"
runat
=
"server"
Text='<%# Bind("Name") %>'></
asp:TextBox
></
td
>
</
tr
>
<
tr
>
<
td
>
Full Backup:
</
td
>
<
td
>
<
asp:CheckBox
Enabled
=
"False"
runat
=
"server"
ID
=
"cb1"
Checked='<%# Bind("IsFullBackup") %>' />
</
td
>
</
tr
>
<
tr
>
<
td
colspan
=
"2"
style
=
"padding: 5px"
>
<
asp:LinkButton
ID
=
"btnCancel"
runat
=
"server"
CommandName
=
"CancelAll"
Visible='<%# cg.EditIndexes.Count > 0 || cg.MasterTableView.IsItemInserted %>'><
img
style
=
"border:0px;vertical-align:middle;"
alt
=
""
width
=
"15"
src
=
"/Styles/glyphicons/glyphicons_221_unshare.png"
/> Cancel</
asp:LinkButton
>
<
asp:LinkButton
ID
=
"btnUpdateEdited"
runat
=
"server"
CommandName
=
"UpdateEdited"
Visible='<%# cg.EditIndexes.Count > 0 %>'><
img
style
=
"border:0px;vertical-align:middle;"
alt
=
""
width
=
"15"
src
=
"/Styles/glyphicons/glyphicons_003_user.png"
/> Update</
asp:LinkButton
>
</
td
>
</
tr
>
</
table
>
</
div
>
</
FormTemplate
>
</
EditFormSettings
>
<
Columns
>
<
telerik:GridBoundColumn
HeaderText
=
"ID"
DataField
=
"ID"
Visible
=
"False"
/>
<
telerik:GridBoundColumn
meta:resourcekey
=
"GridColumn1"
HeaderText
=
"Timestamp"
DataField
=
"DateTime"
/>
<
telerik:GridBoundColumn
meta:resourcekey
=
"GridColumn2"
HeaderText
=
"Name"
DataField
=
"Name"
/>
<
telerik:GridCheckBoxColumn
meta:resourcekey
=
"GridColumn3"
HeaderText
=
"Full Backup"
DataField
=
"IsFullBackup"
/>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
telerik:RadComboBox
ID
=
"rcbTemplate"
AutoPostBack
=
"true"
Height
=
"200px"
runat
=
"server"
>
</
telerik:RadComboBox
>
<
asp:LinkButton
ID
=
"btnAddTemplates"
Text
=
"Add/Edit Template"
Visible
=
"false"
runat
=
"server"
>
</
asp:LinkButton
>
<
telerik:RadAjaxManager
ID
=
"_RadAjaxManager"
OnAjaxRequest
=
"rjm_AjaxRequest"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"btnSave"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"rttm"
></
telerik:AjaxUpdatedControl
>
<
telerik:AjaxUpdatedControl
ControlID
=
"rcbTemplate"
></
telerik:AjaxUpdatedControl
>
<
telerik:AjaxUpdatedControl
ControlID
=
"rgInvoiceTemplateDetail"
></
telerik:AjaxUpdatedControl
>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadToolTipManager
ID
=
"rttm"
runat
=
"server"
Position
=
"TopRight"
Animation
=
"Fade"
ShowEvent
=
"OnClick"
HideEvent
=
"ManualClose"
OnAjaxUpdate
=
"OnAjaxUpdate"
RelativeTo
=
"Element"
Width
=
"250px"
Height
=
"250px"
RenderInPageRoot
=
"true"
>
<
TargetControls
>
<
telerik:ToolTipTargetControl
TargetControlID
=
"btnAddTemplates"
/>
</
TargetControls
>
</
telerik:RadToolTipManager
>
<
table
id
=
"tblToolTip"
visible
=
"false"
runat
=
"server"
>
<
tr
>
<
td
>
Client
</
td
>
<
td
>
<
asp:Label
ID
=
"lblClientName"
runat
=
"server"
></
asp:Label
>
</
td
>
</
tr
>
<
tr
>
<
td
>
Template
</
td
>
<
td
>
<
asp:TextBox
ID
=
"txtTemplateName"
runat
=
"server"
></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
>
</
td
>
<
td
>
<
asp:Button
ID
=
"btnSave"
OnClientClick
=
"SaveTemplate(this); return false;"
Text
=
"Save"
runat
=
"server"
/>
</
td
>
</
tr
>
</
table
>
Protected Sub rjm_AjaxRequest(ByVal sender As Object, ByVal e As AjaxRequestEventArgs)
Dim nTemplateID As Int32 = Convert.ToInt32(rcbTemplate.SelectedValue)
Dim objTemplate As New TemplateInfo(nTemplateID)
objTemplate.TemplateName = txtTemplateName.Text.Trim
objTemplate.Update(nTemplateID)
ScriptManager.RegisterClientScriptBlock(Me.Page, Me.GetType(), "Call my function", "CloseActiveToolTip()", True)
Call GetAllTemplates()
End Sub
Protected Sub GetAllTemplates()
rcbTemplate.Items.Clear()
If rcbClient.SelectedValue <> String.Empty Then
Dim sSQL As String = "select ID, TemplateName from InvoiceTemplate where IsDeleted = 0 and ClientID = " & rcbClient.SelectedValue & " order By TemplateName"
Dim oDataTable As DataTable = GMSDB.Query(sSQL)
rcbTemplate.DataSource = oDataTable
rcbTemplate.DataTextField = "TemplateName"
rcbTemplate.DataValueField = "ID"
rcbTemplate.DataBind()
rcbTemplate.Items.Insert(0, New RadComboBoxItem("- Select Template -", "- Select Template -"))
Else
rcbTemplate.DataSource = Nothing
rcbTemplate.DataBind()
rcbTemplate.Items.Add(New RadComboBoxItem("- Select Template -", "- Select Template -"))
End If
End Sub