or
dear all
have a good day
i've a radschadualr in which students segister there schadual.
this schadual consists of substances each one is (leacture-tutorial-lab).
what i need is forcing the student to choose these sub categories (leacture-tutorial-lab) before leaving to choose new subject. and if he tries an error msg popup saying that "you should choose all substance groop- please complete your choice".
here is the code i wrote but it does't work.
if(this.treeView.SelectedNode == null)return;if (this.treeView.SelectedNode.Value != "m")return;string s = this.treeView.SelectedNode.Text;string corsnode = this.treeView.SelectedNode.ParentNode.Text;string cors_id = corsnode.Substring(0, corsnode.IndexOf('-') - 1).Trim();string stu_id = Session["test"].ToString();OracleConnection conn = new OracleConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);try{conn.Open();OracleCommand cmd = new OracleCommand("COMPLETE_GROUP_TYPE");cmd.CommandType =CommandType.StoredProcedure;cmd.Connection = conn;cmd.Parameters.Add("COURSEID", OracleType.Char).Value = cors_id.ToString();cmd.Parameters.Add("STUDENTID", OracleType.Char).Value = stu_id.ToString();cmd.ExecuteNonQuery();}catch (Exception ex){Label2.Text ="ERROR."+ ex.Message;}finally{conn.Close();}
| <telerik:RadCodeBlock ID="RadCodeBlockMain" runat="server"> |
| <script type="text/javascript"> |
| function OnClientTransferredHandler(sender, e) { |
| var myitems; |
| var radbox = $find('<%= CurrentlyTransferredValues.ClientId %>'); |
| var radbox2 = $find('<%= SourceListBox.ClientId %>'); |
| myitems = e.get_items(); |
| myitems.forEach(function(item) { radbox.set_value(radbox.get_value() + item.get_value() + ","); }); |
| radbox2.set_value(e.get_sourceListBox().get_id()); |
| } |
| </script> |
| </telerik:RadCodeBlock> |
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript" language="javascript"> function createCallBack(tableView, div) { return function(result) { if (result != null && div != null) { div.style.display = "block"; } tableView.set_dataSource(result); tableView.dataBind(); if (result.count != null) { tableView.set_virtualItemCount(result.Count); } }; } function createPartsCallBack(tableView, div) { return function(result) { if (result != null && div != null) { div.style.display = "block"; } tableView.set_dataSource(result.Parts); tableView.dataBind(); if (result.Count != null) { tableView.set_virtualItemCount(result.Count); } }; } /*functions for specimen History Start*/ function loadSpecimenHistory() { var tblView = $find("<%=radGridHistory.ClientID %>").get_masterTableView(); var divHistory = document.getElementById('divHistory'); //Pass in the selected Specimen Id var result = PageMethods.FindSpecimen(20, createCallBack(tblView, divHistory)); } function radGridHistory_hierarchyExpanding(sender, args) { var firstClientDataKeyName = args.get_tableView().get_clientDataKeyNames()[0]; if (firstClientDataKeyName == "SpecimenID") { var tblView = $find("<%= radGridHistory.Items(0).ChildItem.NestedTableViews(0).ClientID%>"); var currentPageIndex = tblView.get_currentPageIndex(); var pageSize = tblView.get_pageSize(); var sortExpressionsAsSQL = tblView.get_sortExpressions().toString(); var filterExpressionsAsSQL = tblView.get_filterExpressions().toString(); var result = PageMethods.FindSpecimenHistoryParts(args.getDataKeyValue(firstClientDataKeyName), currentPageIndex * pageSize, pageSize, sortExpressionsAsSQL, filterExpressionsAsSQL, createPartsCallBack(tblView,null)); } } //Grid command invoked (sort) function radGridHistory_command(sender, args) { args.set_cancel(true); if (args.get_commandName() == "ExpandCollapse") { var tblView = $find("<%= radGridHistory.Items(0).ChildItem.NestedTableViews(0).ClientID%>"); } var tblView = args.get_tableView(); var tableName = tblView.get_name() var specimenId = sender.get_masterTableView().get_dataItems()[0].get_dataItem().SpecimenID; if (tableName == "Parts") { var pageSize = tblView.get_pageSize(); var sortExpressionsAsSQL = tblView.get_sortExpressions().toString(); var filterExpressionsAsSQL = tblView.get_filterExpressions().toString(); var currentPageIndex = tblView.get_currentPageIndex(); var result = PageMethods.FindSpecimenHistoryParts(specimenId, currentPageIndex * pageSize, pageSize, sortExpressionsAsSQL, filterExpressionsAsSQL, createPartsCallBack(tblView, null)); } } /*functions for specimen History END*/ </script> </telerik:RadCodeBlock><div id="divHistory" style="display:none"> <telerik:RadGrid ID="radGridHistory" runat="server" EnableViewState="False" AllowSorting="True" GridLines="None" ShowStatusBar="false" > <ClientSettings AllowExpandCollapse="true"> <ClientEvents OnHierarchyExpanding="radGridHistory_hierarchyExpanding" OnCommand="radGridHistory_command" /> </ClientSettings> <PagerStyle Mode="NumericPages" AlwaysVisible="true"></PagerStyle> <MasterTableView AllowMultiColumnSorting="false" TableLayout="Fixed" HierarchyLoadMode="Client" DataKeyNames="SpecimenID" ClientDataKeyNames="SpecimenID" AllowPaging="false" Width="100%"> <DetailTables> <telerik:GridTableView Width="100%" Name="Parts" PageSize="4" AllowPaging="true" AllowCustomPaging="true" > <DetailTables> <telerik:GridTableView Width="100%" Name="Blocks" PageSize="4" AllowPaging="true" AllowCustomPaging="true" > <Columns> <telerik:GridBoundColumn SortExpression="BlockID" HeaderText="BlockID" HeaderButtonType="TextButton" DataField="BlockID" UniqueName="BlockID"> </telerik:GridBoundColumn> </Columns> </telerik:GridTableView> </DetailTables> <Columns> <telerik:GridBoundColumn SortExpression="PartID" HeaderText="PartID" HeaderButtonType="TextButton" DataField="PartID" UniqueName="PartID"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="Name" HeaderText="Part Name" HeaderButtonType="TextButton" DataField="Name"> </telerik:GridBoundColumn> </Columns> <PagerStyle AlwaysVisible="True" Mode="NumericPages"></PagerStyle> </telerik:GridTableView> </DetailTables> <Columns> <telerik:GridBoundColumn SortExpression="SpecimenID" HeaderText="SpecimenID" HeaderButtonType="TextButton" DataField="SpecimenID" /> <telerik:GridBoundColumn SortExpression="SpecimenName" HeaderText="Specimen Name" HeaderButtonType="TextButton" DataField="SpecimenName" /> </Columns> <PagerStyle AlwaysVisible="True"></PagerStyle> </MasterTableView> </telerik:RadGrid> </div>