Example #1
0
        //gv绑定
        public void ListViewBind3()
        {
            string Str1 = " where ui_status='正常' and ui_lx='企业'";

            if (!string.IsNullOrEmpty(bm2.SelectedItem.Value))
            {
                if (bm2.SelectedItem.Value == "1000000")
                {
                    Str1 = Str1 + " and yn_bmglz='是'";
                }
                else
                {
                    Str1 = Str1 + " and ui_ssbm= '" + bm2.SelectedItem.Value + "' ";
                }
            }

            if (!string.IsNullOrEmpty(cxtj2.Text))
            {
                Str1 = Str1 + " AND (UI_ID LIKE '%" + hkdb.GetStr(cxtj2.Text) + "%' OR UI_DESC LIKE '%" + hkdb.GetStr(cxtj2.Text) + "%')";
            }
            AspNetPager3.RecordCount = (int)SqlHelper.ExecuteScalar("select count(*) from yh" + Str1);
            DataSet ds = SqlHelper.ExecuteDs("select ui_id,ui_desc,ui_sex,ui_lx,(case when yn_bmglz='是' then 'ch' else 'noch' end)as yn_bmglz,b.bm_mc,c.zwmc from yh a left outer JOIN BM b on (a.ui_ssbm=b.bm_id)left outer JOIN ZW c on (a.ui_zw=c.zwid)" + Str1 + "order by a.number", AspNetPager3.PageSize * (AspNetPager3.CurrentPageIndex - 1), AspNetPager3.PageSize);

            ListView3.DataSource = ds;
            ListView3.DataBind();
        }
Example #2
0
    private void FoodmenuShow()
    {
        // ListView1.DataSource = uc.ShowFoodMenu();
        // ListView1.DataBind();
        try
        {
            ListView1.DataSource = uc.GetfoodmenuSunday();
            ListView1.DataBind();

            ListView2.DataSource = uc.GetfoodmenuMonday();
            ListView2.DataBind();

            ListView3.DataSource = uc.GetfoodmenuTuesday();
            ListView3.DataBind();

            ListView4.DataSource = uc.GetfoodmenuWednesday();
            ListView4.DataBind();

            ListView5.DataSource = uc.GetfoodmenuThursday();
            ListView5.DataBind();

            ListView6.DataSource = uc.GetfoodmenuFriday();
            ListView6.DataBind();

            ListView7.DataSource = uc.GetfoodmenuSaturday();
            ListView7.DataBind();
        }
        catch (Exception ex)
        {
            string text = ex.Message.ToString();
            ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpoperror('" + text + "')</script>", false);
        }
    }
 protected void txtSearch_TextChanged(object sender, EventArgs e)
 {
     try
     {
         if (Session["propertyvalue"] != null)
         {
             string tc_PropertyVal = Session["propertyvalue"].ToString();
             ListView1.DataSource = uc.GetNewComplaintsbySearch(tc_PropertyVal, txtSearch.Text);
             ListView1.DataBind();
             ListView2.DataSource = uc.GetOngoingComplaintsbySearch(tc_PropertyVal, txtSearch.Text);
             ListView2.DataBind();
             ListView3.DataSource = uc.GetResolvedComplaintsbySearch(tc_PropertyVal, txtSearch.Text);
             ListView3.DataBind();
         }
         else
         {
             Session["propertyvalue"] = "0";
         }
     }
     catch (Exception ex)
     {
         string text = ex.Message.ToString();
         ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpoperror('" + text + "')</script>", false);
     }
 }
Example #4
0
        protected void getdata()
        {
            SqlDataAdapter top4 = new SqlDataAdapter("IUD_BaiViet", cnn);

            top4.SelectCommand.CommandType = CommandType.StoredProcedure;
            top4.SelectCommand.Parameters.AddWithValue("@action", "select_new");
            DataTable dt4 = new DataTable();

            top4.Fill(dt4);
            ListView1.DataSource = dt4;
            ListView1.DataBind();

            SqlDataAdapter topTT4 = new SqlDataAdapter("IUD_BaiViet", cnn);

            topTT4.SelectCommand.CommandType = CommandType.StoredProcedure;
            topTT4.SelectCommand.Parameters.AddWithValue("@action", "select_new");
            DataTable dtTT4 = new DataTable();

            topTT4.Fill(dtTT4);
            ListView2.DataSource = dtTT4;
            ListView2.DataBind();

            SqlDataAdapter topDA4 = new SqlDataAdapter("IUD_DuAn", cnn);

            topDA4.SelectCommand.CommandType = CommandType.StoredProcedure;
            topDA4.SelectCommand.Parameters.AddWithValue("@action", "select_top4");
            DataTable dtDA4 = new DataTable();

            topDA4.Fill(dtDA4);
            ListView3.DataSource = dtDA4;
            ListView3.DataBind();
        }
 public void fill_list2()
 {
     cmd.CommandText = "select * from tblcardetails cd , tblcarname cn where cn.cn_status = 'Enabled' and cd.cn_id=cn.cn_id";
     dt = da.GetRecords(cmd);
     ListView3.DataSource = dt;
     ListView3.DataBind();
 }
Example #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     SqlDataSource1.SelectCommand = "select Utente, count(Utente) as 'Preghiere' From FedPreg group by Utente order By Preghiere Desc";
     SqlDataSource2.SelectCommand = "select Data, count(Data) as 'Preghiere' From FedPreg group by Data order By Data Desc";
     SqlDataSource3.SelectCommand = "select count(id) as tot from FedPreg";
     ListView3.DataSourceID       = "SqlDataSource3";
     ListView3.DataBind();
 }
Example #7
0
        private void BindFoundLostTime()
        {
            DataTable dt = Bll.FoundService.SelectTopOne();

            if (dt != null && dt.Rows.Count > 0)
            {
                ListView3.DataSource = dt;
                ListView3.DataBind();
            }
        }
Example #8
0
        private void Bindlanqiu()
        {
            DataTable dt = BLL.CommodityManager.SelectlanqiuTop4();

            if (dt != null && dt.Rows.Count != 0)
            {
                ListView3.DataSource = dt;
                ListView3.DataBind();
            }
        }
Example #9
0
        private void BindProduct3()
        {
            DataTable dt = ProductService.SelectManRight();

            if (dt != null && dt.Rows.Count != 0)
            {
                ListView3.DataSource = dt;
                ListView3.DataBind();
            }
        }
Example #10
0
 protected void ListView3_ItemCommand(object sender, ListViewCommandEventArgs e)
 {
     if (e.CommandName == "fahuo")
     {
         string orderid = e.CommandArgument.ToString();
         Oorder.updatestate(orderid, 2);
         ListView3.DataBind();
         ListView4.DataBind();
     }
 }
Example #11
0
        private void BindIS()
        {
            DataTable dt = InterestService.SelectTop2();

            if (dt != null && dt.Rows.Count != 0)
            {
                ListView3.DataSource = dt;
                ListView3.DataBind();
            }
        }
Example #12
0
        private void refresh(String user_id)
        {
            DataTable dt = TaskSystem.tools.GetData("SELECT top 10 issue.issueIndex, project.short, issue.title FROM [issue] JOIN project on issue.project_id=project.id join users on users.id=issue.assigne_id where issue.assigne_id=" + user_id + " order by issue.id desc ");

            ListView2.DataSource = dt;
            ListView2.DataBind();

            DataTable dt2 = TaskSystem.tools.GetData("SELECT top 10 issue.issueIndex, project.short, issue.title FROM [issue] JOIN project on issue.project_id=project.id join users on users.id=issue.assigne_id order by issue.id desc ");

            ListView3.DataSource = dt2;
            ListView3.DataBind();
        }
Example #13
0
    private void GetImagesData()
    {
        Database db        = new Database();
        Lang     lang      = new Lang();
        string   sqlSearch = "select * from albums where lang=@lang Order by id desc";

        db.AddParameter("@lang", lang.getCurrentLang());
        DataTable dt = db.ExecuteDataTable(sqlSearch);

        ListView3.DataSource = dt;
        ListView3.DataBind();
    }
Example #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter("select * from Books", cons);
            DataTable      dt             = new DataTable();

            sqlDataAdapter.Fill(dt);
            ListView1.DataSource = dt;
            ListView1.DataBind();
            ListView2.DataSource = dt;
            ListView2.DataBind();
            ListView3.DataSource = dt;
            ListView3.DataBind();
        }
Example #15
0
        protected void Button4_Click(object sender, EventArgs e)
        {
            System.Web.UI.HtmlControls.HtmlTextArea textArea = (System.Web.UI.HtmlControls.HtmlTextArea)(form1.FindControl("otherSkills"));
            String otherSkill = textArea.Value;

            if (otherSkill.Equals(""))
            {
                otherSkillsError.Text = "Ju lutem plotesoni fushen!";
            }
            else
            {
                int user = Convert.ToInt32(Session["id"]);
                NormalUserDB.addOtherSkill(otherSkill, user);
                textArea.Value = "";
                ListView3.DataBind();
            }
        }
 private void ShowResolvedcomplaints()
 {
     try
     {
         if (Session["propertyvalue"] != null)
         {
             string tc_PropertyVal = Session["propertyvalue"].ToString();
             ListView3.DataSource = uc.GetResolvedComplaints(tc_PropertyVal);
             ListView3.DataBind();
         }
         else
         {
             Session["propertyvalue"] = "0";
         }
     }
     catch (Exception ex)
     {
         string text = ex.Message.ToString();
         ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpoperror('" + text + "')</script>", false);
     }
 }
Example #17
0
    protected void lnkbtn_Command(object sender, CommandEventArgs e)
    {
        double filepath = double.Parse(e.CommandName.ToString());

        cn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True");
        cn.Open();
        string g = "select * from DeskWallpaper where id='" + filepath + "'";

        cmd = new SqlCommand(g, cn);
        // dr = cmd.ExecuteReader();
        da = new SqlDataAdapter(cmd);
        ds = new DataSet();
        da.Fill(ds);
        string path = ds.Tables[0].Rows[0][1].ToString();

        //string path = dr["image"].ToString();
        //  Response.Write(path);

        string   path1 = Server.MapPath(path);
        FileInfo file  = new FileInfo(path1);

        if (file.Exists)
        {
            file.Delete();
        }


        string gg = "delete from DeskWallpaper where id='" + filepath + "'";

        cmd = new SqlCommand(gg, cn);
        cmd.ExecuteNonQuery();

        cn.Close();
        Response.Write("<script>alert('Image Deleted Successfully')</script>");
        ListView3.DataBind();
    }
Example #18
0
 //绑定作品被评论
 protected void BindReplyComments()
 {
     ListView3.DataSource = CommentService.Select(int.Parse(Session["User_ID"].ToString()));
     ListView3.DataBind();
 }
Example #19
0
        public void getSource()
        {
            List <ListItems> columnList = new List <ListItems>();

            if (auth.CompleteAuthorization(Request.Url) == true)
            {
                dict = new DictionaryDB();
                var twitterCtx = new LinqToTwitter.TwitterContext(auth);

                var tweets = from t in twitterCtx.Status
                             where t.Type == StatusType.User && t.ScreenName == DropDownList1.SelectedValue && t.Count == Int32.Parse(tweetnum.SelectedValue)
                             select t;

                foreach (var tweetStatus in tweets)
                {
                    var listItem          = new ListItems();
                    List <UrlEntity> Urle = tweetStatus.Entities.UrlEntities;
                    foreach (var url in Urle)
                    {
                        if (!string.IsNullOrWhiteSpace(url.ExpandedUrl))
                        {
                            listItem.url = url.ExpandedUrl;
                        }
                    }
                    listItem.tweet = tweetStatus.Text;
                    listItem.date  = tweetStatus.CreatedAt;
                    if (!string.IsNullOrEmpty(dict.getTweetCategory(tweetStatus.Text)))
                    {
                        listItem.category = dict.getTweetCategory(tweetStatus.Text);
                    }
                    else
                    {
                        listItem.category = "Others";
                    }
                    columnList.Add(listItem);
                }

                ListView1.DataSource = columnList.AsQueryable().ToArray();
                ListView1.DataBind();

                if (tweets != null)
                {
                    var dictionaryword = dict.getDictionaryWords();
                    foreach (var tweetStatus in tweets)
                    {
                        foreach (string word in dictionaryword)
                        {
                            if (tweetStatus.Text.Contains(word) == true)
                            {
                                string category = dict.getWordCategory(word);
                                break;
                            }
                        }
                    }



                    #region Pie Charts (Home, Network, Desktop, Mobile, Others)
                    foreach (var tweetStatus in tweets)
                    {
                        if (!string.IsNullOrEmpty(dict.getTweetCategory(tweetStatus.Text)))
                        {
                            if (dict.getTweetCategory(tweetStatus.Text) == "Network")
                            {
                                NetworkList.Add(tweetStatus);
                                networkCategory++;
                                #region Network Pie Chart
                                if (dict.getSecTweetCategory(tweetStatus.Text) == "Emails")
                                {
                                    emailCategory++;
                                }
                                else if (dict.getSecTweetCategory(tweetStatus.Text) == "Online Game")
                                {
                                    OnlineCategory++;
                                }
                                else if (dict.getSecTweetCategory(tweetStatus.Text) == "Social Media")
                                {
                                    SocialCategory++;
                                }
                                else if (dict.getSecTweetCategory(tweetStatus.Text) == "Server")
                                {
                                    ServerCategory++;
                                }
                                else if (dict.getSecTweetCategory(tweetStatus.Text) == "Website")
                                {
                                    WebsiteCategory++;
                                }

                                else
                                {
                                    netotherCategory++;
                                }
                                #endregion
                            }
                            else if (dict.getTweetCategory(tweetStatus.Text) == "Desktop")
                            {
                                desktopCategory++;
                                DesktopList.Add(tweetStatus);
                                #region Desktop Pie Chart
                                if (dict.getSecTweetCategory(tweetStatus.Text) == "Com Hardware")
                                {
                                    DHCategory++;
                                }
                                else if (dict.getSecTweetCategory(tweetStatus.Text) == "Com Software")
                                {
                                    DSCategory++;
                                }
                                else if (dict.getSecTweetCategory(tweetStatus.Text) == "Operating System")
                                {
                                    OperatingCategory++;
                                }
                                else
                                {
                                    DeskOtherCategory++;
                                }
                                #endregion
                            }
                            else if (dict.getTweetCategory(tweetStatus.Text) == "Mobile")
                            {
                                mobileCategory++;
                                MobileList.Add(tweetStatus);
                                #region Mobile Pie Chart
                                if (dict.getSecTweetCategory(tweetStatus.Text) == "Telecommunication")
                                {
                                    telecomCategory++;
                                }
                                else if (dict.getSecTweetCategory(tweetStatus.Text) == "Hardware")
                                {
                                    MHCategory++;
                                }
                                else if (dict.getSecTweetCategory(tweetStatus.Text) == "Software")
                                {
                                    MSCategory++;
                                }
                                else if (dict.getSecTweetCategory(tweetStatus.Text) == "Platform")
                                {
                                    PlatformCategory++;
                                }
                                else
                                {
                                    MobOtherCategory++;
                                }
                                #endregion
                            }
                        }
                        else
                        {
                            otherCategory++;
                            OthersList.Add(tweetStatus);
                        }
                    }
                    #endregion

                    #region Home Categories (Segment)
                    if (networkCategory != 0)
                    {
                        DataPoint network = new DataPoint();
                        network.SetValueXY("Network", networkCategory);
                        Chart1.Series[0].Points.Add(network);
                        Chart1.Series["Series1"]["PieLabelStyle"] = "outside";
                        columnList.Clear();
                        foreach (var tweetStatus in NetworkList)
                        {
                            var listItem          = new ListItems();
                            List <UrlEntity> Urle = tweetStatus.Entities.UrlEntities;
                            foreach (var url in Urle)
                            {
                                if (!string.IsNullOrWhiteSpace(url.ExpandedUrl))
                                {
                                    listItem.url = url.ExpandedUrl;
                                }
                            }
                            listItem.tweet = tweetStatus.Text;
                            listItem.date  = tweetStatus.CreatedAt;
                            if (!string.IsNullOrEmpty(dict.getSecTweetCategory(tweetStatus.Text)))
                            {
                                listItem.category = dict.getSecTweetCategory(tweetStatus.Text);
                            }
                            else
                            {
                                listItem.category = "Others";
                            }
                            columnList.Add(listItem);
                        }
                        ListView2.DataSource = columnList.AsQueryable().ToArray();
                        ListView2.DataBind();
                    }
                    if (desktopCategory != 0)
                    {
                        DataPoint desktop = new DataPoint();
                        desktop.SetValueXY("Desktop", desktopCategory);
                        Chart1.Series[0].Points.Add(desktop);
                        Chart1.Series["Series1"]["PieLabelStyle"] = "outside";
                        columnList.Clear();
                        foreach (var tweetStatus in DesktopList)
                        {
                            var listItem          = new ListItems();
                            List <UrlEntity> Urle = tweetStatus.Entities.UrlEntities;
                            foreach (var url in Urle)
                            {
                                if (!string.IsNullOrWhiteSpace(url.ExpandedUrl))
                                {
                                    listItem.url = url.ExpandedUrl;
                                }
                            }
                            listItem.tweet = tweetStatus.Text;
                            listItem.date  = tweetStatus.CreatedAt;
                            if (!string.IsNullOrEmpty(dict.getSecTweetCategory(tweetStatus.Text)))
                            {
                                listItem.category = dict.getSecTweetCategory(tweetStatus.Text);
                            }
                            else
                            {
                                listItem.category = "Others";
                            }
                            columnList.Add(listItem);
                        }
                        ListView4.DataSource = columnList.AsQueryable().ToArray();
                        ListView4.DataBind();
                    }
                    if (mobileCategory != 0)
                    {
                        DataPoint mobile = new DataPoint();
                        mobile.SetValueXY("Mobile", mobileCategory);
                        Chart1.Series[0].Points.Add(mobile);
                        Chart1.Series["Series1"]["PieLabelStyle"] = "outside";
                        columnList.Clear();
                        foreach (var tweetStatus in MobileList)
                        {
                            var listItem          = new ListItems();
                            List <UrlEntity> Urle = tweetStatus.Entities.UrlEntities;
                            foreach (var url in Urle)
                            {
                                if (!string.IsNullOrWhiteSpace(url.ExpandedUrl))
                                {
                                    listItem.url = url.ExpandedUrl;
                                }
                            }
                            listItem.tweet = tweetStatus.Text;
                            listItem.date  = tweetStatus.CreatedAt;
                            if (!string.IsNullOrEmpty(dict.getSecTweetCategory(tweetStatus.Text)))
                            {
                                listItem.category = dict.getSecTweetCategory(tweetStatus.Text);
                            }
                            else
                            {
                                listItem.category = "Others";
                            }
                            columnList.Add(listItem);
                        }
                        ListView3.DataSource = columnList.AsQueryable().ToArray();
                        ListView3.DataBind();
                    }
                    if (otherCategory != 0)
                    {
                        DataPoint others = new DataPoint();
                        others.SetValueXY("Others", otherCategory);
                        Chart1.Series["Series1"]["PieLabelStyle"] = "outside";
                        Chart1.Series[0].Points.Add(others);
                        columnList.Clear();
                        foreach (var tweetStatus in OthersList)
                        {
                            var listItem          = new ListItems();
                            List <UrlEntity> Urle = tweetStatus.Entities.UrlEntities;
                            foreach (var url in Urle)
                            {
                                if (!string.IsNullOrWhiteSpace(url.ExpandedUrl))
                                {
                                    listItem.url = url.ExpandedUrl;
                                }
                            }
                            listItem.tweet = tweetStatus.Text;
                            listItem.date  = tweetStatus.CreatedAt;
                            if (!string.IsNullOrEmpty(dict.getSecTweetCategory(tweetStatus.Text)))
                            {
                                listItem.category = dict.getSecTweetCategory(tweetStatus.Text);
                            }
                            else
                            {
                                listItem.category = "Others";
                            }
                            columnList.Add(listItem);
                        }
                        ListView5.DataSource = columnList.AsQueryable().ToArray();
                        ListView5.DataBind();
                    }
                    #endregion

                    #region Network Categories (Segment)
                    if (emailCategory != 0)
                    {
                        DataPoint email = new DataPoint();
                        email.SetValueXY("Email", emailCategory);
                        Chart2.Series[0].Points.Add(email);
                        Chart2.Series["Series1"]["PieLabelStyle"] = "outside";
                    }
                    if (OnlineCategory != 0)
                    {
                        DataPoint onlinegame = new DataPoint();
                        onlinegame.SetValueXY("Online Game", OnlineCategory);
                        Chart2.Series[0].Points.Add(onlinegame);
                        Chart2.Series["Series1"]["PieLabelStyle"] = "outside";
                    }
                    if (SocialCategory != 0)
                    {
                        DataPoint social = new DataPoint();
                        social.SetValueXY("Social Media", SocialCategory);
                        Chart2.Series[0].Points.Add(social);
                        Chart2.Series["Series1"]["PieLabelStyle"] = "outside";
                    }
                    if (WebsiteCategory != 0)
                    {
                        DataPoint website = new DataPoint();
                        website.SetValueXY("Website", WebsiteCategory);
                        Chart2.Series[0].Points.Add(website);
                        Chart2.Series["Series1"]["PieLabelStyle"] = "outside";
                    }
                    if (ServerCategory != 0)
                    {
                        DataPoint server = new DataPoint();
                        server.SetValueXY("Server", ServerCategory);
                        Chart2.Series[0].Points.Add(server);
                        Chart2.Series["Series1"]["PieLabelStyle"] = "outside";
                    }
                    if (netotherCategory != 0)
                    {
                        DataPoint netother = new DataPoint();
                        netother.SetValueXY("Others", netotherCategory);
                        Chart2.Series[0].Points.Add(netother);
                        Chart2.Series["Series1"]["PieLabelStyle"] = "outside";
                    }
                    if (emailCategory == 0 && OnlineCategory == 0 && SocialCategory == 0 && WebsiteCategory == 0 && ServerCategory == 0 && netotherCategory == 0)
                    {
                        Chart2.Visible = false;
                    }
                    #endregion

                    #region Mobile Category (Segment)
                    if (telecomCategory != 0)
                    {
                        DataPoint telecom = new DataPoint();
                        telecom.SetValueXY("Telecom", telecomCategory);
                        Chart3.Series[0].Points.Add(telecom);
                        Chart3.Series["Series1"]["PieLabelStyle"] = "outside";
                    }

                    if (MHCategory != 0)
                    {
                        DataPoint mobhardware = new DataPoint();
                        mobhardware.SetValueXY("Hardware", MHCategory);
                        Chart3.Series[0].Points.Add(mobhardware);
                        Chart3.Series["Series1"]["PieLabelStyle"] = "outside";
                    }

                    if (MSCategory != 0)
                    {
                        DataPoint mobsoftware = new DataPoint();
                        mobsoftware.SetValueXY("Software", MSCategory);
                        Chart3.Series[0].Points.Add(mobsoftware);
                        Chart3.Series["Series1"]["PieLabelStyle"] = "outside";
                    }

                    if (PlatformCategory != 0)
                    {
                        DataPoint platform = new DataPoint();
                        platform.SetValueXY("Platform", PlatformCategory);
                        Chart3.Series[0].Points.Add(platform);
                        Chart3.Series["Series1"]["PieLabelStyle"] = "outside";
                    }

                    if (MobOtherCategory != 0)
                    {
                        DataPoint mobothers = new DataPoint();
                        mobothers.SetValueXY("Others", MobOtherCategory);
                        Chart3.Series[0].Points.Add(mobothers);
                        Chart3.Series["Series1"]["PieLabelStyle"] = "outside";
                    }

                    if (telecomCategory == 0 && MHCategory == 0 && MSCategory == 0 && PlatformCategory == 0 && MobOtherCategory == 0)
                    {
                        Chart3.Visible = false;
                    }
                    #endregion

                    #region Desktop Categories (Segment)
                    if (DHCategory != 0)
                    {
                        DataPoint DeskHardware = new DataPoint();
                        DeskHardware.SetValueXY("Hardware", DHCategory);
                        Chart4.Series[0].Points.Add(DeskHardware);
                        Chart4.Series["Series1"]["PieLabelStyle"] = "outside";
                    }

                    if (DSCategory != 0)
                    {
                        DataPoint DeskSoftware = new DataPoint();
                        DeskSoftware.SetValueXY("Software", DSCategory);
                        Chart4.Series[0].Points.Add(DeskSoftware);
                        Chart4.Series["Series1"]["PieLabelStyle"] = "outside";
                    }

                    if (OperatingCategory != 0)
                    {
                        DataPoint OS = new DataPoint();
                        OS.SetValueXY("Operating System", OperatingCategory);
                        Chart4.Series[0].Points.Add(OS);
                        Chart4.Series["Series1"]["PieLabelStyle"] = "outside";
                    }

                    if (DeskOtherCategory != 0)
                    {
                        DataPoint DeskOther = new DataPoint();
                        DeskOther.SetValueXY("Others", DeskOtherCategory);
                        Chart4.Series[0].Points.Add(DeskOther);
                        Chart4.Series["Series1"]["PieLabelStyle"] = "outside";
                    }

                    if (DHCategory == 0 && DSCategory == 0 && OperatingCategory == 0 && DeskOtherCategory == 0)
                    {
                        Chart4.Visible = false;
                    }
                    #endregion
                }
            }
            activate = "activated";
        }
Example #20
0
 //绑定用户发表的帖子
 protected void Bindbbs()
 {
     ListView3.DataSource = UserIndexBLL.BBS_All(Session["username"].ToString());
     ListView3.DataBind();
 }
Example #21
0
 protected void BtnDWdelete_Click(object sender, EventArgs e)
 {
     PanelDWinsert.Visible = false;
     PanelDWdelete.Visible = true;
     ListView3.DataBind();
 }
Example #22
0
 protected void Button1_Click(object sender, EventArgs e)
 {// Buscar
     try
     {
         DataTable      dt      = new DataTable();
         SqlConnection  sqlConn = new SqlConnection(connStr);
         SqlCommand     sqlCommand;
         SqlDataAdapter sqlDA;
         sqlConn.Open();
         sqlCommand = sqlConn.CreateCommand();
         Boolean con2 = false;
         if (TipoBusqueda == 0) // canciones
         {
             sqlCommand.CommandText = "SELECT Canciones.* FROM Canciones WHERE Canciones.Cancion LIKE '%" + txt_Busqueda.Text + "%'";
         }
         else if (TipoBusqueda == 1)// Artistas
         {
             sqlCommand.CommandText = "SELECT Canciones.* FROM Canciones WHERE Canciones.Artista LIKE '%" + txt_Busqueda.Text + "%'";
             con2 = true;
         }
         else if (TipoBusqueda == 2) // Albunes y Artistas
         {
             sqlCommand.CommandText = "SELECT Canciones.Artista,Canciones.Album,Canciones.Cancion,Canciones.Genero,Canciones.Compositor,Canciones.Colaboradores,Canciones.Link,Canciones.ImageUrl,Albums.Año FROM Canciones,Albums WHERE Albums.Album = Canciones.Album AND Albums.Album LIKE '%" + txt_Busqueda.Text + "%' AND Canciones.Artista LIKE '%" + txt_Busqueda2.Text + "%'";
         }
         sqlDA = new SqlDataAdapter(sqlCommand);
         sqlDA.Fill(dt);
         SqlDataReader reader = sqlCommand.ExecuteReader();
         sqlConn.Close();
         ListView1.Visible    = false;
         ListView3.Visible    = false;
         ListView2.Visible    = true;
         ListView2.DataSource = dt;
         ListView2.DataBind();
         if (ListView2.Items.Count == 0 && con2 == false)
         {
             Response.Write("<script>alert('No se encontraron Canciones con este criterio de Busqueda!');</script>");
         }
         if (con2 == true)
         {
             DataTable      dt2      = new DataTable();
             SqlConnection  sqlConn2 = new SqlConnection(connStr);
             SqlCommand     sqlCommand2;
             SqlDataAdapter sqlDA2;
             sqlConn2.Open();
             sqlCommand2             = sqlConn2.CreateCommand();
             sqlCommand2.CommandText = "SELECT Albums.* FROM Albums WHERE Albums.Artista LIKE '%" + txt_Busqueda.Text + "%'";
             sqlDA2 = new SqlDataAdapter(sqlCommand2);
             sqlDA2.Fill(dt2);
             sqlConn2.Close();
             ListView3.Visible    = true;
             ListView3.DataSource = dt2;
             ListView3.DataBind();
             if (ListView3.Items.Count == 0 && ListView2.Items.Count == 0)
             {
                 Response.Write("<script>alert('No se encontraron Álbums y/o Canciones con base al Artista buscado!');</script>");
             }
             else if (ListView3.Items.Count == 0)
             {
                 Response.Write("<script>alert('No se encontraron Álbums con base al Artista buscado!');</script>");
             }
             else if (ListView2.Items.Count == 0)
             {
                 Response.Write("<script>alert('No se encontraron Canciones con base al Artista buscado!');</script>");
             }
         }
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
 }
Example #23
0
 protected void waiguo()
 {
     ListView3.DataSource = BookManager.waiguo();
     ListView3.DataBind();
 }
Example #24
0
        private void FFT_Click(object sender, EventArgs e)
        {
            int chanCount = comboBox_chanCount.SelectedIndex + 1;

            for (int i = 0; i < chanCount; ++i)
            {
                double[] values  = (double[])xreal[i].ToArray(typeof(double));
                double[] ivalues = new double[values.Length];
                num = values.Length;
                for (int j = 0; j < values.Length; j++)
                {
                    ivalues[j] = 0;
                }
                TWFFT.FFT(values, ivalues);
                //TWFFT.IFFT(values, ivalues);
                for (int j = 0; j < values.Length; j++)
                {
                    value[i].Add(values[j]);
                    ivalue[i].Add(ivalues[j]);
                }
            }
            string result = fname.Insert(fname.LastIndexOf('.'), " FFT");

            using (FileStream fs = File.Open(result, FileMode.OpenOrCreate))
            {
                StreamWriter w = new StreamWriter(fs);
                w.BaseStream.Seek(0, SeekOrigin.End);
                w.Write("\r\nFFT:\r\n");
                for (int i = 0; i < chanCount; i++)
                {
                    w.BaseStream.Seek(0, SeekOrigin.End);
                    w.Write("channel " + i.ToString() + "\r\n");
                    for (int j = 0; j < num; j++)
                    {
                        //写文件
                        w.Write(value[i][j].ToString() + " ");
                        w.Write(ivalue[i][j].ToString() + " ");
                        w.Write("\r\n");
                    }
                }
                w.Flush();
                w.Close();
            }
            chart1.ChartAreas[0].AxisY.Maximum = trackBar2.Value;
// chart1.ChartAreas[0].AxisX.Maximum = trackBar1.Value;
            double[] Power = { 0, 0, 0, 0, 0, 0, 0, 0 };
            double[] Freq  = { 0, 0, 0, 0, 0, 0, 0, 0 };
            for (int i = 0; i < chanCount; i++)
            {
                double   power     = 0;
                int      frequency = 0;
                double[] values    = (double[])value[i].ToArray(typeof(double));
                double[] ivalues   = (double[])ivalue[i].ToArray(typeof(double));
                for (int j = 0; j < num; j++)
                {
                    if (power < values[j] * values[j] + ivalues[j] * ivalues[j])
                    {
                        power     = (values[j] * values[j] + ivalues[j] * ivalues[j]);
                        frequency = j;
                    }
                }
                Power[i] = power;
                Freq[i]  = frequency * 1000 / time;
            }
            ;

            //control list view ,one grid indicates a channel which specials with color and value.
            ListView2.Clear();
            ListView2.FullRowSelect = false;
            ListView2.Width         = 480;
            ListView2.Height        = 21;
            ListView2.View          = View.Details;// Set the view to show details.
            ListView2.HeaderStyle   = ColumnHeaderStyle.None;
            ListView2.GridLines     = true;
            // there are 8 columns for every item.
            for (int k = 0; k < 8; k++)
            {
                ListView2.Columns.Add("", 60);
            }

            // modify the grid's height with image Indirectly.
            ImageList imgList2 = new ImageList();

            imgList2.ImageSize       = new Size(1, 21); //width and height.
            ListView2.SmallImageList = imgList2;        //use imgList to modify the height of listView grids.

            // create two ListViewItem objects,so there are 16 grids for listView.
            m_firstItem2 = new ListViewItem();
            m_firstItem2.SubItems.Clear();
            m_firstItem2.UseItemStyleForSubItems = false;
            m_firstItem2.Font                  = new Font("SimSun", 10);
            m_firstItem2.SubItems[0].Text      = String.Format("{0:0}", Power[0]);
            m_firstItem2.SubItems[0].BackColor = m_simpleGraph.Pens[0].Color;
            for (int k = 1; k < 8; k++)
            {
                if (k < chanCountSet)
                {
                    m_firstItem2.SubItems.Add((String.Format("{0:0}", Power[k])), Color.Black, Color.Honeydew, new Font("SimSun", 10));
                    m_firstItem2.SubItems[k].BackColor = m_simpleGraph.Pens[k].Color;
                }
                else
                {
                    m_firstItem2.SubItems.Add("");
                    m_firstItem2.SubItems[k].BackColor = Color.White;
                }
            }

            ListViewItem[] list2 = new ListViewItem[] { m_firstItem2 };
            ListView2.Items.AddRange(list2);

            ListView3.Clear();
            ListView3.FullRowSelect = false;
            ListView3.Width         = 480;
            ListView3.Height        = 21;
            ListView3.View          = View.Details;// Set the view to show details.
            ListView3.HeaderStyle   = ColumnHeaderStyle.None;
            ListView3.GridLines     = true;
            // there are 8 columns for every item.
            for (int k = 0; k < 8; k++)
            {
                ListView3.Columns.Add("", 60);
            }

            // modify the grid's height with image Indirectly.
            ImageList imgList3 = new ImageList();

            imgList3.ImageSize       = new Size(1, 21); //width and height.
            ListView3.SmallImageList = imgList3;        //use imgList to modify the height of listView grids.

            // create two ListViewItem objects,so there are 16 grids for listView.
            m_firstItem3 = new ListViewItem();
            m_firstItem3.SubItems.Clear();
            m_firstItem3.UseItemStyleForSubItems = false;
            m_firstItem3.Font                  = new Font("SimSun", 10);
            m_firstItem3.SubItems[0].Text      = String.Format("{0:0}", Freq[0]);
            m_firstItem3.SubItems[0].BackColor = m_simpleGraph.Pens[0].Color;
            for (int k = 1; k < 8; k++)
            {
                if (k < chanCountSet)
                {
                    m_firstItem3.SubItems.Add((String.Format("{0:0}", Freq[k])), Color.Black, Color.Honeydew, new Font("SimSun", 10));
                    m_firstItem3.SubItems[k].BackColor = m_simpleGraph.Pens[k].Color;
                }
                else
                {
                    m_firstItem3.SubItems.Add("");
                    m_firstItem3.SubItems[k].BackColor = Color.White;
                }
            }

            ListViewItem[] list3 = new ListViewItem[] { m_firstItem3 };
            ListView3.Items.AddRange(list3);

            FFT.Enabled = false;
        }