protected void ddlOccupation_SelectedIndexChanged(object sender, EventArgs e) { try { if (ddlOccupation.SelectedValue == "-Select-") { clearInfo(); ddlOccupation.SelectedIndex = 0; return; } if (ddlOccupation.SelectedValue != "-Select-") { Int16 code = Converter.GetSmallInteger(ddlOccupation.SelectedValue); A2ZPROFESSIONDTO getDTO = (A2ZPROFESSIONDTO.GetInformation(code)); if (getDTO.ProfessionCode > 0) { //txtcode.Text = Converter.GetString(getDTO.DivisionCode); //txtDistcode.Focus(); //clearInfo(); } else { // ddlOccupation.SelectedValue = "-Select-"; //ddlDistrict.SelectedIndex = 0; } } } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.ddlOccupation_SelectedIndexChanged Problem');</script>"); throw ex; } }
protected void BtnSubmit_Click(object sender, EventArgs e) { try { if (ddlProfession.SelectedValue == "-Select-" && txtDescription.Text != string.Empty) { gvDetail(); gvDetailInfo.Visible = false; int totrec = gvDetailInfo.Rows.Count; int lastCode = (totrec); txtcode.Text = Converter.GetString(lastCode); A2ZPROFESSIONDTO objDTO = new A2ZPROFESSIONDTO(); objDTO.ProfessionCode = Converter.GetSmallInteger(txtcode.Text); objDTO.ProfessionDescription = Converter.GetString(txtDescription.Text); int roweffect = A2ZPROFESSIONDTO.InsertInformation(objDTO); if (roweffect > 0) { txtcode.Focus(); clearinfo(); dropdown(); } } } catch (Exception ex) { throw ex; } }
protected void ddlOccupation_SelectedIndexChanged(object sender, EventArgs e) { if (ddlOccupation.SelectedValue == "-Select-") { clearInfo(); ddlOccupation.SelectedIndex = 0; return; } try { if (ddlOccupation.SelectedValue != "-Select-") { Int16 code = Converter.GetSmallInteger(ddlOccupation.SelectedValue); A2ZPROFESSIONDTO getDTO = (A2ZPROFESSIONDTO.GetInformation(code)); if (getDTO.ProfessionCode > 0) { //txtcode.Text = Converter.GetString(getDTO.DivisionCode); //txtDistcode.Focus(); //clearInfo(); } else { // ddlOccupation.SelectedValue = "-Select-"; //ddlDistrict.SelectedIndex = 0; } } } catch (Exception ex) { throw ex; } }
protected void BtnUpdate_Click(object sender, EventArgs e) { if (ddlProfession.SelectedValue != "-Select-") { A2ZPROFESSIONDTO UpDTO = new A2ZPROFESSIONDTO(); UpDTO.ProfessionCode = Converter.GetSmallInteger(txtcode.Text); UpDTO.ProfessionDescription = Converter.GetString(txtDescription.Text); int roweffect = A2ZPROFESSIONDTO.UpdateInformation(UpDTO); if (roweffect > 0) { dropdown(); clearinfo(); // ddlProfession.SelectedValue = "-Select-"; BtnSubmit.Visible = true; BtnUpdate.Visible = false; txtcode.Focus(); } } }
protected void ddlProfession_SelectedIndexChanged(object sender, EventArgs e) { if (ddlProfession.SelectedValue == "-Select-") { txtcode.Focus(); txtcode.Text = string.Empty; txtDescription.Text = string.Empty; BtnSubmit.Visible = true; BtnUpdate.Visible = false; } try { if (ddlProfession.SelectedValue != "-Select-") { Int16 MainCode = Converter.GetSmallInteger(ddlProfession.SelectedValue); A2ZPROFESSIONDTO getDTO = (A2ZPROFESSIONDTO.GetInformation(MainCode)); if (getDTO.ProfessionCode > 0) { txtcode.Text = Converter.GetString(getDTO.ProfessionCode); txtDescription.Text = Converter.GetString(getDTO.ProfessionDescription); BtnSubmit.Visible = false; BtnUpdate.Visible = true; txtDescription.Focus(); } else { txtcode.Focus(); txtcode.Text = string.Empty; txtDescription.Text = string.Empty; BtnSubmit.Visible = true; BtnUpdate.Visible = false; } } } catch (Exception ex) { throw ex; } }