protected void Page_Load(object sender, EventArgs e) { string roleTypeID = Request.QueryString["roleTypeID"] as string; if (roleTypeID == null) { Response.Redirect("Z_RoleTypeDefault.aspx"); } try { roleTypeRoleTypeID = Convert.ToInt32(roleTypeID.Trim()); roleTypeHandler = new RoleTypeHandler(); RoleType roleType = roleTypeHandler.GetDetails(roleTypeRoleTypeID); lblRoleTypeID.Text = roleType.RoleTypeID.ToString(); lblFactor.Text = roleType.Factor.ToString(); lblTitle.Text = roleType.Title.ToString(); } catch (Exception) { Response.Redirect("Z_RoleTypeDefault.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { lblResult.Text = string.Empty; roleTypeHandler = new RoleTypeHandler(); if (IsPostBack == false) { BindData(); } }
protected void btnYES_Click(object sender, EventArgs e) { RoleType roleType = new RoleType(); roleType.Title = txtTitle.Text; RoleTypeHandler roleTypeHandler = new RoleTypeHandler(); if (roleTypeHandler.Insert(roleType) > 0) { Response.Redirect("Z_RoleTypeDefault.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { ContractTypeHandler contractTypeHandler = new ContractTypeHandler(); List <ContractType> contractTypeList = contractTypeHandler.GetListAll(); DataTable contractTypeTable = new DataTable(); contractTypeTable.Columns.Add("ContractTypeID"); if (contractTypeList != null) { foreach (ContractType contractType in contractTypeList) { contractTypeTable.Rows.Add(contractType.ContractTypeID); } } if (!IsPostBack) { ddlContractTypeID.DataSource = contractTypeTable; ddlContractTypeID.DataTextField = "ContractTypeID"; ddlContractTypeID.DataValueField = "ContractTypeID"; ddlContractTypeID.DataBind(); } DepartmentHandler departmentHandler = new DepartmentHandler(); List <Department> departmentList = departmentHandler.GetListAll(); DataTable departmentTable = new DataTable(); departmentTable.Columns.Add("DepartmentID"); if (departmentList != null) { foreach (Department department in departmentList) { departmentTable.Rows.Add(department.DepartmentID); } } if (!IsPostBack) { ddlDepartmentID.DataSource = departmentTable; ddlDepartmentID.DataTextField = "DepartmentID"; ddlDepartmentID.DataValueField = "DepartmentID"; ddlDepartmentID.DataBind(); } RoleTypeHandler roleTypeHandler = new RoleTypeHandler(); List <RoleType> roleTypeList = roleTypeHandler.GetListAll(); DataTable roleTypeTable = new DataTable(); roleTypeTable.Columns.Add("RoleTypeID"); if (roleTypeList != null) { foreach (RoleType roleType in roleTypeList) { roleTypeTable.Rows.Add(roleType.RoleTypeID); } } if (!IsPostBack) { ddlRoleTypeID.DataSource = roleTypeTable; ddlRoleTypeID.DataTextField = "RoleTypeID"; ddlRoleTypeID.DataValueField = "RoleTypeID"; ddlRoleTypeID.DataBind(); } }