protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GUIHelper.BindEnum2DropDownList(EmployeeStatusDropDownList, typeof(StatusEnum), true); } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["ContractTemplateId"] != null && Request.QueryString["action"] == "delete") { try { new ContractTemplateMapper().Delete(Convert.ToInt32(Request.QueryString["ContractTemplateId"])); } catch (Exception) { StringBuilder sb = new StringBuilder(); sb.Append("<script language='javascript'>displayNoty('This Contract template is being used by other entities and it cannot be deleted. Maybe you should change the status of the Contract template to Pasive.');</script>"); // if the script is not already registered if (!Page.ClientScript.IsClientScriptBlockRegistered(Page.GetType(), "HeyPopup")) { ClientScript.RegisterClientScriptBlock(Page.GetType(), "HeyPopup", sb.ToString()); } } } if (!IsPostBack) { GUIHelper.BindEnum2DropDownList(ContractStatusDropDownList, typeof(StatusEnum), true); } }
protected void Page_Load(object sender, EventArgs e) { //http://localhost:14994/HRM/HR-Managment/Definition/LeaveType/Edit.aspx?LeaveTypeNameId=3&action=delete&LeaveTypeId=15 if (Request.QueryString["LeaveTypeNameId"] != null && Request.QueryString["action"] == "delete") { new LeaveTypeLevelMapper().Delete(new Entities.LeaveTypeLevelEntity() { Id = Convert.ToInt32(Request.QueryString["LeaveTypeNameId"]) }); } if (!IsPostBack) { GUIHelper.BindEnum2DropDownList(TypeDropDownList, typeof(LeaveNameType), true); if (Request.QueryString["LeaveTypeId"] != null) { int LeaveTypeId; LeaveTypeEntity entity = new LeaveTypeEntity(); Int32.TryParse(Request.QueryString["LeaveTypeId"], out LeaveTypeId); entity.Id = LeaveTypeId; LeaveTypeMapper mapper = new LeaveTypeMapper(); entity = mapper.Get(entity); TitleTextBox.Text = entity.Title; DescriptionTextBox.Text = entity.Description; } } }