Esempio n. 1
0
    void OpenUpdatePanel(string isid)
    {
        ltrInsertUpdate.Text = "Cập nhật hình ảnh";
        update            = true;
        currentIsid.Value = isid;
        pnList.Visible    = false;
        pnInsert.Visible  = true;
        condition         = SubitemsTSql.GetSubitemsByIsid(isid);
        DataTable dt = new DataTable();

        dt = Subitems.GetSubItems("", "*", condition, "");
        if (dt.Rows.Count > 0)
        {
            try
            {
                rblColors.SelectedValue = dt.Rows[0][SubitemsColumns.VsemailColumn].ToString();
            }
            catch { }
            tbName.Text             = dt.Rows[0][SubitemsColumns.VstitleColumn].ToString();
            tbOrder.Text            = dt.Rows[0][SubitemsColumns.VsatuthorColumn].ToString();
            ddlStatus.SelectedValue = dt.Rows[0][SubitemsColumns.IsenableColumn].ToString();
            ltimg.Text = ImagesExtension.GetImage(pathFolderPic, dt.Rows[0][SubitemsColumns.VsimageColumn].ToString(), "", "hotelImage", false, false, "");
            hd_img     = dt.Rows[0][SubitemsColumns.VsimageColumn].ToString();
        }
    }
Esempio n. 2
0
    private string GetOtherImages2(string iid)
    {
        string s         = "";
        string s1        = "";
        string condition = DataExtension.AndConditon
                           (
            SubitemsTSql.GetSubitemsByIid(iid),
            SubitemsTSql.GetSubitemsByVskey(CodeApplications.ProductImagesOther),
            SubitemsTSql.GetByEnable("1")
                           );

        string pic = TatThanhJsc.ProductModul.FolderPic.Product;

        string    orderby = SubitemsColumns.VsatuthorColumn;
        DataTable dt      = new DataTable();

        dt = Subitems.GetSubItems("", "*", condition, orderby);
        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                s1 += @"
                <div class='list-picture__item fade-up'>
                    <div class='img'>
                        <a href='" + UrlExtension.WebisteUrl + pic + "/" + dt.Rows[i][SubitemsColumns.VsimageColumn] + @"' data-fancybox='gallery' class='img__crop'>
                               " + ImagesExtension.GetImage(pic, dt.Rows[i][SubitemsColumns.VsimageColumn].ToString(), dt.Rows[i][SubitemsColumns.VstitleColumn].ToString(), "", true, false, "", false) + @"
                        </a>
                    </div>
                </div>";
            }
        }

        return(s1);
    }
    void OpenUpdatePanel(string isid)
    {
        ltrInsertUpdate.Text = "Cập nhật loại";
        update            = true;
        currentIsid.Value = isid;
        pnList.Visible    = false;
        pnInsert.Visible  = true;
        condition         = SubitemsTSql.GetSubitemsByIsid(isid);
        DataTable dt = new DataTable();

        dt = Subitems.GetSubItems("", "*", condition, "");
        if (dt.Rows.Count > 0)
        {
            tbName.Text             = dt.Rows[0][SubitemsColumns.VstitleColumn].ToString();
            tbOrder.Text            = dt.Rows[0][SubitemsColumns.VsatuthorColumn].ToString();
            ddlStatus.SelectedValue = dt.Rows[0][SubitemsColumns.IsenableColumn].ToString();
            ltimg.Text = ImagesExtension.GetImage(pathFolderPic, dt.Rows[0][SubitemsColumns.VsimageColumn].ToString(), "", "hotelImage", false, false, "");
            hd_img     = dt.Rows[0][SubitemsColumns.VsimageColumn].ToString();

            tbMoTa.Text   = StringExtension.LayChuoi(dt.Rows[0][SubitemsColumns.VscontentColumn].ToString(), "", 1);
            tbParam2.Text = StringExtension.LayChuoi(dt.Rows[0][SubitemsColumns.VscontentColumn].ToString(), "", 2);
            tbParam3.Text = StringExtension.LayChuoi(dt.Rows[0][SubitemsColumns.VscontentColumn].ToString(), "", 3);

            tbParam1.Text = dt.Rows[0][SubitemsColumns.VsurlColumn].ToString();

            tbPrice.Text    = StringExtension.LayChuoi(dt.Rows[0][SubitemsColumns.VsemailColumn].ToString(), "", 1);
            tbPriceOld.Text = StringExtension.LayChuoi(dt.Rows[0][SubitemsColumns.VsemailColumn].ToString(), "", 2);

            tbCreateDate.Text = dt.Rows[0][SubitemsColumns.DscreatedateColumn].ToString();
            tbEnddate.Text    = dt.Rows[0][SubitemsColumns.DsenddateColumn].ToString();
        }
    }
Esempio n. 4
0
    string LayLichTrinh(string iid)
    {
        string s = "";

        string condition = DataExtension.AndConditon(
            SubitemsTSql.GetSubitemsByVskey(TatThanhJsc.TourModul.CodeApplications.TourItinerary),
            SubitemsTSql.GetSubitemsByIid(iid),
            SubitemsTSql.GetSubitemsByVslang(lang),
            SubitemsColumns.IsenableColumn + "<>2");

        string    order = "[dbo].[RemoveTextIfNotIsFloat](" + SubitemsColumns.VsatuthorColumn + ")";
        DataTable dt    = Subitems.GetSubItems("", "*", condition, order);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            s += @"
      <div class='nb-card'>
        <div class='nb-head'>
          <a href='#' class='title nb-collapse-toggle'>
            <span>" + StringExtension.LayChuoi(dt.Rows[i][SubitemsColumns.VstitleColumn].ToString(), "", 1) + @"</span> - " + StringExtension.LayChuoi(dt.Rows[i][SubitemsColumns.VstitleColumn].ToString(), "", 2) + @"
						<span class='icon-toggle'></span>
          </a>
        </div>
        <div class='nb-body'>
          <div class='wap'>
            " + dt.Rows[i][SubitemsColumns.VscontentColumn].ToString() + @"
          </div>
        </div>
      </div>";
        }


        return(s);
    }
    private void GetOtherImages(string iid)
    {
        string condition = DataExtension.AndConditon(
            SubitemsTSql.GetSubitemsByVskey(CodeApplications.HotelPhoto),
            SubitemsTSql.GetSubitemsByIid(iid),
            SubitemsTSql.GetSubitemsByVslang(lang),
            SubitemsColumns.IsenableColumn + "<>2"
            );
        string    order = "[dbo].[RemoveTextIfNotIsFloat](" + SubitemsColumns.VsatuthorColumn + ")";
        DataTable dt    = Subitems.GetSubItems("", "*", condition, order);

        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                ltrMainImages.Text += @"
        <div class='item'>
          <a href='javascript:void(0)' class='imgc'>
            " + ImagesExtension.GetImage(pic, dt.Rows[i][SubitemsColumns.VsimageColumn].ToString(), dt.Rows[i][SubitemsColumns.VstitleColumn].ToString(), "", true, false, "", false) + @"
          </a>
        </div>";

                ltrOtherImages.Text += @"
        <div class='item'>
          <a href='javascript:void(0)' class='imgc'>
            " + ImagesExtension.GetImage(pic, dt.Rows[i][SubitemsColumns.VsimageColumn].ToString(), dt.Rows[i][SubitemsColumns.VstitleColumn].ToString(), "", true, false, "", false) + @"
          </a>
        </div>";
            }
        }
    }
    protected void RpListNoticeBQT_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string c = e.CommandName.Trim();
        string p = e.CommandArgument.ToString().Trim();

        top       = "";
        fields    = "*";
        condition = DataExtension.AndConditon(SubitemsTSql.GetSubitemsByIsid(p));
        order     = "";
        DataTable dt = new DataTable();

        dt = Subitems.GetSubItems(top, fields, condition, order);

        switch (c)
        {
        case "edit":

            PnShow.Visible       = false;
            PnFormNotice.Visible = true;
            TbTtl.Text           = dt.Rows[0]["VSTITLE"].ToString();
            TbContent.Text       = dt.Rows[0]["VSCONTENT"].ToString();
            HdInsertUpdate.Value = "update";
            HdIsid.Value         = p;
            GetListMes();
            break;

        case "del":
            Subitems.DeleteSubitems(p);
            GetListMes();
            break;
        }
    }
    private void LayDanhSachLichTrinh()
    {
        string s   = "";
        string iid = "";

        if (Request["iid"] != null)
        {
            iid = StringExtension.RemoveSqlInjectionChars(Request["iid"]);
        }

        string condition = DataExtension.AndConditon(
            SubitemsTSql.GetSubitemsByVskey(app),
            SubitemsTSql.GetSubitemsByIid(iid),
            SubitemsTSql.GetSubitemsByVslang(lang),
            SubitemsColumns.IsenableColumn + "<>2"
            );
        string    order = "[dbo].[RemoveTextIfNotIsFloat](" + SubitemsColumns.VsatuthorColumn + ")";
        DataTable dt    = Subitems.GetSubItems("", "*", condition, order);

        if (dt.Rows.Count > 0)
        {
            s += @"
<table class='formatted'>
<tr>
    <th class='stt'>TT</th>
    <th>Hoạt động</th>
    <th>Điểm đến</th>
    <th>Bữa ăn</th>
    <th class='thuTu'>Thứ tự</th>
    <th class='trangThai'>Trạng thái</th>
    <th class='congCu'>Công cụ</th>
</tr>";
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                s += @"
<tr id='row_" + dt.Rows[i][SubitemsColumns.IsidColumn] + @"'>
    <td class='tac'>" + (i + 1) + @"</td>
    <td>" + StringExtension.LayChuoi(dt.Rows[i][SubitemsColumns.VstitleColumn].ToString(), "", 1) + ": " + StringExtension.LayChuoi(dt.Rows[i][SubitemsColumns.VstitleColumn].ToString(), "", 2) + @"<br/>
        " + ImagesExtension.GetImage(pic, dt.Rows[i][SubitemsColumns.VsimageColumn].ToString(), "", "itiImage", false, true, dt.Rows[i][SubitemsColumns.VscontentColumn].ToString()) + @"
    </td>
    <td>" + HienThiDiemDen(dt.Rows[i][SubitemsColumns.VsurlColumn].ToString()) + @"</td>
    <td>" + HienThiBuaAn(dt.Rows[i][SubitemsColumns.VsemailColumn].ToString()) + @"</td>
    <td class='tac'>" + dt.Rows[i][SubitemsColumns.VsatuthorColumn].ToString() + @"</td>
    <td class='tac'><span class='EnableIcon" + dt.Rows[i][SubitemsColumns.IsenableColumn] + @"'>&nbsp;</span></td>
    <td class='tac'>
        <a href='javascript:EditItinerary(" + dt.Rows[i][SubitemsColumns.IsidColumn] + @")' class='iconEdit'>Sửa</a>&nbsp;&nbsp;&nbsp;
        <a href='javascript:DeleteItinerary(" + dt.Rows[i][SubitemsColumns.IsidColumn] + @")' class='iconDelete'>Xóa</a>
    </td>
</tr>";
            }


            s += "</table>";
        }

        Response.Write(s);
    }
    private void LayDanhSachLoaiPhong()
    {
        string s   = "";
        string iid = "";

        if (Request["iid"] != null)
        {
            iid = StringExtension.RemoveSqlInjectionChars(Request["iid"]);
        }

        string condition = DataExtension.AndConditon(
            SubitemsTSql.GetSubitemsByVskey(app),
            SubitemsTSql.GetSubitemsByIid(iid),
            SubitemsTSql.GetSubitemsByVslang(lang),
            SubitemsColumns.IsenableColumn + "<>2"
            );
        string    order = SubitemsColumns.isOrder;
        DataTable dt    = Subitems.GetSubItems("", "*", condition, order);

        if (dt.Rows.Count > 0)
        {
            s += @"
<table class='formatted'>
<tr>
    <th class='stt'>TT</th>
    <th>Loại phòng</th>
    <th>Sức chứa</th>
    <th>Giá</th>
    <th class='thuTu'>Thứ tự</th>
    <th class='trangThai'>Trạng thái</th>
    <th class='congCu'>Công cụ</th>
</tr>";
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                s += @"
<tr id='row_" + dt.Rows[i][SubitemsColumns.IsidColumn] + @"'>
    <td class='tac'>" + (i + 1) + @"</td>
    <td>" + dt.Rows[i][SubitemsColumns.VstitleColumn] + @"<br/>
        " + ImagesExtension.GetImage(pic, dt.Rows[i][SubitemsColumns.VsimageColumn].ToString(), "", "itiImage", false, true, dt.Rows[i][SubitemsColumns.VscontentColumn].ToString()) + @"
    </td>
    <td class='tac'>" + dt.Rows[i][SubitemsColumns.isTotalSubitem] + @"</td>
    <td class='tac'>" + PriceExtension.HienThiGia(dt.Rows[i][SubitemsColumns.fsPrice].ToString(), dt.Rows[i][SubitemsColumns.fsSalePrice].ToString()) + @"</td>
    <td class='tac'>" + dt.Rows[i][SubitemsColumns.isOrder] + @"</td>
    <td class='tac'><span class='EnableIcon" + dt.Rows[i][SubitemsColumns.IsenableColumn] + @"'>&nbsp;</span></td>
    <td class='tac'>
        <a href='javascript:EditRoomType(" + dt.Rows[i][SubitemsColumns.IsidColumn] + @")' class='iconEdit'>Sửa</a>&nbsp;&nbsp;&nbsp;
        <a href='javascript:DeleteRoomType(" + dt.Rows[i][SubitemsColumns.IsidColumn] + @")' class='iconDelete'>Xóa</a>
    </td>
</tr>";
            }


            s += "</table>";
        }

        Response.Write(s);
    }
Esempio n. 9
0
    private void DeleteSubItems(string iid, string pic)
    {
        DataTable dt = new DataTable();

        dt = Subitems.GetSubItems("", SubitemsColumns.IsidColumn, SubitemsTSql.GetSubitemsByIid(iid), "");
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            subItemControl.DeleteSubItem(dt.Rows[i][SubitemsColumns.IsidColumn].ToString(), pic);
        }
    }
Esempio n. 10
0
        /// <summary>
        /// Đếm số hình ảnh trong một album
        /// </summary>
        /// <param name="iid"></param>
        /// <returns></returns>
        public static string CountSubItems(string iid)
        {
            string condition = DataExtension.AndConditon(
                SubitemsTSql.GetSubitemsByIid(iid),
                SubitemsTSql.GetSubitemsByIsenable("1"),
                SubitemsTSql.GetSubitemsByVskey(TatThanhJsc.PhotoAlbumModul.CodeApplications.PhotoAlbumImagesOther));
            DataTable dt = new DataTable();

            dt = Subitems.GetSubItems("", SubitemsColumns.IsidColumn, condition, "");
            return(NumberExtension.FormatNumber(dt.Rows.Count.ToString()));
        }
Esempio n. 11
0
    /// <summary>
    /// Đếm comment cho một blog
    /// </summary>
    /// <param name="iid"></param>
    /// <returns></returns>
    public static string CountComment(string iid)
    {
        string app       = TatThanhJsc.BlogModul.CodeApplications.BlogComment;
        string condition = DataExtension.AndConditon(
            SubitemsTSql.GetByIid(iid),
            SubitemsTSql.GetByApp(app),
            SubitemsTSql.GetByEnable("1")
            );
        DataTable dt = Subitems.GetSubItems("", SubitemsColumns.IsidColumn, condition, "");

        return(NumberExtension.FormatNumber(dt.Rows.Count.ToString()));
    }
 void DeleteComment(string isid)
 {
     #region Xoá trả lời của comment
     DataTable dt = new DataTable();
     dt = Subitems.GetSubItems("", "*", DataExtension.AndConditon(SubitemsTSql.GetSubitemsByVskey(app + "Reply"), SubitemsTSql.GetSubitemsByVsurl(isid)), "");
     for (int i = 0; i < dt.Rows.Count; i++)
     {
         ImagesExtension.DeleteImageWhenDeleteItem(pic, dt.Rows[i][SubitemsColumns.VsimageColumn].ToString());
         Subitems.DeleteSubitems(dt.Rows[i][SubitemsColumns.IsidColumn].ToString());
     }
     #endregion
     Subitems.DeleteSubitems(isid);
 }
    void GetList(string iid)
    {
        DataTable dt = new DataTable();

        condition = DataExtension.AndConditon(
            SubitemsTSql.GetSubitemsByIid(iid),
            SubitemsTSql.GetSubitemsByVskey(app)
            );
        orderBy            = SubitemsColumns.VstitleColumn;
        dt                 = Subitems.GetSubItems("", "*", condition, orderBy);
        rptList.DataSource = dt;
        rptList.DataBind();
    }
Esempio n. 14
0
    void GetInfoUpdate()
    {
        condition = DataExtension.AndConditon(SubitemsTSql.GetSubitemsByIid(iid),
                                              SubitemsTSql.GetSubitemsByVskey(keysubitem),
                                              SubitemsTSql.GetSubitemsByVslang(lang));
        DataTable dt = new DataTable();

        dt = Subitems.GetSubItems("1", " isid, VSTITLE ", condition, "");
        if (dt.Rows.Count > 0)
        {
            isid = dt.Rows[0][SubitemsColumns.IsidColumn].ToString();
        }
    }
    void GetList()
    {
        condition = DataExtension.AndConditon
                    (
            SubitemsTSql.GetSubitemsByIid(iid),
            SubitemsTSql.GetSubitemsByVskey(app)
                    );
        orderby = SubitemsColumns.VsemailColumn + " asc," + SubitemsColumns.VsatuthorColumn + " asc";
        DataTable dt = new DataTable();

        dt = Subitems.GetSubItems("", "*", condition, orderby);
        rptList.DataSource = dt;
        rptList.DataBind();
    }
    void GetListComments()
    {
        condition = DataExtension.AndConditon
                    (
            SubitemsTSql.GetSubitemsByIid(iid),
            SubitemsTSql.GetSubitemsByVskey(app)
                    );
        orderby = SubitemsColumns.DscreatedateColumn + " desc ";
        DataTable dt = new DataTable();

        dt = Subitems.GetSubItems("", "*", condition, orderby);
        rptList.DataSource = dt;
        rptList.DataBind();
    }
    private void InitialControlsValue()
    {
        //Trường hợp sửa loại phòng
        if (isid != "")
        {
            string condition = DataExtension.AndConditon(SubitemsTSql.GetSubitemsByVskey(app),
                                                         SubitemsTSql.GetSubitemsByIsid(isid));

            DataTable dt = Subitems.GetSubItems("1", "*", condition, "");
            if (dt.Rows.Count > 0)
            {
                tbLoaiPhong.Text   = dt.Rows[0][SubitemsColumns.VstitleColumn].ToString();
                tbSuChuaToiDa.Text = dt.Rows[0][SubitemsColumns.isTotalSubitem].ToString();

                tbGiaNiemYet.Text   = dt.Rows[0][SubitemsColumns.fsPrice].ToString();
                tbGiaKhuyenMai.Text = dt.Rows[0][SubitemsColumns.fsSalePrice].ToString();

                #region Bao gồm
                string baoGom = "," + dt.Rows[0][SubitemsColumns.VsemailColumn] + ",";
                for (int i = 0; i < cblBaoGom.Items.Count; i++)
                {
                    if (baoGom.IndexOf("," + cblBaoGom.Items[i].Value + ",") > -1)
                    {
                        cblBaoGom.Items[i].Selected = true;
                    }
                    else
                    {
                        cblBaoGom.Items[i].Selected = false;
                    }
                }
                #endregion

                tbChiTiet.Text  = dt.Rows[0][SubitemsColumns.VscontentColumn].ToString();
                hdChiTiet.Value = dt.Rows[0][SubitemsColumns.VscontentColumn].ToString();

                flAnhDaiDien.Load(dt.Rows[0][SubitemsColumns.VsimageColumn].ToString());

                ddlCoTheTraPhongKhong.SelectedValue = dt.Rows[0][SubitemsColumns.isParam1].ToString();
                ddlCoGomBuaSangKhong.SelectedValue  = dt.Rows[0][SubitemsColumns.isParam2].ToString();

                tbDienTichPhong.Text = dt.Rows[0][SubitemsColumns.vsParam1].ToString();
                tbLoaiGiuong.Text    = dt.Rows[0][SubitemsColumns.vsParam2].ToString();
                tbHuongPhong.Text    = dt.Rows[0][SubitemsColumns.VsurlColumn].ToString();

                tbThuTu.Text        = dt.Rows[0][SubitemsColumns.isOrder].ToString();
                cbTrangThai.Checked = (dt.Rows[0][SubitemsColumns.IsenableColumn].ToString() == "1");
            }
        }
    }
    public void DeleteSubItem(string isid, string pic)
    {
        DataTable dtItem = new DataTable();

        dtItem = Subitems.GetSubItems("", "*", SubitemsTSql.GetSubitemsByIsid(isid), "");
        if (dtItem.Rows.Count > 0)
        {
            string split = TatThanhJsc.AdminModul.Keyword.ParamsSpilitItems;
            #region Xoá trả lời của comment
            DataTable dt = new DataTable();
            dt = Subitems.GetSubItems("", "*", DataExtension.AndConditon(SubitemsTSql.GetSubitemsByVskey(dtItem.Rows[0][SubitemsColumns.VskeyColumn].ToString() + "Reply"), SubitemsTSql.GetSubitemsByVsurl(isid)), "");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                #region Xóa ảnh
                if (dt.Rows[i][SubitemsColumns.VsimageColumn].ToString().IndexOf(split) < 0)
                {
                    ImagesExtension.DeleteImageWhenDeleteItem(pic, dt.Rows[i][SubitemsColumns.VsimageColumn].ToString());
                }
                else
                {
                    foreach (string s in dt.Rows[i][SubitemsColumns.VsimageColumn].ToString().Split(new string[] { split }, StringSplitOptions.RemoveEmptyEntries))
                    {
                        ImagesExtension.DeleteImageWhenDeleteItem(pic, s);
                    }
                }
                #endregion

                Subitems.DeleteSubitems(dt.Rows[i][SubitemsColumns.IsidColumn].ToString());
            }
            #endregion

            #region Xóa ảnh
            if (dtItem.Rows[0][SubitemsColumns.VsimageColumn].ToString().IndexOf(split) < 0)
            {
                ImagesExtension.DeleteImageWhenDeleteItem(pic, dtItem.Rows[0][SubitemsColumns.VsimageColumn].ToString());
            }
            else
            {
                foreach (string s in dtItem.Rows[0][SubitemsColumns.VsimageColumn].ToString().Split(new string[] { split }, StringSplitOptions.RemoveEmptyEntries))
                {
                    ImagesExtension.DeleteImageWhenDeleteItem(pic, s);
                }
            }
            #endregion
            Subitems.DeleteSubitems(isid);
        }
    }
    protected void lnk_delete_user_checked_Click(object sender, EventArgs e)
    {
        string ArrayId = "";

        for (int i = 0; i <= rptList.Items.Count - 1; i++)
        {
            CheckBox chkDelete = (CheckBox)rptList.Items[i].FindControl(("chk_item"));
            if (chkDelete != null)
            {
                if (chkDelete.Checked)
                {
                    ArrayId += chkDelete.ToolTip;
                    ArrayId += ",";
                }
            }
            else
            {
                return;
            }
        }
        if (ArrayId.Length > 0)
        {
            ArrayId = ArrayId.Substring(0, (ArrayId.Length - 1));
        }
        else
        {
            return;
        }

        char[] splitItem = { ',' };


        fields    = DataExtension.GetListColumns(SubitemsColumns.IsidColumn, SubitemsColumns.VsimageColumn);
        condition = " ISID in(" + ArrayId + ") ";
        DataTable dt = new DataTable();

        dt = Subitems.GetSubItems("", fields, condition, "");
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            ImagesExtension.DeleteImageWhenDeleteItem(pathFolderPic, dt.Rows[i][SubitemsColumns.VsimageColumn].ToString());
            Subitems.DeleteSubitems(dt.Rows[i][SubitemsColumns.IsidColumn].ToString());
        }

        chk_list.Checked = false;
        GetList();
    }
    void GetListMes()
    {
        top       = "";
        fields    = " * ";
        condition = DataExtension.AndConditon(SubitemsTSql.GetSubitemsByVskey(CodeApplications.MemberNoticeBQT),
                                              SubitemsTSql.GetSubitemsByVsatuthor(imid)
                                              );
        order = " DSCREATEDATE DESC ";
        DataTable dt = new DataTable();

        dt = Subitems.GetSubItems(top, fields, condition, order);
        if (dt.Rows.Count > 0)
        {
            RpListNoticeBQT.DataSource = dt;
            RpListNoticeBQT.DataBind();
        }
    }
    protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string c = e.CommandName.Trim();
        string p = e.CommandArgument.ToString().Trim();

        fields    = "*";
        condition = SubitemsTSql.GetSubitemsByIsid(p);
        DataTable dt = new DataTable();

        dt = Subitems.GetSubItems("", "*", condition, "");
        switch (c)
        {
            #region Delete
        case "delete":
            ImagesExtension.DeleteImageWhenDeleteItem(pathFolderPic, dt.Rows[0][SubitemsColumns.VsimageColumn].ToString());
            Subitems.DeleteSubitems(p);
            GetList();
            break;

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

            #endregion
            #region Edit
        case "edit":
            //OpenUpdatePanel(p);
            Response.Redirect(UrlExtension.WebisteUrl + "cms/admin/Moduls/Deal/Item/PopUp/AddVideoToItems.aspx?iid=" + iid + "&isid=" + p);
            break;
            #endregion
        }
    }
Esempio n. 22
0
    private void InitialControlsValue()
    {
        //Trường hợp sửa lịch trình
        if (isid != "")
        {
            string condition = DataExtension.AndConditon(SubitemsTSql.GetSubitemsByVskey(app),
                                                         SubitemsTSql.GetSubitemsByIsid(isid));

            DataTable dt = Subitems.GetSubItems("1", "*", condition, "");
            if (dt.Rows.Count > 0)
            {
                tbNgay.Text        = StringExtension.LayChuoi(dt.Rows[0][SubitemsColumns.VstitleColumn].ToString(), "", 1);
                tbTenHoatDong.Text = StringExtension.LayChuoi(dt.Rows[0][SubitemsColumns.VstitleColumn].ToString(), "", 2);
                flAnhDaiDien.Load(dt.Rows[0][SubitemsColumns.VsimageColumn].ToString());

                #region Các điểm đến sẽ qua
                if (dt.Rows[0][SubitemsColumns.VsurlColumn].ToString().StartsWith("text-"))
                {
                    tbCacDiemDenSeQua.Text = dt.Rows[0][SubitemsColumns.VsurlColumn].ToString().Substring("text-".Length);
                }
                if (dt.Rows[0][SubitemsColumns.VsurlColumn].ToString().StartsWith("id-"))
                {
                    hdIdCacDiemDenSeQua.Value = "," + dt.Rows[0][SubitemsColumns.VsurlColumn].ToString().Substring("id-".Length) + ",";
                }
                #endregion

                #region Bữa ăn
                string listId = "," + dt.Rows[0][SubitemsColumns.VsemailColumn].ToString() + ",";
                for (int i = 0; i < cblBuaAn.Items.Count; i++)
                {
                    if (listId.IndexOf("," + cblBuaAn.Items[i].Value + ",") > -1)
                    {
                        cblBuaAn.Items[i].Selected = true;
                    }
                }
                #endregion

                tbThuTu.Text        = dt.Rows[0][SubitemsColumns.VsatuthorColumn].ToString();
                cbTrangThai.Checked = (dt.Rows[0][SubitemsColumns.IsenableColumn].ToString() == "1");

                tbHoatDongChiTiet.Text  = dt.Rows[0][SubitemsColumns.VscontentColumn].ToString();
                hdHoatDongChiTiet.Value = dt.Rows[0][SubitemsColumns.VscontentColumn].ToString();
            }
        }
    }
Esempio n. 23
0
    void GetItems()
    {
        top       = "10";
        fields    = "*";
        condition = DataExtension.AndConditon(
            SubitemsTSql.GetSubitemsByVskey(app),
            SubitemsTSql.GetSubitemsByVslang(language));
        orderBy = SubitemsColumns.DscreatedateColumn + " desc ";

        DataTable dt = new DataTable();

        dt = Subitems.GetSubItems(top, fields, condition, orderBy);
        if (dt.Rows.Count > 0)
        {
            RpItems.DataSource = dt;
            RpItems.DataBind();
        }
    }
Esempio n. 24
0
    /// <summary>
    /// Lấy thông tin của các trường khác trong subitems
    /// </summary>
    private void LoadSubItemInfo()
    {
        #region Không cần thay đổi
        DataTable dt = new DataTable();
        condition = DataExtension.AndConditon(
            SubitemsTSql.GetSubitemsByIid(iid.Value),
            SubitemsTSql.GetSubitemsByVskey(subApp));
        dt = Subitems.GetSubItems("1", "*", condition, "isid desc");
        #endregion

        if (dt.Rows.Count > 0)
        {
            isid.Value = dt.Rows[0][SubitemsColumns.IsidColumn].ToString();

            //Điền dữ liệu ra các controls theo vị trí mà lập trình đã lưu vào.
            //tbTinhTrangHang.Text = dt.Rows[0][SubitemsColumns.VstitleColumn].ToString();
            //ddlXepHangSao.SelectedValue = dt.Rows[0][SubitemsColumns.VscontentColumn].ToString();
        }
    }
Esempio n. 25
0
    void GetProductGroups(string IgidInDll)
    {
        string iid_inListAdded = "";

        fields    = " * ";
        condition = DataExtension.AndConditon(SubitemsTSql.GetSubitemsByIid(igid), SubitemsTSql.GetSubitemsByVskey("PIP"));
        DataTable dtProductInCate = new DataTable();

        dtProductInCate = Subitems.GetSubItems(top, fields, condition, " DSCREATEDATE DESC ");
        if (dtProductInCate.Rows.Count > 0)
        {
            for (int i = 0; i < dtProductInCate.Rows.Count; i++)
            {
                lstadded.Items.Add(new ListItem(loadDataDetail(dtProductInCate.Rows[i]["VSTITLE"].ToString()), dtProductInCate.Rows[i]["VSTITLE"].ToString()));
                iid_inListAdded += dtProductInCate.Rows[i]["VSTITLE"].ToString();
                if (i != (dtProductInCate.Rows.Count - 1))
                {
                    iid_inListAdded += ",";
                }
            }
        }

        DataTable dt            = new DataTable();
        string    conditionItem = "";

        conditionItem = DataExtension.AndConditon(GroupsTSql.GetGroupsByVglang(language), GroupsTSql.GetGroupsByVgapp(Modul), ItemsTSql.GetItemsByIienable("1"), ItemsTSql.GetItemsByViapp(Modul), "ITEMS.IID <> " + igid);
        if (!iid_inListAdded.Equals(""))
        {
            conditionItem += "and ITEMS.IID not in(" + iid_inListAdded + ")";
        }

        if (!IgidInDll.Equals(""))
        {
            conditionItem += " AND " + GroupsItemsTSql.GetItemsInGroupCondition(IgidInDll, "") + " ";
        }
        conditionItem += " AND IGENABLE <> '2' AND IIENABLE <> '2' ";
        dt             = GroupsItems.GetAllData("", "*", conditionItem, " IORDER ASC, DCREATEDATE DESC ");

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            lstnotadded.Items.Add(new ListItem(dt.Rows[i]["VITITLE"].ToString(), dt.Rows[i]["IID"].ToString()));
        }
    }
Esempio n. 26
0
    protected string SoldItems(string id)
    {
        int number = 0;
        int total  = 0;

        condition = DataExtension.AndConditon(
            SubitemsTSql.GetSubitemsByVslang(id),//Lấy chi tiết đơn hàng theo id của item
            SubitemsTSql.GetSubitemsByVskey(CodeApplications.DealCart));
        DataTable dt = Subitems.GetSubItems("", SubitemsColumns.IsidColumn, condition, "");

        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                number = (int.Parse(dt.Rows[i][SubitemsColumns.VsatuthorColumn].ToString()));
                total += (1 * number);
            }
        }
        return(total.ToString());
    }
    void OpenUpdatePanel(string isid)
    {
        ltrInsertUpdate.Text = "Cập nhật tệp đính kèm";
        update            = true;
        currentIsid.Value = isid;
        pnList.Visible    = false;
        pnInsert.Visible  = true;
        condition         = SubitemsTSql.GetSubitemsByIsid(isid);
        DataTable dt = new DataTable();

        dt = Subitems.GetSubItems("", "*", condition, "");
        if (dt.Rows.Count > 0)
        {
            tbName.Text             = dt.Rows[0][SubitemsColumns.VstitleColumn].ToString();
            tbOrder.Text            = dt.Rows[0][SubitemsColumns.VsatuthorColumn].ToString();
            ddlStatus.SelectedValue = dt.Rows[0][SubitemsColumns.IsenableColumn].ToString();
            ltimg.Text = ImagesExtension.GetImage(pathFolderPic, dt.Rows[0][SubitemsColumns.VsimageColumn].ToString(), "", "hotelImage", false, false, "");
            hd_img     = dt.Rows[0][SubitemsColumns.VsimageColumn].ToString();

            #region Files

            string vscontent = dt.Rows[0][SubitemsColumns.VscontentColumn].ToString();
            string file      = StringExtension.LayChuoi(vscontent, "", 1);
            string fileLink  = StringExtension.LayChuoi(vscontent, "", 2);

            if (file.Length > 0)
            {
                ltrFiles.Text = "Tệp hiện tại: <a href='" + TatThanhJsc.Extension.UrlExtension.WebisteUrl + pathFolderPic + "/" +
                                file + "' target='_blank'>" +
                                file + "</a>";
            }
            else
            {
                ltrFiles.Visible = false;
            }
            hdFile.Value = file;

            tbFileLink.Text = fileLink;
            #endregion
        }
    }
    private void InitialControlsValue()
    {
        //Trường hợp sửa hình ảnh
        if (isid != "")
        {
            string condition = DataExtension.AndConditon(SubitemsTSql.GetSubitemsByVskey(app),
                                                         SubitemsTSql.GetSubitemsByIsid(isid));

            DataTable dt = Subitems.GetSubItems("1", "*", condition, "");
            if (dt.Rows.Count > 0)
            {
                tbTieuDe.Text = dt.Rows[0][SubitemsColumns.VstitleColumn].ToString();
                tbMoTa.Text   = dt.Rows[0][SubitemsColumns.VscontentColumn].ToString();
                flAnhDaiDien.Load(dt.Rows[0][SubitemsColumns.VsimageColumn].ToString());


                tbThuTu.Text        = dt.Rows[0][SubitemsColumns.VsatuthorColumn].ToString();
                cbTrangThai.Checked = (dt.Rows[0][SubitemsColumns.IsenableColumn].ToString() == "1");
            }
        }
    }
Esempio n. 29
0
    private string GetOtherImages(string iid)
    {
        string s         = "";
        string s1        = "";
        string pic       = TatThanhJsc.ProductModul.FolderPic.Product;
        string condition = DataExtension.AndConditon
                           (
            SubitemsTSql.GetSubitemsByIid(iid),
            SubitemsTSql.GetSubitemsByVskey(CodeApplications.ProductImagesOther),
            SubitemsTSql.GetByEnable("1")
                           );

        string    orderby = SubitemsColumns.VsatuthorColumn;
        DataTable dt      = new DataTable();

        dt = Subitems.GetSubItems("", "*", condition, orderby);
        if (dt.Rows.Count > 0)
        {
            s  += "<ul class='nav-tabs fade-up'>";
            s1 += " <div class='tab-content fade-up'>";
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                s += @"<li class='tab-link " + (i == 0?"on":"") + @"' data-tab='tab-" + (i + 1) + @"'><span>" + dt.Rows[i][SubitemsColumns.VstitleColumn].ToString() + @"</span> </li>";

                s1 += @"
                <div class='tab-item " + (i == 0 ? "on" : "") + @"' id='tab-" + (i + 1) + @"'>
                    <div class='noidung'>
                       " + ImagesExtension.GetImage(pic, dt.Rows[i][SubitemsColumns.VsimageColumn].ToString(), dt.Rows[i][SubitemsColumns.VstitleColumn].ToString(), "", true, false, "", false) + @"
                    </div>
                </div>";
            }

            s  += @"</ul>";
            s1 += @"</div>";
        }

        return(s + s1);
    }
    protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string c = e.CommandName.Trim();
        string p = e.CommandArgument.ToString().Trim();

        fields    = "*";
        condition = SubitemsTSql.GetSubitemsByIsid(p);

        switch (c)
        {
            #region Delete
        case "delete":
            DeleteComment(p);
            GetListComments();
            break;

            #endregion
            #region Edit Enable
        case "EditEnable":
            DataTable dt = new DataTable();
            dt = Subitems.GetSubItems("", SubitemsColumns.IsenableColumn, condition, "");
            string[] fieldsEnable = { SubitemsColumns.IsenableColumn };
            string[] valuesEnable = { "" };
            if (dt.Rows[0][SubitemsColumns.IsenableColumn].ToString().Equals("0"))
            {
                valuesEnable[0] = "1";
                Subitems.UpdateSubitems(DataExtension.UpdateTransfer(fieldsEnable, valuesEnable), condition);
            }
            else
            {
                valuesEnable[0] = "0";
                Subitems.UpdateSubitems(DataExtension.UpdateTransfer(fieldsEnable, valuesEnable), condition);
            }
            GetListComments();
            break;
            #endregion
        }
    }