protected void btnNTupdate_Click(object sender, EventArgs e) { NoteTypeBO noteType = new NoteTypeBO(); NoteType note = new NoteType(); int NoteId = Convert.ToInt32(Session["PrimaryKeyNoteType"]); note = noteType.Get(NoteId); if (note == null) { string str = string.Format("Note with Id {0} not found.", NoteId); lblMsg.Text = str; return; } txtNTdesc.Text = note.Description; if (note.Active == null) { chkActive.Checked = false; } else { chkActive.Checked = (bool)note.Active; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { NoteTypeBO noteTypeBO = new NoteTypeBO(); this.ReportViewer1.LocalReport.ReportPath = "NoteType/NoteTypeReport.rdlc"; this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", noteTypeBO.GetAll())); this.ReportViewer1.LocalReport.Refresh(); } }
private void ddNoteTypeIdPopulate() { // List<NoteType> noteTypeList = new List<NoteType>(); NoteTypeBO noteTypeBO = new NoteTypeBO(); List <SelectListItemBase> dataList = new List <SelectListItemBase>(); dataList = noteTypeBO.GetAllSelect(s => new SelectListItemBase { Text = s.Description, Id = s.NoteTypeId }); ddNoteTypeId.DataSource = dataList; ddNoteTypeId.DataTextField = "Text"; ddNoteTypeId.DataValueField = "Id"; ddNoteTypeId.DataBind(); }
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView1.PageIndex = e.NewPageIndex; NoteTypeBO notetype = new NoteTypeBO(); //NoteTypeBO notetype = new NoteTypeBO(); //GridView1.DataSource = notetype.Find(x => x.Description.Contains(TextBox1.Text.Trim())).ToList(); //GridView1.DataBind(); //Button1.Enabled = true; GridView1.VirtualItemCount = notetype.Count(x => x.Description.Contains(TextBox1.Text.Trim())); //GridView1.DataSource = notetype.Find(x => x.Description.Contains(TextBox1.Text.Trim()), GridView1.PageIndex, GridView1.PageSize) // .ToList(); GridView1.DataSource = notetype.Find(x => x.Description.Contains(TextBox1.Text.Trim()), GridView1.PageIndex * GridView1.PageSize, GridView1.PageSize) .ToList(); GridView1.DataBind(); }
protected void btnCreate_Click(object sender, EventArgs e) { NoteTypeBO notetype = new NoteTypeBO(); NoteType note = new NoteType(); note.Description = (txtDesc.Text.Trim()); // note.NoteTypeId = Convert.ToInt64((txtNoteId.Text.Trim())); note.Active = chkActive.Checked; note.DateEntered = DateTime.Now; notetype.Add(note); notetype.Save(); txtDesc.Text = ""; chkActive.Checked = false; string msg = string.Format("Note Type {0} created", txtDesc); lblMsg.Text = msg; //Response.Redirect("NoteList.aspx"); }
protected void Button1_Click(object sender, EventArgs e) { NoteTypeBO notetype = new NoteTypeBO(); // GridView1.DataSource = notetype.Find(x => x.Description.Contains(TextBox1.Text.Trim())).ToList(); //int count; //count = notetype.Find(x => x.Description.Contains(TextBox1.Text.Trim())).ToList().Count(); //GridView1.DataSource = notetype.Find(x => x.Description.Contains(TextBox1.Text.Trim())).ToList(); //count =notetype.Find(x => x.Description.Contains(TextBox1.Text.Trim()).ToList(), GridView1.PageIndex, // GridView1.PageSize).ToList().Count(); GridView1.VirtualItemCount = notetype.Count(x => x.Description.Contains(TextBox1.Text.Trim())); //GridView1.DataSource =notetype.Find(x => x.Description.Contains(TextBox1.Text.Trim()), GridView1.PageIndex, GridView1.PageSize) // .ToList(); GridView1.DataSource = notetype.Find(x => x.Description.Contains(TextBox1.Text.Trim()), 0, GridView1.PageSize) .ToList(); GridView1.DataBind(); Button1.Enabled = true; //Button2.Visible = true; //Button4.Visible = true; }