2018-12-13 09:09:17 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Web;
|
|
|
|
|
|
using System.Web.UI;
|
|
|
|
|
|
using System.Web.UI.WebControls;
|
2020-04-08 12:05:08 +02:00
|
|
|
|
using Telerik.Web.UI;
|
2018-12-13 09:09:17 +01:00
|
|
|
|
|
|
|
|
|
|
namespace Rems2018
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class Worker : System.Web.UI.Page
|
|
|
|
|
|
{
|
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
2019-01-24 11:17:20 +01:00
|
|
|
|
//Zet titel op masterpage
|
|
|
|
|
|
Literal titelControl = Master.FindControl("PageTitle") as Literal;
|
|
|
|
|
|
titelControl.Text = "Workers";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected bool isChecked(object b)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (b is bool) return (bool)b; else return false;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void cmbPerson_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
RadDataForm1.DataBind();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected void cmbPerson_DataBound(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
RadDataForm1.DataBind();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-08 12:05:08 +02:00
|
|
|
|
|
|
|
|
|
|
protected void rs_DataSourceSelect(object sender, Telerik.Web.UI.SearchBoxDataSourceSelectEventArgs e)
|
2019-01-24 11:17:20 +01:00
|
|
|
|
{
|
2020-04-08 12:05:08 +02:00
|
|
|
|
SqlDataSource source = (SqlDataSource)e.DataSource;
|
|
|
|
|
|
var searchBox = sender as RadSearchBox;
|
2019-01-24 11:17:20 +01:00
|
|
|
|
|
2020-04-08 12:05:08 +02:00
|
|
|
|
//string likeCondition = string.Format("'{0}' + @filterString + '%'", searchBox.Filter == SearchBoxFilter.Contains ? "%" : "");
|
|
|
|
|
|
//string countCondition = e.ShowAllResults ? " " : " TOP 100 ";
|
|
|
|
|
|
//source.SelectCommand = string.Format("SELECT {0}* FROM [Products] WHERE [" + searchBox.DataTextField + "] LIKE {1}", countCondition, likeCondition);
|
2019-01-24 11:17:20 +01:00
|
|
|
|
|
2020-04-08 12:05:08 +02:00
|
|
|
|
//if (e.SelectedContextItem != null)
|
|
|
|
|
|
// source.SelectParameters["key"].DefaultValue = e.SelectedContextItem.Key;
|
|
|
|
|
|
//else
|
|
|
|
|
|
// source.SelectParameters["key"].DefaultValue = "*";
|
2019-01-24 11:17:20 +01:00
|
|
|
|
|
2020-04-08 12:05:08 +02:00
|
|
|
|
source.SelectParameters["search"].DefaultValue = searchBox.Text.Replace("'", "''");
|
2019-01-24 11:17:20 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-08 12:05:08 +02:00
|
|
|
|
protected void rs_Search(object sender, SearchBoxEventArgs e)
|
2019-01-24 11:17:20 +01:00
|
|
|
|
{
|
2020-04-08 12:05:08 +02:00
|
|
|
|
int persid = 0;
|
|
|
|
|
|
if (e.Value != null)
|
|
|
|
|
|
hPersID.Value = e.Value;
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (int.TryParse(e.Text, out persid))
|
|
|
|
|
|
{
|
|
|
|
|
|
hPersID.Value = persid.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
RadDataForm1.DataBind();
|
2018-12-13 09:09:17 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|