private void SetDataSources() { var allProducts = ProductOperations.GetAll()?.ItemList ?? new List <ProductDto>(); var branchProducts = ddlBranches.SelectedValue == "0" ? new List <ProductDto>() : ProductOperations.GetAllByStoreId(int.Parse(ddlBranches.SelectedValue)); RadListBoxSource.DataSource = branchProducts.Count > 0 ? allProducts.Where(p => !branchProducts.Contains(p)) : allProducts; RadListBoxSource.DataBind(); RadListBoxDestination.DataSource = branchProducts; RadListBoxDestination.DataBind(); }
protected void RadAutoCompleteBoxBpName_EntryAdded(object sender, Telerik.Web.UI.AutoCompleteEntryEventArgs e) { AutoCompleteBoxEntryCollection entries = ((RadAutoCompleteBox)sender).Entries; if (entries.Count != 0) { String selectedText = entries[0].Text; bpCode = StringFunctions.GetPartOfString(selectedText, " - ", 1); ViewState["bpCode"] = entries[0].Text; } else { bpCode = null; ViewState["bpCode"] = null; } RadListBoxSource.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { Page.MaintainScrollPositionOnPostBack = true; this.Page.Title = EnumPageTitles.APPNAME + EnumPageTitles.EXAMPROVIDER_EXAMDETAILS; //((LinkButton)this.Page.Master.FindControl("lnkExamDetails")).CssClass = "main_menu_active"; ((LinkButton)this.Page.Master.FindControl("lnkCourseDetails")).CssClass = "main_menu_active"; if (!IsPostBack) { DataTable dtHrs = GetHrsTable(); DataTable dtMin = GetMinTable(); if (Session["EP_Exam"] != null) { BECourseAdmin objBEExamProvider = (BECourseAdmin)Session["EP_Exam"]; // txtCourse.Text = objBEExamProvider.strCourseName; txtExam.Text = objBEExamProvider.strExamName; ddlHours.DataSource = dtHrs; ddlHours.DataTextField = "Hrs"; ddlHours.DataValueField = "Hrs"; ddlHours.DataBind(); string dlhours = ""; if (objBEExamProvider.ddlHours.ToString().Length < 2) { dlhours = "0" + objBEExamProvider.ddlHours.ToString(); } else { dlhours = objBEExamProvider.ddlHours.ToString(); } ddlHours.Items.FindItemByText(dlhours).Selected = true; // ddlMinutes.DataSource = dtMin; ddlMinutes.DataTextField = "Min"; ddlMinutes.DataValueField = "Min"; ddlMinutes.DataBind(); string dlmin = ""; if (objBEExamProvider.ddlMinutes.ToString().Length < 2) { dlmin = "0" + objBEExamProvider.ddlMinutes.ToString(); } else { dlmin = objBEExamProvider.ddlMinutes.ToString(); } ddlMinutes.Items.FindItemByText(dlmin).Selected = true; //lblHours.Text = objBEExamProvider.ddlHours.ToString(); //lblMinutes.Text = objBEExamProvider.ddlMinutes.ToString(); // lblDuration.Text = objBEExamProvider.ddlHM.ToString(); ddlBufferTime.DataSource = dtMin; ddlBufferTime.DataTextField = "Min"; ddlBufferTime.DataValueField = "Min"; ddlBufferTime.DataBind(); string ddlbuffer = ""; if (objBEExamProvider.IntBufferTime.ToString().Length < 2) { ddlbuffer = "0" + objBEExamProvider.IntBufferTime.ToString(); } else { ddlbuffer = objBEExamProvider.IntBufferTime.ToString(); } ddlBufferTime.Items.FindItemByText(ddlbuffer).Selected = true; txtAccessExam.InnerText = objBEExamProvider.strLinkAccessExam; CalendarExtender1.SelectedDate = Convert.ToDateTime(objBEExamProvider.strExamStartDate.ToShortDateString()); CalendarExtender2.SelectedDate = Convert.ToDateTime(objBEExamProvider.strExamEndDate.ToShortDateString()); //if (objBEExamProvider.intCalc.ToString() == "1") //{ // chkCalc.Checked = true; //} //else //{ // chkCalc.Checked = false; //} //if (objBEExamProvider.intStickyNotes.ToString() == "1") //{ // chkStickynotes.Checked = true; //} //else //{ // chkStickynotes.Checked = false; //} } Session["DT_Notes"] = null; Session["DT_Rules"] = null; //Session["EP_Exam"] = null; //DataTable dtHrs = GetHrsTable(); //DataTable dtMin = GetMinTable(); ddlHours.DataSource = dtHrs; ddlHours.DataTextField = "Hrs"; ddlHours.DataValueField = "Hrs"; ddlHours.DataBind(); // ddlMinutes.DataSource = dtMin; ddlMinutes.DataTextField = "Min"; ddlMinutes.DataValueField = "Min"; ddlMinutes.DataBind(); ddlBufferTime.DataSource = dtMin; ddlBufferTime.DataTextField = "Min"; ddlBufferTime.DataValueField = "Min"; ddlBufferTime.DataBind(); BECommon objBECommon = new BECommon(); objBECommon.IntUserID = Convert.ToInt32(Session[BaseClass.EnumPageSessions.USERID].ToString()); BCommon objBCommon = new BCommon(); objBCommon.BBindCourse(objBECommon); if (objBECommon.DtResult != null & objBECommon.DtResult.Rows.Count > 0) { ddlCourse.DataSource = objBECommon.DtResult; ddlCourse.DataTextField = "CourseName"; ddlCourse.DataValueField = "CourseID"; ddlCourse.DataBind(); } objBCommon.BBindSecurityLevel(objBECommon); if (objBECommon.DtResult != null & objBECommon.DtResult.Rows.Count > 0) { ddlExamSecurity.DataSource = objBECommon.DtResult; ddlExamSecurity.DataTextField = "Security Description"; ddlExamSecurity.DataValueField = "SecurityLevel"; ddlExamSecurity.DataBind(); } objBCommon.BBindAllTools(objBECommon); if (objBECommon.DtResult != null & objBECommon.DtResult.Rows.Count > 0) { RadListBoxSource.DataSource = objBECommon.DtResult; RadListBoxSource.DataTextField = "ToolName"; RadListBoxSource.DataValueField = "ToolID"; RadListBoxSource.DataBind(); } } }
protected void RadListBoxApplications_SelectedIndexChanged(object sender, EventArgs e) { RadListBoxSource.DataBind(); }