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 BtndeleteDMPalb_Click(object sender, EventArgs e) { StringBuilder strSql = new StringBuilder(string.Empty); StringBuilder strsql1 = new StringBuilder(string.Empty); for (int i = 0; i < ListView6.Items.Count; i++) { CheckBox chk = ListView6.Items[i].FindControl("CheckBox3") as CheckBox; ImageButton img = ListView6.Items[i].FindControl("ImageButton5") as ImageButton; if (chk != null) { if (chk.Checked) { string imgurl = img.ImageUrl; string id = img.CommandArgument; SqlCommand cmdsel = new SqlCommand("select * from DivineMusic where alb_id='" + Convert.ToInt16(id) + "'", cn); cn.Open(); SqlDataAdapter adp1 = new SqlDataAdapter(cmdsel); cmdsel.ExecuteNonQuery(); DataSet ds1 = new DataSet(); adp1.Fill(ds1, "DivineMusic"); int row = ds1.Tables["DivineMusic"].Rows.Count; for (int j = 0; j < row; j++) { string musicpath = Server.MapPath(ds1.Tables["DivineMusic"].Rows[j][3].ToString()); FileInfo filepath = new FileInfo(musicpath); if (filepath.Exists) { filepath.Delete(); } string query1 = "delete from DivineMusic where alb_id='" + id + "'"; strsql1.Append(query1); } SqlCommand cmd2 = new SqlCommand(strsql1.ToString(), cn); cmd2.ExecuteNonQuery(); cn.Close(); string path1 = Server.MapPath(imgurl); FileInfo file = new FileInfo(path1); if (file.Exists) { file.Delete(); } string query = "delete from DivineAlbum where id='" + Convert.ToInt64(id) + "'"; strSql.Append(query); } } } cn.Open(); SqlCommand cmd = new SqlCommand(strSql.ToString(), cn); cmd.ExecuteNonQuery(); cn.Close(); ListView6.DataBind(); }
private void BindProduct6() { DataTable dt = ProductService.SelectWoManRight(); if (dt != null && dt.Rows.Count != 0) { ListView6.DataSource = dt; ListView6.DataBind(); } }
//gv绑定 public void ListViewBind6() { string Str1 = ""; if (!string.IsNullOrEmpty(cxtj5.Text)) { Str1 = "where bm_mc like '%" + hkdb.GetStr(cxtj5.Text) + "%'"; } AspNetPager6.RecordCount = (int)SqlHelper.ExecuteScalar("select count(*) from BM" + Str1); DataSet ds = SqlHelper.ExecuteDs("select * from BM " + Str1 + "order by BM.bm_mc", AspNetPager6.PageSize * (AspNetPager6.CurrentPageIndex - 1), AspNetPager6.PageSize); ListView6.DataSource = ds; ListView6.DataBind(); }
protected void xiandai() { ListView6.DataSource = BookManager.xiandai(); ListView6.DataBind(); }