Exemplo n.º 1
0
 void InitialControlsValue()
 {
     if (HdInsertUpdate == false)
     {
         LtInsertUpdate.Text = "Cập nhật thông tin ngôn ngữ";
         top       = "1";
         fields    = "*";
         condition = LanguageNationalTSql.GetByiLanguageNationalId(iLanguageNationalId);
         order     = "";
         DataTable dt = new DataTable();
         dt = LanguageNational.GetLanguageNational(top, fields, condition, order);
         TbNameNational.Text = dt.Rows[0]["nLanguageNationalName"].ToString();
         ltimg.Text          = ImagesExtension.GetImage(pic, dt.Rows[0]["nLanguageNationalFlag"].ToString(), "", "", false, false, "");
         if (!dt.Rows[0]["nLanguageNationalFlag"].ToString().Equals(""))
         {
             LbDelFlagCurrent.Visible = true;
         }
         HdFlagNational.Value = dt.Rows[0]["nLanguageNationalFlag"].ToString();
         TbOrder.Text         = dt.Rows[0]["nLanguageNationalDesc"].ToString();
         if (dt.Rows[0]["iLanguageNationalEnable"].ToString().Equals("0"))
         {
             ChkStatus.Checked = false;
         }
         else
         {
             ChkStatus.Checked = true;
         }
         pnTiepTuc.Visible = false;
     }
     else
     {
         LtInsertUpdate.Text = "Thêm mới ngôn ngữ website";
         pnTiepTuc.Visible   = true;
     }
 }
Exemplo n.º 2
0
    void GetListLanguageNationals()
    {
        DataTable dt = new DataTable();

        dt = LanguageNational.GetLanguageNational("", "*", LanguageNationalTSql.GetByiLanguageNationalEnable("1"), LanguageNationalColumns.nLanguageNationalDesc + " desc");
        rptList.DataSource = dt;
        rptList.DataBind();
    }
Exemplo n.º 3
0
    protected void LbDelFlagCurrent_Click(object sender, EventArgs e)
    {
        string[] fields    = { "nLanguageNationalFlag" };
        string[] values    = { "''" };
        string   condition = LanguageNationalTSql.GetByiLanguageNationalId(iLanguageNationalId);

        LanguageNational.UpdateLanguageNational(DataExtension.UpdateTransfer(fields, values), condition);
        ImagesExtension.DeleteImageWhenDeleteItem(pic, HdFlagNational.Value);
    }
Exemplo n.º 4
0
    protected void TextChanged(object sender, EventArgs e)
    {
        TextBox textbox = sender as TextBox;

        string[] fields    = { "nLanguageNationalDesc" };
        string[] values    = { textbox.Text };
        string   condition = LanguageNationalTSql.GetByiLanguageNationalId(textbox.ToolTip);

        LanguageNational.UpdateLanguageNational(DataExtension.UpdateTransfer(fields, values), condition);
        GetListLanguageNationals();
    }
    private void LoadSourceLanguage()
    {
        ddlLanguageSource.Items.Clear();

        condition = LanguageNationalTSql.GetByiLanguageNationalEnable("1");
        orderby   = LanguageNationalColumns.iLanguageNationalId;

        DataTable dt = new DataTable();

        dt = LanguageNational.GetLanguageNational("", "*", condition, orderby, ddlWebSource.SelectedValue);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            ddlLanguageSource.Items.Add(new ListItem(dt.Rows[i][LanguageNationalColumns.nLanguageNationalName].ToString(), dt.Rows[i][LanguageNationalColumns.iLanguageNationalId].ToString()));
        }
    }
    private void LoadDestLanguage()
    {
        ddlLanguageDest.Items.Clear();

        condition = LanguageNationalTSql.GetByiLanguageNationalEnable("1");
        orderby   = LanguageNationalColumns.iLanguageNationalId;

        DataTable dt = new DataTable();

        dt = LanguageNational.GetLanguageNational("", "*", condition, orderby,
                                                  ConfigurationManager.AppSettings["WebName"]);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            ddlLanguageDest.Items.Add(new ListItem(dt.Rows[i][LanguageNationalColumns.nLanguageNationalName].ToString(), dt.Rows[i][LanguageNationalColumns.iLanguageNationalId].ToString()));
        }
    }
Exemplo n.º 7
0
    protected void RpListLanguageNationals_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string c = e.CommandName.Trim();
        string p = e.CommandArgument.ToString().Trim();

        switch (c)
        {
            #region delete
            //case "delete":
            //    if (!language.Equals(p))
            //    {
            //        LanguageNational.DeleteLanguageNationalAndLanguageItem(p);
            //    }
            //    else
            //    {
            //        ScriptManager.RegisterStartupScript(this, GetType(), "DeleteItem",
            //                                            "ThongBao(3000, 'Bạn đang sử dụng ngôn ngữ này vì vậy không thể xóa được!');",
            //                                            true);
            //    }
            //    break;
            #endregion

            #region Edit Status
        case "EditStatus":
            top       = "1";
            fields    = "iLanguageNationalEnable, nLanguageNationalName";
            condition = LanguageNationalTSql.GetByiLanguageNationalId(p);
            order     = "";
            DataTable dt = new DataTable();
            dt = LanguageNational.GetLanguageNational(top, fields, condition, order);

            string[] fieldsEditStatus = { "iLanguageNationalEnable" };
            string[] valuesEditStatus = { "" };
            if (dt.Rows[0]["iLanguageNationalEnable"].ToString().Equals("0"))
            {
                valuesEditStatus[0] = "1";
                LanguageNational.UpdateLanguageNational(DataExtension.UpdateTransfer(fieldsEditStatus, valuesEditStatus), condition);
            }
            else
            {
                valuesEditStatus[0] = "0";
                LanguageNational.UpdateLanguageNational(DataExtension.UpdateTransfer(fieldsEditStatus, valuesEditStatus), condition);
            }

            #region Logs
            string logAuthor     = CookieExtension.GetCookies("LoginSetting");
            string logCreateDate = DateTime.Now.ToString();
            Logs.InsertLogs(logCreateDate, Request.Url.ToString(), "", dt.Rows[0]["nLanguageNationalName"].ToString(), logAuthor, "", logCreateDate + ": " + logAuthor + " thay đổi trạng thái ngôn ngữ " + dt.Rows[0]["nLanguageNationalName"].ToString());
            #endregion

            GetListLanguageNationals();

            break;

            #endregion
            #region edit
        case "edit":
            Response.Redirect(LinkUpdate(p));
            break;
            #endregion
        }
    }