예제 #1
0
    private void BindLanguagesOnTabLoad()
    {
        string    strLanguage = "";
        DataTable dt          = new DataTable();
        CommanlanguagesManager objLanguage = new CommanlanguagesManager();

        try
        {
            dt = objLanguage.SelectLanguageForField();
            if (dt.Rows.Count > 0)
            {
                int languagecount = 0;
                hdtotallanguage.Value = dt.Rows.Count.ToString();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    languagecount++;

                    strLanguage += "<input type='text' value='" + dt.Rows[i]["languageid"].ToString() + "' name='splangidtab" + (i + 1).ToString() + "' id='splangidtab" + (i + 1).ToString() + "' style='display:none;' />";
                    if (i == 0)
                    {
                        strLanguage += "<li class='active'><a href='#" + dt.Rows[i]["languageName"].ToString() + "' data-toggle='tab'>" + dt.Rows[i]["languageName"].ToString() + " </a></li>";
                    }
                    else
                    {
                        strLanguage += "<li ><a href='#" + dt.Rows[i]["languageName"].ToString() + "' data-toggle='tab'>" + dt.Rows[i]["languageName"].ToString() + " </a></li>";
                    }
                }
            }
            ltrtab.Text = strLanguage.ToString();
        }
        catch (Exception ex) { throw ex; }
        finally { dt.Clear(); dt.Dispose(); objLanguage = null; }
    }
예제 #2
0
    private void BindLanguagesOnPageLoad()
    {
        string    strLanguage = "";
        DataTable dt          = new DataTable();
        CommanlanguagesManager objLanguage = new CommanlanguagesManager();

        try
        {
            dt = objLanguage.SelectLanguageForField();
            if (dt.Rows.Count > 0)
            {
                int languagecount = 0;
                hdtotallanguage.Value = dt.Rows.Count.ToString();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    languagecount++;

                    if (i == 0)
                    {
                        strLanguage += "<input type='text' value='" + dt.Rows[i]["languageid"].ToString() + "' name='splangid" + (i + 1).ToString() + "' id='splangid" + (i + 1).ToString() + "' style='display:none;' />";
                        strLanguage += "<div class='tab-pane active' id='" + dt.Rows[i]["languageName"].ToString() + "'>";
                        strLanguage += "<div class='form-group'><label for='inputName' class='col-sm-12 control-label'>Brand  Name </label><div class='col-sm-12'><input type='text' class='form-control' id='txtbrandname" + (i + 1).ToString() + "' maxlength='100' name='txtbrandname" + (i + 1).ToString() + "'/><div id='brandmessage' style='color:red'></div></div></div>";
                        strLanguage += "<div class='form-group'><label for='inputName' class='col-sm-12 control-label'>Brand Description </label><div class='col-sm-12'><textarea class='form-control' id='txtbranddesname" + (i + 1).ToString() + "'  maxlength='500' name='txtbranddesname" + (i + 1).ToString() + "'></textarea></div></div>";
                        strLanguage += "</div>";
                    }
                    else
                    {
                        strLanguage += "<input type='text' value='" + dt.Rows[i]["languageid"].ToString() + "' name='splangid" + (i + 1).ToString() + "' id='splangid" + (i + 1).ToString() + "' style='display:none;' />";
                        strLanguage += "  <div class='tab-pane' id='" + dt.Rows[i]["languageName"].ToString() + "'>";
                        strLanguage += "<div class='form-group'><label for='inputName' class='col-sm-12 control-label'>اسم العلامة التجارية</label><div class='col-sm-12'><input type='text' class='form-control' id='txtbrandname" + (i + 1).ToString() + "' maxlength='100' name='txtbrandname" + (i + 1).ToString() + "'/></div></div>";
                        strLanguage += "<div class='form-group'><label for='inputName' class='col-sm-12 control-label'>وصف العلامة التجارية</label><div class='col-sm-12'><textarea class='form-control' id='txtbranddesname" + (i + 1).ToString() + "' maxlength='500' name='txtbranddesname" + (i + 1).ToString() + "'></textarea></div></div>";
                        strLanguage += "</div>";
                    }
                }
            }
            ltrcategorylanguages.Text = strLanguage.ToString();
        }
        catch (Exception ex) { throw ex; }
        finally { dt.Clear(); dt.Dispose(); objLanguage = null; }
    }