Esempio n. 1
0
        protected void ddlReligion_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (ddlReligion.SelectedValue == "-Select-")
                {
                    clearInfo();
                    ddlReligion.SelectedIndex = 0;
                    return;
                }


                if (ddlReligion.SelectedValue != "-Select-")
                {
                    Int16          code   = Converter.GetSmallInteger(ddlReligion.SelectedValue);
                    A2ZRELIGIONDTO getDTO = (A2ZRELIGIONDTO.GetInformation(code));
                    if (getDTO.RelegionCode > 0)
                    {
                        //txtcode.Text = Converter.GetString(getDTO.DivisionCode);
                        //txtDistcode.Focus();
                        //clearInfo();
                    }
                    else
                    {
                        //ddlDistrict.SelectedIndex = 0;
                    }
                }
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.ddlReligion_SelectedIndexChanged Problem');</script>");
                //throw ex;
            }
        }
        protected void ddlReligion_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlReligion.SelectedValue == "-Select-")
            {
                clearInfo();
                ddlReligion.SelectedIndex = 0;
                return;
            }

            try
            {
                if (ddlReligion.SelectedValue != "-Select-")
                {
                    Int16          code   = Converter.GetSmallInteger(ddlReligion.SelectedValue);
                    A2ZRELIGIONDTO getDTO = (A2ZRELIGIONDTO.GetInformation(code));
                    if (getDTO.RelegionCode > 0)
                    {
                        //txtcode.Text = Converter.GetString(getDTO.DivisionCode);
                        //txtDistcode.Focus();
                        //clearInfo();
                    }
                    else
                    {
                        //ddlDistrict.SelectedIndex = 0;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        protected void BtnUpdate_Click(object sender, EventArgs e)
        {
            A2ZRELIGIONDTO UpDTO = new A2ZRELIGIONDTO();

            UpDTO.RelegionCode        = Converter.GetSmallInteger(txtcode.Text);
            UpDTO.RelegionDescription = Converter.GetString(txtDescription.Text);

            int roweffect = A2ZRELIGIONDTO.UpdateInformation(UpDTO);

            if (roweffect > 0)
            {
                dropdown();
                clearinfo();
                //   ddlReligion.SelectedValue = "-Select-";
                BtnSubmit.Visible = true;
                BtnUpdate.Visible = false;
                txtcode.Focus();
                gvDetail();
            }
        }
        protected void ddlReligion_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlReligion.SelectedValue == "-Select-")
            {
                txtcode.Focus();
                txtcode.Text        = string.Empty;
                txtDescription.Text = string.Empty;
                BtnSubmit.Visible   = true;
                BtnUpdate.Visible   = false;
            }

            try
            {
                if (ddlReligion.SelectedValue != "-Select-")
                {
                    Int16          MainCode = Converter.GetSmallInteger(ddlReligion.SelectedValue);
                    A2ZRELIGIONDTO getDTO   = (A2ZRELIGIONDTO.GetInformation(MainCode));
                    if (getDTO.RelegionCode > 0)
                    {
                        txtcode.Text        = Converter.GetString(getDTO.RelegionCode);
                        txtDescription.Text = Converter.GetString(getDTO.RelegionDescription);
                        BtnSubmit.Visible   = false;
                        BtnUpdate.Visible   = true;
                        txtDescription.Focus();
                    }
                    else
                    {
                        txtcode.Focus();
                        txtcode.Text        = string.Empty;
                        txtDescription.Text = string.Empty;
                        BtnSubmit.Visible   = true;
                        BtnUpdate.Visible   = false;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        protected void BtnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                A2ZRELIGIONDTO objDTO = new A2ZRELIGIONDTO();

                objDTO.RelegionCode        = Converter.GetSmallInteger(txtcode.Text);
                objDTO.RelegionDescription = Converter.GetString(txtDescription.Text);

                int roweffect = A2ZRELIGIONDTO.InsertInformation(objDTO);
                if (roweffect > 0)
                {
                    txtcode.Focus();
                    clearinfo();
                    dropdown();
                    gvDetail();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }