Пример #1
0
    protected void btnSubmit2_Click(object sender, EventArgs e)
    {
        string strCoutryText2 = txtCountryText2.Text.Replace(Environment.NewLine, "<br />");
        //  Response.Write(strCoutryText2);
        DataTable dt = VADBCommander.CountryTextInd(countryid.ToString(), Convert.ToString(ViewState["firstCategory"]));

        try
        {
            if (dt.Rows.Count > 0)
            {
                VADBCommander.CountryText2Edit(countryid.ToString(), strCoutryText2, Convert.ToString(ViewState["firstCategory"]));
            }
            else
            {
                VADBCommander.CountryText2Add(countryid.ToString(), strCoutryText2, Convert.ToString(ViewState["firstCategory"]));
            }
            lblInfo2.Text = "Data saved.";
            DataTable dt4 = VADBCommander.CountryTextInd(countryid.ToString(), Convert.ToString(ViewState["firstCategory"]));
            if (dt4.Rows.Count > 0)
            {
                if (dt4.Rows[0]["CountryText"] != null)
                {
                    lblCountryInfo.Text = dt4.Rows[0]["CountryText"].ToString();
                    txtCountryText.Text = dt4.Rows[0]["CountryText"].ToString().Replace("<br />-ipx-", Environment.NewLine);
                }
                if (dt4.Rows[0]["CountryText2"] != null)
                {
                    lblInfo2.Text = dt4.Rows[0]["CountryText2"].ToString();
                    if (string.IsNullOrEmpty(lblInfo2.Text) || lblInfo2.Text == "")
                    {
                        OrangeTitle.Visible = false;
                    }
                    txtCountryText2.Text = dt4.Rows[0]["CountryText2"].ToString().Replace("<br />", Environment.NewLine);
                }
                else
                {
                    OrangeTitle.Visible = false;
                }
            }
            else
            {
                OrangeTitle.Visible = false;
            }
        }
        catch (Exception ex)
        {
            lblInfo2.Text = ex.Message;
        }
        lblInfo2.ForeColor = System.Drawing.Color.Red;
    }
Пример #2
0
    protected void btnSubmit2_Click(object sender, EventArgs e)
    {
        string    strCoutryText2 = txtCountryText2.Text.Replace(Environment.NewLine, "<br />");
        DataTable dt             = VADBCommander.GetMainCountryText(countryid.ToString());

        try
        {
            if (dt.Rows.Count > 0)
            {
                VADBCommander.CountryText2Edit(countryid.ToString(), strCoutryText2, null);
            }
            else
            {
                VADBCommander.CountryText2Add(countryid.ToString(), strCoutryText2, null);
            }
            lblerrormsg.Text = "Data Saved successfully";
            lblInfo.Text     = string.Empty;
            DataTable dt4 = VADBCommander.GetMainCountryText(countryid.ToString());
            if (dt4.Rows.Count > 0)
            {
                if (dt4.Rows[0]["CountryText"] != null)
                {
                    lblCountryInfo.Text = dt4.Rows[0]["CountryText"].ToString();
                    txtCountryText.Text = dt4.Rows[0]["CountryText"].ToString().Replace("<br />-ipx-", Environment.NewLine);
                }
                if (dt4.Rows[0]["CountryText2"] != null)
                {
                    lblInfo2.Text        = dt4.Rows[0]["CountryText2"].ToString();
                    txtCountryText2.Text = dt4.Rows[0]["CountryText2"].ToString().Replace("<br />", Environment.NewLine);
                }
            }
            BindCountryFirst();
        }
        catch (Exception ex)
        {
            lblerrormsg.Text = ex.Message;
        }
    }