protected void btnSubmit_Click(object sender, EventArgs e) { if (ddlGroup.SelectedIndex == 0) { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Select Group Code');", true); return; } if (txtPartyName.Text == string.Empty) { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Input Party Name');", true); return; } try { A2ZPARTYDTO objDTO = new A2ZPARTYDTO(); objDTO.GroupCode = Converter.GetInteger(ddlGroup.SelectedValue); objDTO.GroupName = Converter.GetString(ddlGroup.SelectedItem.Text); objDTO.PartyCode = Converter.GetInteger(txtPartyCode.Text); objDTO.PartyName = Converter.GetString(txtPartyName.Text); objDTO.PartyAddresssLine1 = Converter.GetString(txtPartyAddressL1.Text); objDTO.PartyAddresssLine2 = Converter.GetString(txtPartyAddressL2.Text); objDTO.PartyAddresssLine3 = Converter.GetString(txtPartyAddressL3.Text); objDTO.PartyMobileNo = Converter.GetString(txtMobileNo.Text); objDTO.PartyEmail = Converter.GetString(txtPartyEmail.Text); int roweffect = A2ZPARTYDTO.UpdateParty(objDTO); if (roweffect > 0) { ClearRecords(); ddlGroup.Focus(); } } catch (Exception Ex) { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Data not inserted');", true); return; } }
protected void btnSubmit_Click(object sender, EventArgs e) { A2ZPARTYDTO objDTO = new A2ZPARTYDTO(); objDTO.PartyCode = Converter.GetInteger(ddlPartyName.SelectedValue); objDTO.PartyName = Converter.GetString(txtPartyName.Text); objDTO.PartyAddresss = Converter.GetString(txtPartyAddress.Text); objDTO.PartyMobileNo = Converter.GetString(txtPartyPhone.Text); objDTO.PartyEmail = Converter.GetString(txtPartyEmail.Text); int roweffect = A2ZPARTYDTO.UpdateParty(objDTO); if (roweffect > 0) { Response.Redirect(Request.RawUrl); } }