protected void BtnUpdate_Click(object sender, EventArgs e) { if (ddlDistrict.SelectedValue != "-Select-" && ddlDivision.SelectedValue != "-Select-" && ddlUpzila.SelectedValue != "-Select-" && ddlThana.SelectedValue != "-Select-") { A2ZTHANADTO UpDTO = new A2ZTHANADTO(); UpDTO.DivisionCode = Converter.GetInteger(hdnDiviCode.Text); UpDTO.DistrictCode = Converter.GetInteger(hdnDistCode.Text); UpDTO.UpzilaCode = Converter.GetInteger(hdnUpzilaCode.Text); UpDTO.ThanaCode = Converter.GetInteger(hdnThanaCode.Text); UpDTO.DivisionOrgCode = Converter.GetInteger(hdnDiviOrgCode.Text); UpDTO.DistrictOrgCode = Converter.GetInteger(hdnDistOrgCode.Text); UpDTO.UpzilaOrgCode = Converter.GetInteger(hdnUpzilaOrgCode.Text); UpDTO.ThanaOrgCode = Converter.GetInteger(hdnThanaOrgCode.Text); UpDTO.ThanaDescription = Converter.GetString(txtThanaDescription.Text); int roweffect = A2ZTHANADTO.UpdateInformation(UpDTO); if (roweffect > 0) { ThanaDropdown(); clearInfo(); gvDetail(); gvDetailInfo.Visible = false; txtThanaDescription.Focus(); BtnSubmit.Visible = true; BtnUpdate.Visible = false; } } }
protected void ddlThana_SelectedIndexChanged(object sender, EventArgs e) { try { if (ddlDistrict.SelectedValue != "-Select-" && ddlDivision.SelectedValue != "-Select-" && ddlUpzila.SelectedValue != "-Select-" && ddlThana.SelectedValue != "-Select-") { A2ZTHANADTO getDTO = new A2ZTHANADTO(); int code = Converter.GetInteger(ddlDivision.SelectedValue); int distcode = Converter.GetInteger(ddlDistrict.SelectedValue); int Upzilacode = Converter.GetInteger(ddlUpzila.SelectedValue); int thanacode = Converter.GetInteger(ddlThana.SelectedValue); getDTO = (A2ZTHANADTO.GetInformation(code, distcode, Upzilacode, thanacode)); if (getDTO.DivisionCode > 0 && getDTO.DistrictCode > 0 && getDTO.ThanaCode > 0) { hdnThanaCode.Text = Converter.GetString(getDTO.ThanaCode); hdnThanaOrgCode.Text = Converter.GetString(getDTO.ThanaOrgCode); txtThanaDescription.Text = Converter.GetString(getDTO.ThanaDescription); txtThanaDescription.Focus(); BtnSubmit.Visible = false; BtnUpdate.Visible = true; } } } catch (Exception ex) { throw ex; } }
protected void ddlThana_SelectedIndexChanged(object sender, EventArgs e) { if (ddlThana.SelectedItem.Text == "-Select-") { return; } try { if (ddlDistrict.SelectedValue != "-Select-" && ddlDivision.SelectedValue != "-Select-" && ddlUpzila.SelectedValue != "-Select-" && ddlThana.SelectedValue != "-Select-") { A2ZTHANADTO getDTO = new A2ZTHANADTO(); int code = Converter.GetInteger(ddlDivision.SelectedValue); int distcode = Converter.GetInteger(ddlDistrict.SelectedValue); int thanacode = Converter.GetInteger(ddlThana.SelectedValue); int Upzilacode = Converter.GetInteger(ddlUpzila.SelectedValue); getDTO = (A2ZTHANADTO.GetInformation(code, distcode, Upzilacode, thanacode)); if (getDTO.DivisionCode > 0 && getDTO.DistrictCode > 0 && getDTO.UpzilaCode > 0 && getDTO.ThanaCode > 0) { } } } catch (Exception ex) { throw ex; } }
protected void BtnSubmit_Click(object sender, EventArgs e) { if (ddlDistrict.SelectedValue != "-Select-" && ddlDivision.SelectedValue != "-Select-" && ddlUpzila.SelectedValue != "-Select-" && ddlThana.SelectedValue == "-Select-" && txtThanaDescription.Text != string.Empty) { gvDetail(); gvDetailInfo.Visible = false; int totrec = gvDetailInfo.Rows.Count; int lastThanaCode = (totrec + 1); int lastDistCode = Converter.GetInteger(hdnDistCode.Text); int lastUpzilaCode = Converter.GetInteger(hdnUpzilaCode.Text); hdnThanaCode.Text = Converter.GetString(lastThanaCode); hdnDistCode.Text = Converter.GetString(lastDistCode); hdnUpzilaCode.Text = Converter.GetString(lastUpzilaCode); if (lastUpzilaCode < 10) { hdnUpzilaCode.Text = Converter.GetString("0" + lastUpzilaCode); } if (lastDistCode < 10) { hdnDistCode.Text = Converter.GetString("0" + lastDistCode); } if (lastThanaCode < 10) { hdnThanaCode.Text = Converter.GetString("0" + lastThanaCode); } string result = hdnDiviCode.Text + hdnDistCode.Text + hdnUpzilaCode.Text + hdnThanaCode.Text; hdnThanaOrgCode.Text = Converter.GetString(result); A2ZTHANADTO objDTO = new A2ZTHANADTO(); objDTO.DivisionCode = Converter.GetInteger(hdnDiviCode.Text); objDTO.DistrictCode = Converter.GetInteger(hdnDistCode.Text); objDTO.UpzilaCode = Converter.GetInteger(hdnUpzilaCode.Text); objDTO.ThanaCode = Converter.GetInteger(hdnThanaCode.Text); objDTO.DivisionOrgCode = Converter.GetInteger(hdnDiviOrgCode.Text); objDTO.DistrictOrgCode = Converter.GetInteger(hdnDistOrgCode.Text); objDTO.UpzilaOrgCode = Converter.GetInteger(hdnUpzilaOrgCode.Text); objDTO.ThanaOrgCode = Converter.GetInteger(hdnThanaOrgCode.Text); objDTO.ThanaDescription = Converter.GetString(txtThanaDescription.Text); int roweffect = A2ZTHANADTO.InsertInformation(objDTO); if (roweffect > 0) { clearInfo(); ThanaDropdown(); gvDetail(); gvDetailInfo.Visible = false; txtThanaDescription.Focus(); BtnSubmit.Visible = true; BtnUpdate.Visible = false; } } }