Exemple #1
0
    protected void deletebutton_Click(object sender, EventArgs e)
    {
        int           abc      = 0;
        string        albid    = null;
        string        listitem = null;
        StringBuilder strSql   = new StringBuilder(string.Empty);

        for (int i = 0; i < ListView5.Items.Count; i++)
        {
            CheckBox    chk = ListView5.Items[i].FindControl("CheckBox7") as CheckBox;
            ImageButton img = ListView5.Items[i].FindControl("ImageButton7") as ImageButton;
            if (chk != null)
            {
                if (chk.Checked)
                {
                    string   imgurl = img.ImageUrl;
                    string   id     = img.CommandArgument;
                    string   path1  = Server.MapPath(imgurl);
                    FileInfo file   = new FileInfo(path1);
                    if (file.Exists)
                    {
                        file.Delete();
                    }

                    string query = "delete from Alb_Photo1 where id='" + Convert.ToInt64(id) + "'";
                    strSql.Append(query);
                    abc++;
                }
                else
                {
                    listitem = img.ImageUrl;
                }
            }

            albid = img.CommandName.ToString();
        }
        int total  = ListView5.Items.Count;
        int subimg = total - abc;

        if (total == abc)
        {
            SqlCommand cmd2 = new SqlCommand("delete from Album1 where id='" + Convert.ToInt64(albid) + "'", cn);
            cn.Open();
            cmd2.ExecuteNonQuery();
            cn.Close();
        }
        else
        {
            SqlCommand cmd1 = new SqlCommand("update Album1 set total_images='" + subimg + "',a_image='" + listitem + "' where id='" + Convert.ToInt64(albid) + "'", cn);
            cn.Open();
            cmd1.ExecuteNonQuery();
            cn.Close();
        }
        cn.Open();
        SqlCommand cmd = new SqlCommand(strSql.ToString(), cn);

        cmd.ExecuteNonQuery();
        cn.Close();
        ListView5.DataBind();
    }
Exemple #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);
        }
    }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                var type = Request.QueryString["ntid"];
                switch (type)
                {
                case "2":
                    TitleNewsId.InnerText = "رویداد ها";
                    break;

                case "3":
                    TitleNewsId.InnerText = "مقالات قرآنی و تفسیری";
                    break;

                //case "1":
                default:
                    type = "1";
                    TitleNewsId.InnerText = "اخبار";
                    break;
                }

                ListView5.DataSource = new TafsirLib.News().Load(type);
                ListView5.DataBind();
            }
            catch (Exception)
            {
                //var err = ex.Message;
            }
        }
Exemple #4
0
 protected void showphoto_Command(object sender, CommandEventArgs e)
 {
     Session["albumid"]   = e.CommandArgument;
     Listofalbums.Visible = false;
     ListView5.DataBind();
     ListView5.Visible    = true;
     LinkButton3.Visible  = true;
     deletebutton.Visible = true;
 }
Exemple #5
0
        private void BindProduct5()
        {
            DataTable dt = ProductService.SelectWoManCenter();

            if (dt != null && dt.Rows.Count != 0)
            {
                ListView5.DataSource = dt;
                ListView5.DataBind();
            }
        }
Exemple #6
0
 protected void ListView5_ItemCommand(object sender, ListViewCommandEventArgs e)
 {
     if (e.CommandName == "ok")
     {
         string orderid = e.CommandArgument.ToString();
         Oorder.updatestate(orderid, 4);
         ListView5.DataBind();
         ListView1.DataBind();
     }
 }
Exemple #7
0
        private void Bindother()
        {
            DataTable dt = BLL.CommodityManager.SelectotherTop4();

            if (dt != null && dt.Rows.Count != 0)
            {
                ListView5.DataSource = dt;
                ListView5.DataBind();
            }
        }
Exemple #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         ListView5.DataSource = new TafsirLib.Links().Load();
         ListView5.DataBind();
     }
     catch (Exception)
     {
         //var err = ex.Message;
     }
 }
Exemple #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         var ids = Request.QueryString["id"];
         ListView5.DataSource = new TafsirLib.News().Get(ids);
         ListView5.DataBind();
     }
     catch (Exception)
     {
         //var err = ex.Message;
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                var id = Convert.ToInt32(Request.QueryString["id"]);

                ListView5.DataSource = new TafsirLib.Teacher().Load(id);
                ListView5.DataBind();
            }
            catch (Exception)
            {
                //var err = ex.Message;
            }
        }
Exemple #11
0
        //gv绑定
        public void ListViewBind5()
        {
            string Str1 = "";

            if (!string.IsNullOrEmpty(cxtj4.Text))
            {
                Str1 = "where name like '%" + hkdb.GetStr(cxtj4.Text) + "%'";
            }
            AspNetPager5.RecordCount = (int)SqlHelper.ExecuteScalar("select count(*) from OA_Rwfbdw" + Str1);
            DataSet ds = SqlHelper.ExecuteDs("select * from OA_Rwfbdw " + Str1 + "order by OA_Rwfbdw.name", AspNetPager5.PageSize * (AspNetPager5.CurrentPageIndex - 1), AspNetPager5.PageSize);

            ListView5.DataSource = ds;
            ListView5.DataBind();
        }
        protected void Button6_Click(object sender, EventArgs e)
        {
            String eduChoosed = education.Items[education.SelectedIndex].Value;
            String degree     = eduDegree.Text;
            String state      = eduState.Text;
            String name       = eduName.Text;
            String city       = eduCity.Text;
            int    user       = Convert.ToInt32(Session["id"]);

            if (state.Equals("") || name.Equals("") || city.Equals(""))
            {
                educationError.Text = "Ju lutem plotesoni te gjitha fushat!";
            }
            else
            {
                NormalUserDB.addEducation(eduChoosed, name, city, state, degree, user);
                eduDegree.Text = "";
                eduState.Text  = "";
                eduName.Text   = "";
                eduCity.Text   = "";
                ListView5.DataBind();
            }
        }
Exemple #13
0
 //绑定用户发表的帖子
 protected void Bindnuserbc()
 {
     ListView5.DataSource = UserIndexBLL.userBBScomt_ALL(Session["username"].ToString());
     ListView5.DataBind();
 }
Exemple #14
0
 //绑定用户帖子下评论的回复
 protected void Bindnbcb()
 {
     ListView5.DataSource = UserIndexBLL.BBS_Comment_Back_ALL(Session["username"].ToString());
     ListView5.DataBind();
 }
Exemple #15
0
 protected void minguo()
 {
     ListView5.DataSource = BookManager.minguo();
     ListView5.DataBind();
 }
Exemple #16
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";
        }