protected void BtnUpdate_Click(object sender, EventArgs e) { try { A2ZEMPLEAVETYPEDTO objDTO = new A2ZEMPLEAVETYPEDTO(); objDTO.LeaveCode = Converter.GetInteger(txtcode.Text); objDTO.LeaveName = Converter.GetString(txtLName.Text); objDTO.TotalDays = Converter.GetDecimal(txtTotalDays.Text); objDTO.EffectSalary = Converter.GetBoolean(ChkSalEffect.Checked); if (ddlLstatus.SelectedValue == "1") { objDTO.Status = Converter.GetBoolean(true); } else { objDTO.Status = Converter.GetBoolean(false); } int roweffect = A2ZEMPLEAVETYPEDTO.UpdateInformation(objDTO); if (roweffect > 0) { txtcode.Focus(); clearinfo(); dropdown(); gvDetail(); } } catch (Exception ex) { throw ex; } }
protected void ddlLType_SelectedIndexChanged(object sender, EventArgs e) { if (ddlLType.SelectedValue == "-Select-") { txtcode.Focus(); txtcode.Text = string.Empty; txtLName.Text = string.Empty; BtnSubmit.Visible = true; BtnUpdate.Visible = false; } try { if (ddlLType.SelectedValue != "-Select-") { int MainCode = Converter.GetInteger(ddlLType.SelectedValue); A2ZEMPLEAVETYPEDTO getDTO = (A2ZEMPLEAVETYPEDTO.GetInformation(MainCode)); if (getDTO.LeaveCode > 0) { txtcode.Text = Converter.GetString(getDTO.LeaveCode); txtLName.Text = Converter.GetString(getDTO.LeaveName); txtTotalDays.Text = Converter.GetString(getDTO.TotalDays); ChkSalEffect.Checked = Converter.GetBoolean(getDTO.EffectSalary); LeaveStatus.Text = Converter.GetString(getDTO.Status); if (LeaveStatus.Text == "False") { ddlLstatus.SelectedValue = "0"; } else { ddlLstatus.SelectedValue = "1"; } BtnSubmit.Visible = false; BtnUpdate.Visible = true; txtLName.Focus(); } else { txtcode.Focus(); txtcode.Text = string.Empty; txtLName.Text = string.Empty; BtnSubmit.Visible = true; BtnUpdate.Visible = false; } } } catch (Exception ex) { throw ex; } }