protected void ddlPartyName_SelectedIndexChanged(object sender, EventArgs e) { if (ddlPartyName.SelectedIndex != 0) { int PartyCode = Converter.GetInteger(ddlPartyName.SelectedValue); A2ZLOANPARTYDTO getDTO = (A2ZLOANPARTYDTO.GetLoanPartyByPartyCode(PartyCode)); if (getDTO.LPartyName != string.Empty) { txtPartyCode.Text = Converter.GetString(getDTO.LPartyCode); } } }
protected void txtPartyCode_TextChanged(object sender, EventArgs e) { if (txtPartyCode.Text != string.Empty) { int PartyCode = Converter.GetInteger(txtPartyCode.Text); A2ZLOANPARTYDTO getDTO = (A2ZLOANPARTYDTO.GetLoanPartyByPartyCode(PartyCode)); if (getDTO.LPartyName == null) { txtPartyName.Text = string.Empty; txtPartyCode.Text = string.Empty; txtPartyCode.Focus(); } else { txtPartyName.Text = Converter.GetString(getDTO.LPartyName); } } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (txtPartyName.Text == string.Empty) { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Input Party Name');", true); return; } if (txtMobileNo.Text == string.Empty) { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Input Party Mobile No.');", true); return; } if (txtPartyEmail.Text == string.Empty) { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Input Party Email');", true); return; } if (txtPartyAddressL1.Text == string.Empty) { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Input Address');", true); return; } try { A2ZRECCTRLDTO getDTO = (A2ZRECCTRLDTO.GetLastRecords(1)); lblLastLPartyNo.Text = Converter.GetString(getDTO.CtrlRecLastNo); GenerateNewLPartyNo(); A2ZLOANPARTYDTO objDTO = new A2ZLOANPARTYDTO(); objDTO.LPartyCode = Converter.GetInteger(lblNewLPartyNo.Text); objDTO.LPartyName = Converter.GetString(txtPartyName.Text); objDTO.LPartyAddresssLine1 = Converter.GetString(txtPartyAddressL1.Text); objDTO.LPartyAddresssLine2 = Converter.GetString(txtPartyAddressL2.Text); objDTO.LPartyAddresssLine3 = Converter.GetString(txtPartyAddressL3.Text); objDTO.LPartyMobileNo = Converter.GetString(txtMobileNo.Text); objDTO.LPartyEmail = Converter.GetString(txtPartyEmail.Text); int roweffect = A2ZLOANPARTYDTO.InsertInformation(objDTO); if (roweffect > 0) { UpdatedMSG(); ClearRecords(); txtPartyName.Focus(); //Response.Redirect(Request.RawUrl); } } catch (Exception Ex) { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Data not inserted');", true); return; } }