protected void btnAdd_Click(object sender, EventArgs e) { string name = this.txtname.Text; string TypeName = DropDownList1.SelectedItem.Text; int TypeId = int.Parse(DropDownList1.SelectedValue); string StartT = this.StartT.Text; string ET = this.ET.Text; string ds = this.txtds.Text; string STime = this.STime.Text; string DanJia = this.DanJia.Text; string ShiJian = this.ShiJian.Text; AirTicketWeb.Model.TInfo model = new AirTicketWeb.Model.TInfo(); model.name = name; model.typeName = TypeName; model.TypeId = TypeId; model.StartT = StartT; model.ET = ET; model.Ds = ds; model.STime = STime; model.DanJia = DanJia; model.ShiJian = ShiJian; AirTicketWeb.BLL.TInfo bll = new AirTicketWeb.BLL.TInfo(); bll.Add(model); Maticsoft.DBUtility.js.AlertAndRedirect("Success!", "TInfoManger.aspx"); }
private void ShowInfo(int id) { AirTicketWeb.BLL.TInfo bll = new AirTicketWeb.BLL.TInfo(); AirTicketWeb.Model.TInfo model = bll.GetModel(id); this.txtname.Text = model.name; this.typeName.Text = model.typeName; this.StartT.Text = model.StartT; this.ET.Text = model.ET; this.txtds.Text = model.Ds; this.STime.Text = model.STime; this.DanJia.Text = model.DanJia; this.ShiJian.Text = model.ShiJian; }
private void getTInfoList() { try { DataSet ds = new DataSet(); AirTicketWeb.BLL.TInfo GetTInfo = new AirTicketWeb.BLL.TInfo(); ds = GetTInfo.GetAllList(); PagedDataSource objPds = new PagedDataSource(); objPds.DataSource = ds.Tables[0].DefaultView; objPds.AllowPaging = true; objPds.PageSize = 12; int CurPage; if (Request.QueryString["Page"] != null) { CurPage = Convert.ToInt32(Request.QueryString["Page"]); } else { CurPage = 1; } objPds.CurrentPageIndex = CurPage - 1; lblCurrentPage.Text = CurPage.ToString(); lblSumPage.Text = objPds.PageCount.ToString(); DataList1.DataSource = objPds; DataList1.DataBind(); } catch { } }