protected void ddlUpzila_SelectedIndexChanged(object sender, EventArgs e) { if (ddlUpzila.SelectedItem.Text == "-Select-") { return; } ThanaDropdown(); try { if (ddlDistrict.SelectedValue != "-Select-" && ddlDivision.SelectedValue != "-Select-" && ddlUpzila.SelectedValue != "-Select-") { A2ZUPZILADTO getDTO = new A2ZUPZILADTO(); int code = Converter.GetInteger(ddlDivision.SelectedValue); int distcode = Converter.GetInteger(ddlDistrict.SelectedValue); int Upzilacode = Converter.GetInteger(ddlUpzila.SelectedValue); getDTO = (A2ZUPZILADTO.GetInformation(code, distcode, Upzilacode)); if (getDTO.DivisionCode > 0 && getDTO.DistrictCode > 0 && getDTO.UpzilaCode > 0) { } } } catch (Exception ex) { throw ex; } }
protected void BtnUpdate_Click(object sender, EventArgs e) { if (ddlDistrict.SelectedValue != "-Select-" && ddlDivision.SelectedValue != "-Select-" && ddlUpzila.SelectedValue != "-Select-") { A2ZUPZILADTO UpDTO = new A2ZUPZILADTO(); UpDTO.DivisionCode = Converter.GetInteger(hdnDiviCode.Text); UpDTO.DistrictCode = Converter.GetInteger(hdnDistCode.Text); UpDTO.UpzilaCode = Converter.GetInteger(hdnUpzilaCode.Text); UpDTO.DivisionOrgCode = Converter.GetInteger(hdnDiviOrgCode.Text); UpDTO.DistrictOrgCode = Converter.GetInteger(hdnDistOrgCode.Text); UpDTO.UpzilaOrgCode = Converter.GetInteger(hdnUpzilaOrgCode.Text); UpDTO.UpzilaDescription = Converter.GetString(txtUpzilaDescription.Text); int roweffect = A2ZUPZILADTO.UpdateInformation(UpDTO); if (roweffect > 0) { UpzilaDropdown(); clearInfo(); gvDetail(); gvDetailInfo.Visible = false; BtnSubmit.Visible = true; BtnUpdate.Visible = false; txtUpzilaDescription.Focus(); } } }
protected void ddlUpzila_SelectedIndexChanged(object sender, EventArgs e) { try { if (ddlDistrict.SelectedValue != "-Select-" && ddlDivision.SelectedValue != "-Select-" && ddlUpzila.SelectedValue != "-Select-") { A2ZUPZILADTO getDTO = new A2ZUPZILADTO(); int code = Converter.GetInteger(ddlDivision.SelectedValue); int distcode = Converter.GetInteger(ddlDistrict.SelectedValue); int Upzilacode = Converter.GetInteger(ddlUpzila.SelectedValue); getDTO = (A2ZUPZILADTO.GetInformation(code, distcode, Upzilacode)); if (getDTO.DivisionCode > 0 && getDTO.DistrictCode > 0 && getDTO.UpzilaCode > 0) { hdnUpzilaCode.Text = Converter.GetString(getDTO.UpzilaCode); hdnUpzilaOrgCode.Text = Converter.GetString(getDTO.UpzilaOrgCode); txtUpzilaDescription.Text = Converter.GetString(getDTO.UpzilaDescription); txtUpzilaDescription.Focus(); BtnSubmit.Visible = false; BtnUpdate.Visible = true; } } } catch (Exception ex) { throw ex; } }
protected void txtUpzilacode_TextChanged(object sender, EventArgs e) { try { if (ddlUpzila.SelectedItem.Text == "-Select-") { txtUpzilacode.Focus(); } if (txtUpzilacode.Text != string.Empty && ddlDivision.SelectedValue != "-Select-") { A2ZUPZILADTO getDTO = new A2ZUPZILADTO(); int code = Converter.GetInteger(txtcode.Text); int DistCode = Converter.GetInteger(txtDistcode.Text); int UpzilaCode = Converter.GetInteger(txtUpzilacode.Text); getDTO = (A2ZUPZILADTO.GetInformation(code, DistCode, UpzilaCode)); if (getDTO.DivisionCode > 0 && getDTO.DistrictCode > 0 && getDTO.UpzilaCode > 0) { ddlUpzila.SelectedValue = Converter.GetString(getDTO.UpzilaCode); hdnUpzilaCode.Text = Converter.GetString(getDTO.UpzilaCode); hdnUpzilaOrgCode.Text = Converter.GetString(getDTO.UpzilaOrgCode); ThanaDropdown(); BtnSubmit.Visible = true; BtnUpdate.Visible = false; txtThanaDescription.Focus(); } else { //String csname1 = "PopupScript"; //Type cstype = GetType(); //ClientScriptManager cs = Page.ClientScript; //if (!cs.IsStartupScriptRegistered(cstype, csname1)) //{ // String cstext1 = "alert('Invalid Upzila Code');"; // cs.RegisterStartupScript(cstype, csname1, cstext1, true); //} txtUpzilacode.Text = string.Empty; txtUpzilacode.Focus(); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Invalid District Code');", true); return; } } } catch (Exception ex) { throw ex; } }
protected void BtnSubmit_Click(object sender, EventArgs e) { if (ddlDistrict.SelectedValue != "-Select-" && ddlDivision.SelectedValue != "-Select-" && ddlUpzila.SelectedValue == "-Select-" && txtUpzilaDescription.Text != string.Empty) { gvDetail(); gvDetailInfo.Visible = false; int totrec = gvDetailInfo.Rows.Count; int lastUpzilaCode = (totrec + 1); int lastDistCode = Converter.GetInteger(hdnDistCode.Text); hdnUpzilaCode.Text = Converter.GetString(lastUpzilaCode); if (lastUpzilaCode < 10) { hdnUpzilaCode.Text = Converter.GetString("0" + lastUpzilaCode); } if (lastDistCode < 10) { hdnDistCode.Text = Converter.GetString("0" + lastDistCode); } string result = hdnDiviCode.Text + hdnDistCode.Text + hdnUpzilaCode.Text + "00"; hdnUpzilaOrgCode.Text = Converter.GetString(result); A2ZUPZILADTO objDTO = new A2ZUPZILADTO(); objDTO.DivisionCode = Converter.GetInteger(hdnDiviCode.Text); objDTO.DistrictCode = Converter.GetInteger(hdnDistCode.Text); objDTO.UpzilaCode = Converter.GetInteger(hdnUpzilaCode.Text); objDTO.DivisionOrgCode = Converter.GetInteger(hdnDiviOrgCode.Text); objDTO.DistrictOrgCode = Converter.GetInteger(hdnDistOrgCode.Text); objDTO.UpzilaOrgCode = Converter.GetInteger(hdnUpzilaOrgCode.Text); objDTO.UpzilaDescription = Converter.GetString(txtUpzilaDescription.Text); int roweffect = A2ZUPZILADTO.InsertInformation(objDTO); if (roweffect > 0) { clearInfo(); UpzilaDropdown(); gvDetail(); gvDetailInfo.Visible = false; BtnSubmit.Visible = true; BtnUpdate.Visible = false; txtUpzilaDescription.Focus(); } } }
protected void ddlUpzila_SelectedIndexChanged(object sender, EventArgs e) { if (ddlUpzila.SelectedItem.Text == "-Select-") { clearInfo(); txtUpzilacode.Focus(); BtnSubmit.Visible = true; BtnUpdate.Visible = false; txtUpzilacode.Text = string.Empty; return; } ThanaDropdown(); try { if (ddlDistrict.SelectedValue != "-Select-" && ddlDivision.SelectedValue != "-Select-" && ddlUpzila.SelectedValue != "-Select-") { A2ZUPZILADTO getDTO = new A2ZUPZILADTO(); int code = Converter.GetInteger(ddlDivision.SelectedValue); int distcode = Converter.GetInteger(ddlDistrict.SelectedValue); int Upzila = Converter.GetInteger(ddlUpzila.SelectedValue); getDTO = (A2ZUPZILADTO.GetInformation(code, distcode, Upzila)); if (getDTO.DivisionCode > 0 && getDTO.DistrictCode > 0 && getDTO.UpzilaCode > 0) { txtUpzilacode.Text = Converter.GetString(getDTO.UpzilaCode); hdnUpzilaCode.Text = Converter.GetString(getDTO.UpzilaCode); hdnUpzilaOrgCode.Text = Converter.GetString(getDTO.UpzilaOrgCode); BtnSubmit.Visible = true; BtnUpdate.Visible = false; txtThanaDescription.Focus(); //txtDistDescription.Text = Converter.GetString(getDTO.DistrictDescription); //txtDistDescription.Focus(); } else { // ddlThana.SelectedValue = "-Select-"; //txtThanaDescription.Text = string.Empty; } //BtnSubmit.Visible = false; //BtnUpdate.Visible = true; } } catch (Exception ex) { throw ex; } }