public static YellowstonePathology.Business.Typing.TypingShortcutCollection GetTypingShortcutCollectionByUser(int userId) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select * From tblTypingShortcut where UserId = @UserId or Type = 'Global' order by Shortcut"; cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@UserId", SqlDbType.Int).Value = userId; YellowstonePathology.Business.Typing.TypingShortcutCollection typingShorcutCollection = new Typing.TypingShortcutCollection(); using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.BaseData.SqlConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Typing.TypingShortcut typingShortcut = new Typing.TypingShortcut(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(typingShortcut, dr); sqlDataReaderPropertyWriter.WriteProperties(); typingShorcutCollection.Add(typingShortcut); } } } return typingShorcutCollection; }
public override object BuildNew() { YellowstonePathology.Business.Typing.TypingShortcut typingShortcut = new Typing.TypingShortcut(); this.BuildTypingShortcut(typingShortcut); return(typingShortcut); }
public override object BuildNew() { YellowstonePathology.Business.Typing.TypingShortcut typingShortcut = new Typing.TypingShortcut(); this.BuildTypingShortcut(typingShortcut); return typingShortcut; }