コード例 #1
0
    protected void rp_mn_users_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string c = e.CommandName.Trim();
        string p = e.CommandArgument.ToString().Trim();

        fields    = "*";
        condition = ItemsTSql.GetItemsCondition(p, app);
        DataTable dt = new DataTable();

        dt = GroupsItems.GetAllData(top, fields, condition, orderBy);
        switch (c)
        {
            #region Delete
        case "delete":
            TatThanhJsc.Database.Items.DeleteItems(ItemsTSql.GetItemsByIid(p));
            break;

            #endregion
            #region Edit Enable
        case "EditEnable":
            string[] fieldsEnable = { "IIENABLE" };
            string[] valuesEnable = { "" };
            if (dt.Rows[0]["IIENABLE"].ToString().Equals("0"))
            {
                valuesEnable[0] = "1";
                TatThanhJsc.Database.Items.UpdateItems(DataExtension.UpdateTransfer(fieldsEnable, valuesEnable), condition);
            }
            else
            {
                valuesEnable[0] = "0";
                TatThanhJsc.Database.Items.UpdateItems(DataExtension.UpdateTransfer(fieldsEnable, valuesEnable), condition);
            }
            GetVotes();
            break;

            #endregion
            #region Edit
        case "edit":
            pnList.Visible       = false;
            pnShorcut.Visible    = true;
            hdInsertUpdate.Value = "update";
            HdId.Value           = dt.Rows[0]["IID"].ToString();
            TbRep.Text           = dt.Rows[0]["VITITLE"].ToString();
            if (dt.Rows[0]["IIENABLE"].ToString().Equals("1"))
            {
                cbEnable.Checked = true;
            }
            else
            {
                cbEnable.Checked = false;
            }

            break;
            #endregion
        }
    }
コード例 #2
0
    protected void rp_mn_users_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string c = e.CommandName.Trim();
        string p = e.CommandArgument.ToString().Trim();

        fields    = "*";
        condition = ItemsTSql.GetItemsCondition(p, app);

        switch (c)
        {
            #region Delete
        case "delete":
            string[] fieldsDelItem = { "IIENABLE", ItemsColumns.DiupdateColumn };
            string[] valuesDelItem = { "2", "'" + DateTime.Now.ToString() + "'" };

            Items.UpdateItems(DataExtension.UpdateTransfer(fieldsDelItem, valuesDelItem), condition);
            GetService("");
            break;

            #endregion
            #region Edit Enable
        case "EditEnable":
            DataTable dt = new DataTable();
            dt = GroupsItems.GetAllData(top, fields, condition, orderBy);

            string[] fieldsEnable = { "IIENABLE" };
            string[] valuesEnable = { "" };
            if (dt.Rows[0]["IIENABLE"].ToString().Equals("0"))
            {
                valuesEnable[0] = "1";
                Items.UpdateItems(DataExtension.UpdateTransfer(fieldsEnable, valuesEnable), condition);
            }
            else
            {
                valuesEnable[0] = "0";
                Items.UpdateItems(DataExtension.UpdateTransfer(fieldsEnable, valuesEnable), condition);
            }
            GetService("");
            break;

            #endregion
            #region Edit
        case "edit":
            Response.Redirect(LinkUpdate(p));
            break;
            #endregion
        }
    }
コード例 #3
0
    void ReportItemsWebsite()
    {
        #region Report New
        DataTable DtNew = new DataTable();
        DtNew = Items.GetItems("", "IITOTALVIEW", ItemsTSql.GetItemsCondition("", TatThanhJsc.NewsModul.CodeApplications.News), "");
        if (DtNew.Rows.Count > 0)
        {
            TotolNumberNew = DtNew.Rows.Count;
            for (int i = 0; i < DtNew.Rows.Count; i++)
            {
                TotolViewNew = TotolViewNew + Convert.ToDouble(DtNew.Rows[i]["IITOTALVIEW"]);
            }
        }
        #endregion

        #region Report Product
        DataTable DtProduct = new DataTable();
        DtProduct = Items.GetItems("", "IITOTALVIEW", ItemsTSql.GetItemsCondition("", TatThanhJsc.ProductModul.CodeApplications.Product), "");
        if (DtProduct.Rows.Count > 0)
        {
            TotolNumberProduct = DtProduct.Rows.Count;
            for (int i = 0; i < DtProduct.Rows.Count; i++)
            {
                TotolViewProduct = TotolViewProduct + Convert.ToDouble(DtProduct.Rows[i]["IITOTALVIEW"]);
            }
        }
        #endregion

        #region Report Service
        DataTable DtService = new DataTable();
        DtService = Items.GetItems("", "IITOTALVIEW", ItemsTSql.GetItemsCondition("", TatThanhJsc.ServiceModul.CodeApplications.Service), "");
        if (DtService.Rows.Count > 0)
        {
            TotolNumberService = DtService.Rows.Count;
            for (int i = 0; i < DtService.Rows.Count; i++)
            {
                TotolViewService = TotolViewService + Convert.ToDouble(DtService.Rows[i]["IITOTALVIEW"]);
            }
        }
        #endregion

        #region Report QA
        DataTable DtQa = new DataTable();
        DtQa = Items.GetItems("", "IITOTALVIEW", ItemsTSql.GetItemsCondition("", TatThanhJsc.QAModul.CodeApplications.QA), "");
        if (DtQa.Rows.Count > 0)
        {
            TotolNumberQa = DtQa.Rows.Count;
            for (int i = 0; i < DtQa.Rows.Count; i++)
            {
                TotolViewQa = TotolViewQa + Convert.ToDouble(DtQa.Rows[i]["IITOTALVIEW"]);
            }
        }
        #endregion

        #region Report Customer
        DataTable DtCustomer = new DataTable();
        DtCustomer = Items.GetItems("", "IITOTALVIEW", ItemsTSql.GetItemsCondition("", TatThanhJsc.CustomerModul.CodeApplications.Customer), "");
        if (DtCustomer.Rows.Count > 0)
        {
            TotolNumberCustomer = DtCustomer.Rows.Count;
            for (int i = 0; i < DtCustomer.Rows.Count; i++)
            {
                TotolViewCustomer = TotolViewCustomer + Convert.ToDouble(DtCustomer.Rows[i]["IITOTALVIEW"]);
            }
        }
        #endregion

        #region Report Adv
        DataTable DtAdvertising = new DataTable();
        DtAdvertising = Items.GetItems("", "IITOTALVIEW", ItemsTSql.GetItemsCondition("", TatThanhJsc.AdvertisingModul.CodeApplications.Advertising), "");
        if (DtAdvertising.Rows.Count > 0)
        {
            TotolNumberAdvertising = DtAdvertising.Rows.Count;
            for (int i = 0; i < DtAdvertising.Rows.Count; i++)
            {
                TotolViewAdvertising = TotolViewAdvertising + Convert.ToDouble(DtAdvertising.Rows[i]["IITOTALVIEW"]);
            }
        }
        #endregion

        #region Report PhotoAlbum
        DataTable DtPhotolAlbum = new DataTable();
        DtPhotolAlbum = Items.GetItems("", "IITOTALVIEW", ItemsTSql.GetItemsCondition("", TatThanhJsc.PhotoAlbumModul.CodeApplications.PhotoAlbum), "");
        if (DtPhotolAlbum.Rows.Count > 0)
        {
            TotolNumberPhotolAlbum = DtPhotolAlbum.Rows.Count;
            for (int i = 0; i < DtPhotolAlbum.Rows.Count; i++)
            {
                TotolViewPhotolAlbum = TotolViewPhotolAlbum + Convert.ToDouble(DtPhotolAlbum.Rows[i]["IITOTALVIEW"]);
            }
        }
        #endregion

        #region Report FileLibrary
        DataTable DtFileLibrary = new DataTable();
        DtFileLibrary = Items.GetItems("", "IITOTALVIEW", ItemsTSql.GetItemsCondition("", TatThanhJsc.FileLibraryModul.CodeApplications.FileLibrary), "");
        if (DtFileLibrary.Rows.Count > 0)
        {
            TotolNumberFileLibrary = DtFileLibrary.Rows.Count;
            for (int i = 0; i < DtFileLibrary.Rows.Count; i++)
            {
                TotolViewFileLibrary = TotolViewFileLibrary + Convert.ToDouble(DtFileLibrary.Rows[i]["IITOTALVIEW"]);
            }
        }
        #endregion

        #region Report Video
        DataTable DtVideo = new DataTable();
        DtVideo = Items.GetItems("", "IITOTALVIEW", ItemsTSql.GetItemsCondition("", TatThanhJsc.VideoModul.CodeApplications.Video), "");
        if (DtVideo.Rows.Count > 0)
        {
            TotolNumberVideo = DtVideo.Rows.Count;
            for (int i = 0; i < DtVideo.Rows.Count; i++)
            {
                TotolViewVideo = TotolViewVideo + Convert.ToDouble(DtVideo.Rows[i]["IITOTALVIEW"]);
            }
        }
        #endregion

        LtScriptChartTotalItem.Text = @"
            var chartData1 = [{
            country1: 'Tin tức:',
            value: " + TotolNumberNew + @"
        }, {
            country1: 'Sản phẩm:',
            value: " + TotolNumberProduct + @"
        }, {
            country1: 'Dịch vụ:',
            value: " + TotolNumberService + @"
        }, {
            country1:  'Thư viện ảnh:',
            value: " + TotolNumberPhotolAlbum + @"
        }, {
            country1: 'Thư viện dữ liệu:',
            value: " + TotolNumberFileLibrary + @"
        }, {
            country1: 'Quảng cáo:',
            value: " + TotolNumberAdvertising + @"
        }];
";

        LtScriptChart.Text = @"
            var chartData = [{
            country: 'Tin tức:',
            value: " + TotolViewNew + @"
        }, {
            country: 'Sản phẩm:',
            value: " + TotolViewProduct + @"
        }, {
            country: 'Dịch vụ:',
            value: " + TotolViewService + @"
        }, {
            country:  'Thư viện ảnh:',
            value: " + TotolViewPhotolAlbum + @"
        }, {
            country: 'Thư viện dữ liệu:',
            value: " + TotolViewFileLibrary + @"
        }, {
            country: 'Quảng cáo:',
            value: " + TotolViewAdvertising + @"
        }];
";
    }