/// <summary>
    /// Kiểm tra xem thuộc tính được chọn có phải là thuộc tính cha hợp lệ không (hợp lệ: có thuộc tính con, thuộc tính con đó không có con)
    /// </summary>
    /// <param name="igid">igid cần kiểm tra</param>
    /// <returns></returns>
    bool ThuocTinhChaHopLe(string igid)
    {
        condition = GroupsTSql.GetGroupsByIgid(igid);
        fields    = TatThanhJsc.Columns.GroupsColumns.IgparentsidColumn;
        DataTable dt = new DataTable();

        dt = Groups.GetGroups("", fields, condition, "");
        string igCurrentIgparentIds = dt.Rows[0][GroupsColumns.IgparentsidColumn].ToString();//Lấy danh sách cha của danh mục hiện tại

        //Lấy danh sách tất cả con của danh mục hiện tại
        condition = DataExtension.AndConditon(
            "charindex(','+cast(" + igid + " as varchar(10))+','," + TatThanhJsc.Columns.GroupsColumns.IgparentsidColumn + ") >0",
            GroupsColumns.IgenableColumn + "<>2");
        dt = Groups.GetGroups("", fields, condition, "");
        string listIgparentsId = "";

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            listIgparentsId += dt.Rows[i][GroupsColumns.IgparentsidColumn].ToString().Replace(igCurrentIgparentIds, "");
        }
        int soDauPhay = listIgparentsId.Split(new string[] { "," }, StringSplitOptions.None).Length;

        if (soDauPhay == dt.Rows.Count && dt.Rows.Count > 1)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
 void UpdateOrder()
 {
     string[] fieldsDelGroup = { "IGORDER" };
     string[] valuesDelGroup = { igorder };
     condition = DataExtension.AndConditon(GroupsTSql.GetGroupsByIgid(igid));
     Groups.UpdateGroupsCondition(DataExtension.UpdateTransfer(fieldsDelGroup, valuesDelGroup), condition);
 }
    void InitialControlsValue(bool insert)
    {
        #region update
        if (!insert)
        {
            LtInsertUpdate.Text    = Developer.SupportOnlineKeyword.CapNhatDanhMuc;
            btn_insert_update.Text = "Đồng ý";
            ckbContinue.Visible    = false;
            fields    = "*";
            condition = GroupsTSql.GetGroupsByIgid(igid);
            DataTable dt = new DataTable();
            dt = Groups.GetGroups(top, fields, condition, orderBy);

            txt_title_modul.Text = dt.Rows[0]["VGNAME"].ToString();
            txt_ordermodul.Text  = dt.Rows[0]["IGORDER"].ToString();
            txtDesc.Text         = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.VgdescColumn].ToString();
            if (dt.Rows[0]["IGENABLE"].ToString().Equals("0"))
            {
                chk_status.Checked = false;
            }
            else
            {
                chk_status.Checked = true;
            }
        }
        #endregion
        #region  insert
        else
        {
            LtInsertUpdate.Text    = Developer.SupportOnlineKeyword.TaoDanhMuc;
            btn_insert_update.Text = "Đồng ý";
            txt_title_modul.Focus();
        }
        #endregion
    }
    string GetRoadGroup(string igid, string vgCateCurrent)
    {
        string str = "";

        top       = "1";
        fields    = " * ";
        condition = DataExtension.AndConditon(GroupsTSql.GetGroupsByVgapp(Modul), GroupsTSql.GetGroupsByIgid(igid));
        orderBy   = "";

        DataTable dt = new DataTable();

        dt = Groups.GetGroups("1", "*", condition, orderBy);
        if (dt.Rows.Count > 0)
        {
            if (!dt.Rows[0]["IGPARENTID"].ToString().Equals("0"))
            {
                str += GetRoadGroup(dt.Rows[0]["IGPARENTID"].ToString(), dt.Rows[0]["VGNAME"].ToString()) + " / ";
            }
            str += "" + dt.Rows[0]["VGNAME"].ToString() + " / ";
        }
        else
        {
            str = "/";
        }
        str += vgCateCurrent;
        return(str);
    }
Example #5
0
    private void GetDetail()
    {
        DataTable dt = Groups.GetGroups("1", GroupsColumns.VgnameColumn, GroupsTSql.GetGroupsByIgid(igid), "");

        if (dt.Rows.Count > 0)
        {
            ltName1.Text = ltName2.Text = dt.Rows[0][GroupsColumns.VgnameColumn].ToString();
        }
    }
    /// <summary>
    /// Xoá tên trường và xoá dữ liệu trong subitems theo mã ứng dụng, mã trường này
    /// </summary>
    /// <param name="igid">igid của trường</param>
    void DeleteDealFields(string igid)
    {
        string    condition = GroupsTSql.GetGroupsByIgid(igid);
        DataTable dt        = new DataTable();

        dt = Groups.GetGroups("", GroupsColumns.VgdescColumn, condition, "");
        Subitems.DeleteSubitemsCondition(DataExtension.AndConditon(SubitemsTSql.GetSubitemsByVslang(language), SubitemsTSql.GetSubitemsByVskey(app), SubitemsTSql.GetSubitemsByVsemail(dt.Rows[0][GroupsColumns.VgdescColumn].ToString())));
        Groups.DeleteGroups(GroupsTSql.GetGroupsByIgid(igid));
    }
Example #7
0
    private string GetTitle(string igid)
    {
        DataTable dt = new DataTable();

        dt = TatThanhJsc.Database.Groups.GetGroups("1", GroupsColumns.VgnameColumn, GroupsTSql.GetGroupsByIgid(igid), "");
        if (dt.Rows.Count > 0)
        {
            return(dt.Rows[0][GroupsColumns.VgnameColumn].ToString());
        }
        return("");
    }
 void InitialControlsValue(bool insert)
 {
     #region update
     if (!insert)
     {
         LtInsertUpdate.Text    = Developer.NewKeyword.CapNhatDanhMuc;
         btn_insert_update.Text = "Đồng ý";
         ckbContinue.Visible    = false;
         fields    = "*";
         condition = GroupsTSql.GetGroupsByIgid(igid);
         DataTable dt = new DataTable();
         dt = Groups.GetGroups(top, fields, condition, orderBy);
         txt_title_modul.Text      = dt.Rows[0]["VGNAME"].ToString();
         txtCreateDate.Text        = dt.Rows[0]["DGCREATEDATE"].ToString();
         txt_ordermodul.Text       = dt.Rows[0]["IGORDER"].ToString();
         txtDesc.Text              = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.VgdescColumn].ToString();
         txt_content.Text          = dt.Rows[0]["VGCONTENT"].ToString();
         DdlPosition.SelectedValue = dt.Rows[0]["VGPARAMS"].ToString();
         #region Image
         ltimg.Text = ImagesExtension.GetImage(pic, dt.Rows[0]["VGIMAGE"].ToString(), "", "adm_img_New", false, false, "", false);
         if (ltimg.Text.Length > 0)
         {
             btnXoaAnhHienTai.Visible = true;
             hd_img.Value             = dt.Rows[0]["VGIMAGE"].ToString();
         }
         #endregion
         #region Enable
         if (dt.Rows[0]["IGENABLE"].ToString().Equals("0"))
         {
             chk_status.Checked = false;
         }
         else
         {
             chk_status.Checked = true;
         }
         #endregion
         #region SEO
         textLinkRewrite.Text    = dt.Rows[0]["VGSEOLINK"].ToString();
         textTagTitle.Text       = dt.Rows[0]["VGSEOTITLE"].ToString();
         textTagKeyword.Text     = dt.Rows[0]["VGSEOMETAKEY"].ToString();
         textTagDescription.Text = dt.Rows[0]["VGSEOMETADESC"].ToString();
         #endregion
     }
     #endregion
     #region  insert
     else
     {
         LtInsertUpdate.Text    = Developer.NewKeyword.TaoDanhMuc;
         btn_insert_update.Text = "Đồng ý";
         txt_title_modul.Focus();
     }
     #endregion
 }
    //Lấy thông tin của nhóm modul, in ra literal
    void GetDetailGroups()
    {
        DataTable dt = new DataTable();

        fields    = "*";
        condition = GroupsTSql.GetGroupsByIgid(igid);
        dt        = Groups.GetGroups(top, fields, condition, orderBy);
        if (dt.Rows.Count > 0)
        {
            lt_cate_name.Text = "<div>" + dt.Rows[0]["VGNAME"] + "</div>";
        }
    }
Example #10
0
    void InitialControlsValue(bool insert)
    {
        #region update
        if (!insert)
        {
            LtInsertUpdate.Text = Developer.ServiceKeyword.CapNhatThuocTinh;
            btn_insert_update.Text = "Đồng ý";
            ckbContinue.Visible = false;
            fields = "*";
            condition = GroupsTSql.GetGroupsByIgid(igid);
            DataTable dt = new DataTable();
            dt = Groups.GetGroups(top, fields, condition, orderBy);

            txt_title_modul.Text = dt.Rows[0]["VGNAME"].ToString();
            ltimg.Text = TatThanhJsc.Extension.ImagesExtension.GetImage(pic, dt.Rows[0]["VGIMAGE"].ToString(), "", "adm_img_product", false, false, "", false);
            if (ltimg.Text.Length > 0)
            {
                btnXoaAnhHienTai.Visible = true;
                hd_img.Value = dt.Rows[0]["VGIMAGE"].ToString();
            }
            txt_ordermodul.Text = dt.Rows[0]["IGORDER"].ToString();
            txtDesc.Text = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.VgdescColumn].ToString();
            #region SEO
            textLinkRewrite.Text = dt.Rows[0]["VGSEOLINK"].ToString();
            textTagTitle.Text = dt.Rows[0]["VGSEOTITLE"].ToString();
            textTagKeyword.Text = dt.Rows[0]["VGSEOMETAKEY"].ToString();
            textTagDescription.Text = dt.Rows[0]["VGSEOMETADESC"].ToString();
            #endregion
            if (dt.Rows[0]["IGENABLE"].ToString().Equals("0"))
            {
                chk_status.Checked = false;
            }
            else
            {
                chk_status.Checked = true;
            }
            try
            {
                ddlType.SelectedValue = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.VgparamsColumn].ToString();
            }
            catch { }
        }
        #endregion
        #region  insert
        else
        {
            LtInsertUpdate.Text = Developer.ServiceKeyword.TaoThuocTinhMoi;
            btn_insert_update.Text = "Đồng ý";
        }
        #endregion
    }
    void GetCateInfo()
    {
        fields = "*";
        DataTable dt = new DataTable();

        dt = TatThanhJsc.Database.Groups.GetGroups("", fields, GroupsTSql.GetGroupsByIgid(igid), "");
        #region ThongTinCoBan
        ltrName.Text = @"
<div class='fwb'>
    Tên tổ chức: " + dt.Rows[0][GroupsColumns.VgnameColumn].ToString() + @"
</div>
<div class='cbh20'><!----></div>
";
        #endregion
    }
    void InitialControlsValue(bool insert)
    {
        #region update
        if (!insert)
        {
            LtInsertUpdate.Text = Developer.TourKeyword.CapNhatDanhMuc;
            btOK.Text           = "Đồng ý";
            ckbContinue.Visible = false;
            fields    = "*";
            condition = GroupsTSql.GetGroupsByIgid(igid);
            DataTable dt = new DataTable();
            dt = Groups.GetGroups(top, fields, condition, orderBy);

            tbTitle.Text = dt.Rows[0]["VGNAME"].ToString();

            flAnhDaiDien.Load(dt.Rows[0][GroupsColumns.VgimageColumn].ToString());

            tbOrder.Text = dt.Rows[0]["IGORDER"].ToString();
            tbDesc.Text  = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.VgdescColumn].ToString();

            tbDetail.Text      = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.VgcontentColumn].ToString();
            hdOldContent.Value = tbDetail.Text;

            #region SEO
            tbSeoLink.Text        = dt.Rows[0]["VGSEOLINK"].ToString();
            tbSeoTitle.Text       = dt.Rows[0]["VGSEOTITLE"].ToString();
            tbSeoKeyword.Text     = dt.Rows[0]["VGSEOMETAKEY"].ToString();
            tbSeoDescription.Text = dt.Rows[0]["VGSEOMETADESC"].ToString();
            #endregion
            if (dt.Rows[0]["IGENABLE"].ToString().Equals("0"))
            {
                cbStatus.Checked = false;
            }
            else
            {
                cbStatus.Checked = true;
            }
        }
        #endregion
        #region  insert
        else
        {
            LtInsertUpdate.Text = Developer.TourKeyword.TaoDanhMuc;
            btOK.Text           = "Đồng ý";
            tbTitle.Focus();
        }
        #endregion
    }
Example #13
0
    private string LayEmailPhongBan(string igid)
    {
        string s         = "";
        string condition = DataExtension.AndConditon(
            GroupsTSql.GetGroupsByIgid(igid),
            GroupsTSql.GetGroupsByVgapp(app)
            );
        DataTable dt = new DataTable();

        dt = Groups.GetGroups("1", GroupsColumns.VgcontentColumn, condition, "");
        if (dt.Rows.Count > 0)
        {
            s = StringExtension.LayChuoi(dt.Rows[0][GroupsColumns.VgcontentColumn].ToString(), "", 4);
        }
        return(s);
    }
Example #14
0
    /// <summary>
    /// Lấy danh igid các thuộc tính lọc đã được add vào danh mục (kết quả trả về dạng ,igid1,igid2,)
    /// </summary>
    /// <returns></returns>
    string GetListFilterProperties()
    {
        top       = ""; fields = GroupsColumns.VgparamsColumn + "," + GroupsColumns.VgnameColumn;
        orderBy   = "";
        condition = GroupsTSql.GetGroupsByIgid(ddl_group_product.SelectedValue);
        DataTable dt = new DataTable();

        dt = Groups.GetGroups(top, fields, condition, orderBy);
        if (dt.Rows.Count > 0)
        {
            return(dt.Rows[0][GroupsColumns.VgparamsColumn].ToString());
        }
        else
        {
            return("");
        }
    }
Example #15
0
    protected string GetDivColor(string igidColor)
    {
        condition = DataExtension.AndConditon(
            GroupsTSql.GetGroupsByIgid(igidColor),
            GroupsTSql.GetGroupsByVgapp(CodeApplications.TrainTicketColors));
        fields = GroupsColumns.VgparamsColumn;
        DataTable dt = new DataTable();

        dt = Groups.GetGroups("", fields, condition, "");
        if (dt.Rows.Count > 0)
        {
            return("<span style='width:15px;height:15px;display:inline-block;border:solid 1px #000;background:#" + dt.Rows[0][GroupsColumns.VgparamsColumn].ToString() + "'><!----></span>");
        }
        else
        {
            return(" ");
        }
    }
    protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string c = e.CommandName.Trim();
        string p = e.CommandArgument.ToString().Trim();

        fields    = "*";
        condition = GroupsTSql.GetGroupsByIgid(p);
        DataTable dt = new DataTable();

        dt = Groups.GetGroups("", fields, condition, "");
        switch (c)
        {
            #region Delete
        case "delete":
            DeleteDealFields(p);
            GetList();
            break;

            #endregion
            #region Edit Enable
        case "EditEnable":
            string[] fieldsEnable = { GroupsColumns.IgenableColumn };
            string[] valuesEnable = { "" };
            if (dt.Rows[0][GroupsColumns.IgenableColumn].ToString().Equals("0"))
            {
                valuesEnable[0] = "1";
                Groups.UpdateGroupsCondition(DataExtension.UpdateTransfer(fieldsEnable, valuesEnable), condition);
            }
            else
            {
                valuesEnable[0] = "0";
                Groups.UpdateGroupsCondition(DataExtension.UpdateTransfer(fieldsEnable, valuesEnable), condition);
            }
            GetList();
            break;

            #endregion
            #region Edit
        case "edit":
            OpenUpdatePanel(p);
            break;
            #endregion
        }
    }
Example #17
0
    void InitialControlsValue(bool insert)
    {
        #region update
        if (!insert)
        {
            LtInsertUpdate.Text    = Developer.DealKeyword.CapNhatMau;
            btn_insert_update.Text = "Đồng ý";
            ckbContinue.Visible    = false;
            fields    = "*";
            condition = GroupsTSql.GetGroupsByIgid(igid);
            DataTable dt = new DataTable();
            dt = Groups.GetGroups(top, fields, condition, orderBy);

            txt_title_modul.Text = dt.Rows[0]["VGNAME"].ToString();

            txt_ordermodul.Text = dt.Rows[0]["IGORDER"].ToString();
            txtDesc.Text        = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.VgdescColumn].ToString();
            #region SEO
            textLinkRewrite.Text    = dt.Rows[0]["VGSEOLINK"].ToString();
            textTagTitle.Text       = dt.Rows[0]["VGSEOTITLE"].ToString();
            textTagKeyword.Text     = dt.Rows[0]["VGSEOMETAKEY"].ToString();
            textTagDescription.Text = dt.Rows[0]["VGSEOMETADESC"].ToString();
            #endregion
            if (dt.Rows[0]["IGENABLE"].ToString().Equals("0"))
            {
                chk_status.Checked = false;
            }
            else
            {
                chk_status.Checked = true;
            }

            tbColor.Text = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.VgparamsColumn].ToString();
        }
        #endregion
        #region  insert
        else
        {
            LtInsertUpdate.Text    = Developer.DealKeyword.TaoMauMoi;
            btn_insert_update.Text = "Đồng ý";
        }
        #endregion
    }
    protected string ShowUpLoadImg(string igid)
    {
        string    s         = "";
        string    fields    = "*";
        string    condition = GroupsTSql.GetGroupsByIgid(igid);
        DataTable dt        = new DataTable();

        dt = Groups.GetGroups("1", fields, condition, "");

        if (dt.Rows.Count > 0)
        {
            if (dt.Rows[0]["VGSEOMETAPARAMS"].ToString() == "3")
            {
                s = "dn";
            }
        }

        return(s);
    }
    void InitialControlsValue(bool insert)
    {
        #region update
        if (!insert)
        {
            LtInsertUpdate.Text = Developer.TourKeyword.CapNhatNhomTour;
            btOK.Text           = "Đồng ý";
            ckbContinue.Visible = false;
            fields    = "*";
            condition = GroupsTSql.GetGroupsByIgid(igid);
            DataTable dt = new DataTable();
            dt = Groups.GetGroups(top, fields, condition, orderBy);

            DdlPosition.SelectedValue = dt.Rows[0]["VGPARAMS"].ToString();

            DdlGroupProduct.SelectedValue = dt.Rows[0][GroupsColumns.VGSEOMETACANONICALColumn].ToString();

            tbTitle.Text = dt.Rows[0]["VGNAME"].ToString();

            flAnhDaiDien.Load(dt.Rows[0][GroupsColumns.VgimageColumn].ToString());

            tbOrder.Text   = dt.Rows[0]["IGORDER"].ToString();
            tbDesc.Text    = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.VgdescColumn].ToString();
            tbMaxItem.Text = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.IgtotalitemsColumn].ToString();
            #region SEO
            tbSeoLink.Text        = dt.Rows[0]["VGSEOLINK"].ToString();
            tbSeoTitle.Text       = dt.Rows[0]["VGSEOTITLE"].ToString();
            tbSeoKeyword.Text     = dt.Rows[0]["VGSEOMETAKEY"].ToString();
            tbSeoDescription.Text = dt.Rows[0]["VGSEOMETADESC"].ToString();
            #endregion

            cbStatus.Checked = dt.Rows[0]["IGENABLE"].ToString() == "1";
        }
        #endregion
        #region  insert
        else
        {
            LtInsertUpdate.Text = Developer.TourKeyword.TaoNhomMoi;
            btOK.Text           = "Đồng ý";
        }
        #endregion
    }
    void OpenUpdatePanel(string igid)
    {
        ltrInsertUpdate.Text = "Cập nhật trường";
        hdIgid.Value         = igid;
        update           = true;
        pnList.Visible   = false;
        pnInsert.Visible = true;
        condition        = GroupsTSql.GetGroupsByIgid(igid);
        DataTable dt = new DataTable();

        dt = Groups.GetGroups("", "*", condition, "");
        if (dt.Rows.Count > 0)
        {
            tbName.Text                 = dt.Rows[0][GroupsColumns.VgnameColumn].ToString();
            tbKey.Text                  = dt.Rows[0][GroupsColumns.VgdescColumn].ToString();
            tbOrder.Text                = dt.Rows[0][GroupsColumns.IgorderColumn].ToString();
            ddlStatus.SelectedValue     = dt.Rows[0][GroupsColumns.IgenableColumn].ToString();
            ddlTextEditor.SelectedValue = dt.Rows[0][GroupsColumns.VgparamsColumn].ToString();
        }
    }
Example #21
0
    string LayThoiGianTour(string igid)
    {
        string    s         = "";
        DataTable dt        = new DataTable();
        string    fields    = " * ";
        string    condition = DataExtension.AndConditon(
            GroupsTSql.GetByApp(CodeApplications.TourVehicle),
            GroupsTSql.GetGroupsByIgid(igid),
            GroupsTSql.GetByLang(lang)
            );
        string orderBy = GroupsColumns.IgorderColumn + "," + GroupsColumns.VgnameColumn;

        dt = Groups.GetGroups("1", fields, condition, orderBy);

        if (dt.Rows.Count > 0)
        {
            s = dt.Rows[0][GroupsColumns.VgName].ToString();
        }

        return(s);
    }
Example #22
0
    /// <summary>
    /// Lấy thông tin của các trường khác trong item
    /// </summary>
    private void LoadSubInfo()
    {
        #region Không cần thay đổi
        DataTable dt = new DataTable();
        condition = DataExtension.AndConditon(
            GroupsTSql.GetGroupsByIgid(igid.Value),
            ItemsTSql.GetItemsByIienable("1"),
            ItemsTSql.GetItemsByViapp(subApp)
            );

        dt = GroupsItems.GetAllData("1", "*", condition, "groups_items.igiid desc");
        #endregion

        if (dt.Rows.Count > 0)
        {
            iid.Value = dt.Rows[0][ItemsColumns.IidColumn].ToString();

            //Điền dữ liệu ra các controls theo vị trí mà lập trình đã lưu vào.
            //Hiện lên khi cần dùng
            //tbYouTubeCode.Text = dt.Rows[0][ItemsColumns.VititleColumn].ToString();
        }
    }
Example #23
0
    private string GetCate(string igid)
    {
        string s = "";

        string condition = DataExtension.AndConditon(
            GroupsTSql.GetGroupsByIgenable("1"),
            GroupsTSql.GetGroupsByVgapp(app),
            GroupsTSql.GetGroupsByVglang(lang),
            GroupsTSql.GetGroupsByIgid(igid)
            );

        string fields  = DataExtension.GetListColumns(GroupsColumns.VgnameColumn, GroupsColumns.VgdescColumn, GroupsColumns.VGSEOLINKSEARCHColumn);
        string orderby = GroupsColumns.IgOrder + " desc ";

        DataTable dt = Groups.GetGroups("1", fields, condition, orderby);

        if (dt.Rows.Count > 0)
        {
            s = StringExtension.GhepChuoi("", dt.Rows[0][GroupsColumns.VgnameColumn].ToString(), dt.Rows[0][GroupsColumns.VgdescColumn].ToString(), dt.Rows[0][GroupsColumns.VGSEOLINKSEARCHColumn].ToString());
        }

        return(s);
    }
    string StatusGroupParent(string igparentid)
    {
        string str = "";

        top       = " 1 ";
        fields    = " * ";
        condition = DataExtension.AndConditon(GroupsTSql.GetGroupsByVgapp(Modul), GroupsTSql.GetGroupsByIgid(igparentid));
        orderBy   = "";

        DataTable dt = new DataTable();

        dt = Groups.GetGroups("1", "*", condition, orderBy);
        if (igparentid.Equals("0"))
        {
            str = "1";
        }
        else if (dt.Rows.Count > 0)
        {
            str = dt.Rows[0]["IGENABLE"].ToString();
        }

        return(str);
    }
Example #25
0
    string GetCate()
    {
        string s = "";

        #region Condition, orderby, fields
        string condition = "";

        if (igid != "")
        {
            condition = GroupsTSql.GetGroupsByIgid(igid);
        }
        else
        {
            condition = DataExtension.AndConditon(GroupsTSql.GetGroupsByIgparentid("0"),
                                                  GroupsTSql.GetGroupsByVgapp(app));
        }
        condition = DataExtension.AndConditon(
            condition,
            GroupsTSql.GetGroupsByVglang(lang),
            GroupsTSql.GetGroupsByIgenable("1"));

        string orderby = GroupsColumns.IgorderColumn + "," + GroupsColumns.DgcreatedateColumn + " desc ";

        try
        {
            rows = int.Parse(SettingsExtension.GetSettingKey(maxItemKey, lang));
        }
        catch { }

        string fields = DataExtension.GetListColumns(GroupsColumns.IgidColumn, GroupsColumns.VgnameColumn, GroupsColumns.VGSEOLINKSEARCHColumn);
        #endregion

        DataTable dt = Groups.GetGroups("", "*", condition, orderby);

        string link = "";
        string list = "";
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            link =
                (UrlExtension.WebisteUrl + dt.Rows[i][GroupsColumns.VGSEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower();


            if (dt.Rows[i][GroupsColumns.IgtotalitemsColumn].ToString() == "0")
            {
                s += @"
     <div class='itemM fade-up'>
            <div class='itemM__content'>
                <h2 class='itemM__ttl'>" + dt.Rows[i][GroupsColumns.VgnameColumn] + @"</h2>
                <p class='txtBase'>
                   " + dt.Rows[i][GroupsColumns.VgcontentColumn] + @"
                </p>
            </div>
            <div class='itemM__img img'>
                <div class='img__crop'>
                    " + ImagesExtension.GetImage(pic, dt.Rows[i][GroupsColumns.VgimageColumn].ToString(), dt.Rows[i][GroupsColumns.VgnameColumn].ToString(), "", true, false, "") + @"
                </div>
            </div>
        </div>
";
            }
            else
            {
                list = GetList(dt.Rows[i][GroupsColumns.IgidColumn].ToString(), rows.ToString());
                if (list.Length > 0)
                {
                    s += @"
<h2 class='ttl-comp03 fade-up'>" + dt.Rows[i][GroupsColumns.VgnameColumn] + @"</h2>
  <div class='list-service'>
         " + list + @"  
  </div>
";
                }
            }
        }


        return(s);
    }
Example #26
0
    string GetCate()
    {
        string s = "";

        #region Condition, orderby, fields
        string condition = "";

        if (igid != "")
        {
            condition = GroupsTSql.GetGroupsByIgid(igid);
        }
        else
        {
            condition = DataExtension.AndConditon(GroupsTSql.GetGroupsByIgparentid("0"),
                                                  GroupsTSql.GetGroupsByVgapp(app));
        }
        condition = DataExtension.AndConditon(
            condition,
            GroupsTSql.GetGroupsByVglang(lang),
            GroupsTSql.GetGroupsByIgenable("1"));

        string orderby = GroupsColumns.VGSEOMETAPARAMSColumn;

        try
        {
            rows = int.Parse(SettingsExtension.GetSettingKey(maxItemKey, lang));
        }
        catch { }

        string fields = DataExtension.GetListColumns(GroupsColumns.IgidColumn, GroupsColumns.VgnameColumn, GroupsColumns.VGSEOLINKSEARCHColumn);
        #endregion

        DataTable dt = Groups.GetGroups("", "*", condition, orderby);

        string link = "";
        string list = "";
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            link =
                (UrlExtension.WebisteUrl + dt.Rows[i][GroupsColumns.VGSEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower();


            if (dt.Rows[i][GroupsColumns.VGSEOMETAPARAMSColumn].ToString() == "1")
            {
                s += @"
 <div class='itemM itemM--style02 fade-up'>
            <div class='itemM__content'>
                 <h2 class='itemM__ttl'>" + dt.Rows[i][GroupsColumns.VgnameColumn] + @"</h2>
                <p class='txtBase'>
                     " + StringExtension.LayChuoi(dt.Rows[i][GroupsColumns.VgcontentColumn].ToString(), "", 1) + @"
                </p>
            </div>
            <div class='itemM__img img'>
                <div class='img__crop'>
                   " + ImagesExtension.GetImage(pic, dt.Rows[i][GroupsColumns.VgimageColumn].ToString(), dt.Rows[i][GroupsColumns.VgnameColumn].ToString(), "", true, false, "") + @"
                </div>
            </div>
        </div>
";
            }
            else if (dt.Rows[i][GroupsColumns.VGSEOMETAPARAMSColumn].ToString() == "2")
            {
                list = GetList(dt.Rows[i][GroupsColumns.IgidColumn].ToString(), rows.ToString());
                if (list.Length > 0)
                {
                    s += @"
<h2 class=' ttl-comp03 ttl-comp03--md fade-up'>" + dt.Rows[i][GroupsColumns.VgnameColumn] + @"</h2>
  <div class='list-service'>
         " + list + @"  
  </div>
";
                }
            }
            else if (dt.Rows[i][GroupsColumns.VGSEOMETAPARAMSColumn].ToString() == "3")
            {
                list = GetList2(dt.Rows[i][GroupsColumns.IgidColumn].ToString(), rows.ToString());
                if (list.Length > 0)
                {
                    s += list;
                }
            }

            else if (dt.Rows[i][GroupsColumns.VGSEOMETAPARAMSColumn].ToString() == "4")
            {
                list = GetList3(dt.Rows[i][GroupsColumns.IgidColumn].ToString(), rows.ToString());
                if (list.Length > 0)
                {
                    s += @"
    <div class='price-album'>
      <h2 class='ttl-comp03 ttl-comp03--md fade-up'>album ảnh cưới tại blue lotus</h2>
    <div class='list-price'>
             " + list + @"  
      </div>
  </div>
";
                }
            }
        }


        return(s);
    }
Example #27
0
    void GetList()
    {
        #region Condition, orderby
        string condition = "";

        if (igid != "")
        {
            condition = GroupsItemsTSql.GetItemsInGroupCondition(igid, "");
        }
        else
        {
            condition = GroupsTSql.GetGroupsByIgid(igidFirst);
        }

        condition = DataExtension.AndConditon(
            condition,
            GroupsTSql.GetGroupsByVglang(lang),
            GroupsTSql.GetGroupsByIgenable("1"),
            ItemsTSql.GetItemsByIienable("1"),
            ItemsTSql.GetItemsByViapp(app));

        if (key.Length > 0)
        {
            condition = DataExtension.AndConditon(condition, SearchTSql.GetSearchMathedCondition(key, ItemsColumns.VititleColumn, ItemsColumns.VikeyColumn, ItemsColumns.FipriceColumn, ItemsColumns.FisalepriceColumn));
        }

        string orderby = ItemsColumns.IiorderColumn + "," + ItemsColumns.DicreatedateColumn + " desc ";

        try
        {
            rows = int.Parse(SettingsExtension.GetSettingKey(maxItemKey, lang));
        }
        catch { }
        #endregion

        DataSet ds = GroupsItems.GetAllDataPagging(p, rows.ToString(), condition, orderby);
        if (ds.Tables.Count > 0)
        {
            DataTable dt      = ds.Tables[0];
            DataTable dtPager = ds.Tables[1];

            #region Lấy ra danh sách bài viết
            if (dt.Rows.Count > 0)
            {
                string link = "";
                string price = "", salePrice = "";
                string time  = "";
                int    point = 2;
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    link      = (UrlExtension.WebisteUrl + dt.Rows[i][ItemsColumns.VISEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower();
                    price     = dt.Rows[i][ItemsColumns.FipriceColumn].ToString();
                    salePrice = dt.Rows[i][ItemsColumns.FisalepriceColumn].ToString();

                    if (price == "0" || price == "")
                    {
                        price     = "";
                        salePrice = LanguageItemExtension.GetnLanguageItemTitleByName("Liên hệ");
                    }
                    else if (salePrice == "0" || salePrice == "")
                    {
                        salePrice = NumberExtension.FormatNumber(price) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ");
                        price     = "";
                    }
                    else
                    {
                        price     = NumberExtension.FormatNumber(price) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ");
                        salePrice = NumberExtension.FormatNumber(salePrice) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ");
                    }

                    time = LayThoiGianTour(dt.Rows[i][ItemsColumns.ViurlColumn].ToString());

                    if (i < point)
                    {
                        ltrList1.Text += @"
          <div class='item item-post item-big'>
            <div class='item-img'>
              <a href='" + link + @"' class='imgc' title='" + dt.Rows[i][ItemsColumns.VititleColumn] + @"'>
                " + ImagesExtension.GetImage(pic, dt.Rows[i][ItemsColumns.ViimageColumn].ToString(), dt.Rows[i][ItemsColumns.VititleColumn].ToString(), "", true, false, "") + @"
              </a>
              <div class='item-date'>
                <div>
                  <i class='fa fa-calendar' aria-hidden='true'></i><span>" + LanguageItemExtension.GetnLanguageItemTitleByName("Time") + @": " + time + @"</span>
                </div>
                <div>
                  <i class='fa fa-plane' aria-hidden='true'></i><span>" + LanguageItemExtension.GetnLanguageItemTitleByName("Departure") + @": " + dt.Rows[i][ItemsColumns.VISEOMETAPARAMSColumn] + @"</span>
                </div>
              </div>
            </div>
            <div class='item-body'>
              <h3>
                <a href='" + link + @"' class='title item-title' title='" + dt.Rows[i][ItemsColumns.VititleColumn] + @"'>" + dt.Rows[i][ItemsColumns.VititleColumn] + @"</a>
              </h3>
              <p class='item-text'>" + dt.Rows[i][ItemsColumns.VidescColumn].ToString() + @"</p>
              <div class='item-price'>
                <span class='real'>" + salePrice + @"</span>
                <span class='throught'>" + price + @"</span>
              </div>
              <a href='" + link + @"' class='link item-link' title='" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @"'>" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @" <i class='fa fa-angle-right' aria-hidden='true'></i>
              </a>
            </div>
          </div>";
                    }
                    else
                    {
                        ltrList2.Text += @"
          <div class='col'>
            <div class='item item-post'>
              <div class='item-img'>
                <a href='" + link + @"' title='" + dt.Rows[i][ItemsColumns.VititleColumn] + @"' class='imgc'>
                  " + ImagesExtension.GetImage(pic, dt.Rows[i][ItemsColumns.ViimageColumn].ToString(), dt.Rows[i][ItemsColumns.VititleColumn].ToString(), "", true, false, "") + @"
                </a>
                <div class='item-date'>
                  <div>
                    <i class='fa fa-calendar' aria-hidden='true'></i><span>" + LanguageItemExtension.GetnLanguageItemTitleByName("Time") + @": " + time + @"</span>
                  </div>
                  <div>
                    <i class='fa fa-plane' aria-hidden='true'></i><span>" + LanguageItemExtension.GetnLanguageItemTitleByName("Departure") + @": " + dt.Rows[i][ItemsColumns.VISEOMETAPARAMSColumn] + @"</span>
                  </div>
                </div>
              </div>
              <div class='item-body'>
                <h3>
                  <a href='" + link + @"' class='title item-title' title='" + dt.Rows[i][ItemsColumns.VititleColumn] + @"'>" + dt.Rows[i][ItemsColumns.VititleColumn] + @"</a>
                </h3>
                <div class='item-price'>
                  <span class='real'>" + salePrice + @"</span>
                  <span class='throught'>" + price + @"</span>
                </div>
                <a href='" + link + @"' class='link item-link' title='" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @"'>" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @" <i class='fa fa-angle-right' aria-hidden='true'></i>
                </a>
              </div>
            </div>
          </div>";
                    }
                }
            }
            #endregion

            #region Xuất ra phân trang
            if (dtPager.Rows.Count > 0 && dt.Rows.Count > 0)
            {
                string split = PagingExtension.SpilitPages(int.Parse(dtPager.Rows[0]["TotalRows"].ToString()), rows, int.Parse(p), "", "hientai", "trangkhac", "dau", "cuoi", "truoc", "sau");
                if (split.Length > 0)
                {
                    int totalPage = 0;
                    try
                    {
                        double totalrow = double.Parse(dtPager.Rows[0]["TotalRows"].ToString());

                        totalPage = (int)(totalrow / rows);
                        if (totalPage < (totalrow / rows))
                        {
                            totalPage++;
                        }
                    }
                    catch { }

                    ltrPaging.Text +=
                        PagingExtension02.XuLyPhanTrang(split, dtPager.Rows[0]["TotalRows"].ToString(),
                                                        (title != "" ? title : go), LanguageItemExtension.GetnLanguageItemTitleByName("Trang đầu"),
                                                        LanguageItemExtension.GetnLanguageItemTitleByName("Trang cuối"),
                                                        LanguageItemExtension.GetnLanguageItemTitleByName("Trước"),
                                                        LanguageItemExtension.GetnLanguageItemTitleByName("Sau"));
                }
                else
                {
                    if (dt.Rows.Count < 1)
                    {
                        ltrNoResult.Text += "<div class='emptyresult'>" + LanguageItemExtension.GetnLanguageItemTitleByName(noResultText) + "</div>";
                        pnInfo.Visible    = false;
                    }
                }
            }
            else
            {
                ltrNoResult.Text += "<div class='emptyresult'>" + LanguageItemExtension.GetnLanguageItemTitleByName(noResultText) + "</div>";
                pnInfo.Visible    = false;
            }
            #endregion
        }
    }
    void InitialControlsValue(bool insert)
    {
        #region update
        if (!insert)
        {
            LtInsertUpdate.Text = Developer.DestinationKeyword.CapNhatDanhMuc;
            btOK.Text           = "Đồng ý";
            ckbContinue.Visible = false;
            fields    = "*";
            condition = GroupsTSql.GetGroupsByIgid(igid);
            DataTable dt = new DataTable();
            dt = Groups.GetGroups(top, fields, condition, orderBy);

            tbTitle.Text = dt.Rows[0]["VGNAME"].ToString();

            flAnhDaiDien.Load(dt.Rows[0][GroupsColumns.VgimageColumn].ToString());
            flAnhQuocGia.Load(StringExtension.LayChuoi(dt.Rows[0][GroupsColumns.VgparamsColumn].ToString(), "", 1));

            GoogleMapMarkLocation.Load(
                StringExtension.LayChuoi(dt.Rows[0][GroupsColumns.VgparamsColumn].ToString(), "", 2),
                StringExtension.LayChuoi(dt.Rows[0][GroupsColumns.VgparamsColumn].ToString(), "", 3), tbTitle.Text);

            #region Các thông tin khác
            flAnhGioiThieu.Load(StringExtension.LayChuoi(dt.Rows[0][GroupsColumns.VgparamsColumn].ToString(), "", 4));
            tbDanSo.Text      = StringExtension.LayChuoi(dt.Rows[0][GroupsColumns.VgparamsColumn].ToString(), "", 5);
            tbThuDo.Text      = StringExtension.LayChuoi(dt.Rows[0][GroupsColumns.VgparamsColumn].ToString(), "", 6);
            tbDanToc.Text     = StringExtension.LayChuoi(dt.Rows[0][GroupsColumns.VgparamsColumn].ToString(), "", 7);
            tbNgonNgu.Text    = StringExtension.LayChuoi(dt.Rows[0][GroupsColumns.VgparamsColumn].ToString(), "", 8);
            tbTienTe.Text     = StringExtension.LayChuoi(dt.Rows[0][GroupsColumns.VgparamsColumn].ToString(), "", 9);
            tbMuiGio.Text     = StringExtension.LayChuoi(dt.Rows[0][GroupsColumns.VgparamsColumn].ToString(), "", 10);
            tbMaDTQuocTe.Text = StringExtension.LayChuoi(dt.Rows[0][GroupsColumns.VgparamsColumn].ToString(), "", 11);
            #endregion

            tbThongSoTongQuan.Text = StringExtension.LayChuoi(dt.Rows[0][GroupsColumns.VgparamsColumn].ToString(), "", 12);

            tbOrder.Text = dt.Rows[0]["IGORDER"].ToString();
            tbDesc.Text  = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.VgdescColumn].ToString();

            tbDetail.Text      = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.VgcontentColumn].ToString();
            hdOldContent.Value = tbDetail.Text;

            #region SEO
            tbSeoLink.Text        = dt.Rows[0]["VGSEOLINK"].ToString();
            tbSeoTitle.Text       = dt.Rows[0]["VGSEOTITLE"].ToString();
            tbSeoKeyword.Text     = dt.Rows[0]["VGSEOMETAKEY"].ToString();
            tbSeoDescription.Text = dt.Rows[0]["VGSEOMETADESC"].ToString();
            #endregion
            if (dt.Rows[0]["IGENABLE"].ToString().Equals("0"))
            {
                cbStatus.Checked = false;
            }
            else
            {
                cbStatus.Checked = true;
            }
        }
        #endregion
        #region  insert
        else
        {
            LtInsertUpdate.Text = Developer.DestinationKeyword.TaoDanhMuc;
            btOK.Text           = "Đồng ý";
            tbTitle.Focus();
        }
        #endregion
    }
Example #29
0
    void InitialControlsValue(bool insert)
    {
        #region update
        if (!insert)
        {
            LtInsertUpdate.Text    = Developer.ProductKeyword.CapNhatDanhMuc;
            btn_insert_update.Text = "Đồng ý";
            ckbContinue.Visible    = false;
            fields    = "*";
            condition = GroupsTSql.GetGroupsByIgid(igid);
            DataTable dt = new DataTable();
            dt = Groups.GetGroups(top, fields, condition, orderBy);

            txt_title_modul.Text = dt.Rows[0]["VGNAME"].ToString();
            ltimg.Text           = ImagesExtension.GetImage(pic, dt.Rows[0]["VGIMAGE"].ToString(), "", "adm_img_product", false, false, "", false);
            if (ltimg.Text.Length > 0)
            {
                btnXoaAnhHienTai.Visible = true;
                hd_img.Value             = dt.Rows[0]["VGIMAGE"].ToString();
            }
            txt_ordermodul.Text = dt.Rows[0]["IGORDER"].ToString();
            txtDesc.Text        = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.VgdescColumn].ToString();
            #region SEO
            textLinkRewrite.Text    = dt.Rows[0]["VGSEOLINK"].ToString();
            textTagTitle.Text       = dt.Rows[0]["VGSEOTITLE"].ToString();
            textTagKeyword.Text     = dt.Rows[0]["VGSEOMETAKEY"].ToString();
            textTagDescription.Text = dt.Rows[0]["VGSEOMETADESC"].ToString();
            #endregion
            if (dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.VGSEOMETACANONICALColumn].ToString().Equals("1"))
            {
                chk_DisplayHome.Checked = true;
            }
            else
            {
                chk_DisplayHome.Checked = false;
            }
            if (dt.Rows[0]["IGENABLE"].ToString().Equals("0"))
            {
                chk_status.Checked = false;
            }
            else
            {
                chk_status.Checked = true;
            }
            string content = dt.Rows[0]["VGCONTENT"].ToString();
            txt_content.Text   = StringExtension.LayChuoi(content, "", 1);
            hdOldContent.Value = txt_content.Text;
            txtTitleQC.Text    = StringExtension.LayChuoi(content, "", 2);
            txtGiaLienHe.Text  = StringExtension.LayChuoi(content, "", 3);
            txtLienHeNgay.Text = StringExtension.LayChuoi(content, "", 4);
            string subconten = dt.Rows[0]["VGSEOMETALANG"].ToString();
            txtLinkQC.Text = StringExtension.LayChuoi(subconten, "", 1);
            string opentype = StringExtension.LayChuoi(subconten, "", 2);

            dlTypeGroup.SelectedValue = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.VGSEOMETAPARAMSColumn].ToString();

            if (opentype.Equals("1"))
            {
                ddl_type_open.SelectedIndex = 0;
            }
            else
            {
                ddl_type_open.SelectedIndex = 1;
            }
        }
        #endregion
        #region  insert
        else
        {
            LtInsertUpdate.Text    = Developer.ProductKeyword.TaoDanhMuc;
            btn_insert_update.Text = "Đồng ý";
        }
        #endregion
    }
    void InitialControlsValue(bool insert)
    {
        #region update
        if (!insert)
        {
            LtInsertUpdate.Text    = Developer.WebsiteKeyword.CapNhatNhomBaiVietMoi;
            btn_insert_update.Text = "Đồng ý";
            ckbContinue.Visible    = false;
            fields    = "*";
            condition = GroupsTSql.GetGroupsByIgid(igid);
            DataTable dt = new DataTable();
            dt = Groups.GetGroups(top, fields, condition, orderBy);

            txt_title_modul.Text = dt.Rows[0]["VGNAME"].ToString();
            ltimg.Text           = ImagesExtension.GetImage(pic, dt.Rows[0]["VGIMAGE"].ToString(), "", "adm_img_product", false, false, "", false);
            if (ltimg.Text.Length > 0)
            {
                btnXoaAnhHienTai.Visible = true;
                hd_img.Value             = dt.Rows[0]["VGIMAGE"].ToString();
            }
            txt_ordermodul.Text = dt.Rows[0]["IGORDER"].ToString();
            txtDesc.Text        = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.VgdescColumn].ToString();
            #region SEO
            textLinkRewrite.Text    = dt.Rows[0]["VGSEOLINK"].ToString();
            textTagTitle.Text       = dt.Rows[0]["VGSEOTITLE"].ToString();
            textTagKeyword.Text     = dt.Rows[0]["VGSEOMETAKEY"].ToString();
            textTagDescription.Text = dt.Rows[0]["VGSEOMETADESC"].ToString();
            #endregion
            if (dt.Rows[0]["IGENABLE"].ToString().Equals("0"))
            {
                chk_status.Checked = false;
            }
            else
            {
                chk_status.Checked = true;
            }

            #region Địa chỉ, điện thoại, fax, email, gmap
            string content = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.VgcontentColumn].ToString();
            tbDiaChi.Text    = StringExtension.LayChuoi(content, "", 1);
            tbDienThoai.Text = StringExtension.LayChuoi(content, "", 2);
            tbFax.Text       = StringExtension.LayChuoi(content, "", 3);
            tbEmail.Text     = StringExtension.LayChuoi(content, "", 4);
            tbKinhDo.Text    = StringExtension.LayChuoi(content, "", 5);
            tbViDo.Text      = StringExtension.LayChuoi(content, "", 6);

            lat        = tbViDo.Text;
            lng        = tbKinhDo.Text;
            infoWindow = tbDiaChi.Text;
            #endregion

            tbCreateDate.Text = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.DgcreatedateColumn].ToString();
            tbEndDate.Text    = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.DgenddateColumn].ToString();
        }
        #endregion
        #region  insert
        else
        {
            LtInsertUpdate.Text    = Developer.WebsiteKeyword.TaoNhomBaiVietMoi;
            btn_insert_update.Text = "Đồng ý";

            tbCreateDate.Text = DateTime.Now.ToString();
            tbEndDate.Text    = DateTime.MaxValue.ToString();
        }
        #endregion
    }