public void InsertNote(Bill_NotePad note, SqlTransaction tran) { string sql = @"insert into bill_notePad ( noteDate, userCode, context, noteType) values( @noteDate, @userCode, @context, @noteType)"; SqlParameter[] sps = { new SqlParameter("@noteDate", note.NoteDate), new SqlParameter("@userCode", note.UserCode), new SqlParameter("@context", note.Context), new SqlParameter("@noteType", note.NoteType) }; DataHelper.ExcuteNonQuery(sql, tran, sps, false); }
private IList <Bill_NotePad> ListMaker(string sql, SqlParameter[] sps) { DataTable dt = DataHelper.GetDataTable(sql, sps, false); IList <Bill_NotePad> list = new List <Bill_NotePad>(); foreach (DataRow dr in dt.Rows) { Bill_NotePad pad = new Bill_NotePad(); pad.Context = Convert.ToString(dr["Context"]); pad.NoteDate = Convert.ToDateTime(dr["NoteDate"]); pad.NoteType = Convert.ToString(dr["NoteType"]); pad.UserCode = Convert.ToString(dr["UserCode"]); list.Add(pad); } if (list != null) { return(list); } else { return(null); } }
/* * public NotePad(string userCode, DateTime date) * { * note = noteDal.GetNoteByUserDate(userCode, date); * } */ public NotePad(Bill_NotePad tempNote) { note = tempNote; }