protected void BtnDesUpdate_Click(object sender, EventArgs e) { try { A2ZACCFIELDSDTO UpDTO = new A2ZACCFIELDSDTO(); UpDTO.Flag = Converter.GetSmallInteger(ddlFlag.SelectedValue); UpDTO.Code = Converter.GetSmallInteger(txtcode.Text); UpDTO.Description = Converter.GetString(txtDescription.Text); int roweffect = A2ZACCFIELDSDTO.UpdateInformation(UpDTO); if (roweffect > 0) { gvDetail(); dropdown(); clearinfo(); ddlDesc.SelectedValue = "-Select-"; BtnDesSubmit.Visible = true; BtnDesUpdate.Visible = false; txtcode.Focus(); } } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.BtnDesUpdate_Click Problem');</script>"); //throw ex; } }
protected void ddlDesc_SelectedIndexChanged(object sender, EventArgs e) { try { if (ddlDesc.SelectedValue == "-Select-") { txtcode.Focus(); txtcode.Text = string.Empty; txtDescription.Text = string.Empty; BtnDesSubmit.Visible = true; BtnDesUpdate.Visible = false; } if (ddlDesc.SelectedValue != "-Select-") { Int16 flag = Converter.GetSmallInteger(ddlFlag.SelectedValue); Int16 MainCode = Converter.GetSmallInteger(ddlDesc.SelectedValue); A2ZACCFIELDSDTO getDTO = (A2ZACCFIELDSDTO.GetInformation(MainCode, flag)); if (getDTO.Code > 0 && getDTO.Flag > 0) { txtcode.Text = Converter.GetString(getDTO.Code); txtDescription.Text = Converter.GetString(getDTO.Description); BtnDesSubmit.Visible = false; BtnDesUpdate.Visible = true; txtDescription.Focus(); } else { txtcode.Focus(); txtcode.Text = string.Empty; txtDescription.Text = string.Empty; BtnDesSubmit.Visible = true; BtnDesUpdate.Visible = false; } } } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.ddlDesc_SelectedIndexChanged Problem');</script>"); //throw ex; } }