protected void btnAdd_Click(object sender, EventArgs e) { int refid = this.Refid; NotesType notesType = this.NNotesType; AdminNotesBiz biz = new AdminNotesBiz(); D_Notes dn = new D_Notes(); D_LoginUserInfo ei = Session["LoginUserInfo"] as D_LoginUserInfo; dn.notesId = -1; dn.userId = ei.userId; dn.notes = txtNotes.Text; dn.refid = refid; dn.notesType = notesType; dn.status = true; biz.UpdateNotes(dn); btnShowAdd.Visible = true; plAddNotes.Visible = false; lstNotes.DataBind(); }
protected void lstNotes_UpdateCommand(object source, DataListCommandEventArgs e) { int notesId = (int)lstNotes.DataKeys[e.Item.ItemIndex]; string notes = ((TextBox)e.Item.FindControl("txtMyNotes")).Text; int status = 0; if (((CheckBox)e.Item.FindControl("chkStatus")).Checked) status = 1; AdminNotesBiz biz = new AdminNotesBiz(); biz.UpdateNotes(notesId, ((D_LoginUserInfo)Session["LoginUserInfo"]).userId, notes, status); lstNotes.EditItemIndex = -1; lstNotes.DataBind(); }