Example #1
0
        internal IEnumerable <StaffInfo> PopulateDataGrid()
        {
            string query = " Select a.StaffPin, a.StaffName, a.DOB, a.IsActive ,b.GenderID,b.GenderName from StaffInfo a Inner join Gender b ON a.GenderID=b.GenderID ";
            var    dt    = con.GetDataThroughDataTable(query, null);

            return(from DataRow row in dt.Rows select StaffInfo.ConvertToStaffInfo(row));
        }
Example #2
0
        public StaffInfo GetInfoById(string pin)
        {
            string query = "";

            List <SqlParameter> param = new List <SqlParameter>
            {
                new SqlParameter("@StaffPin", pin)
            };

            query = " Select a.StaffPin, a.StaffName, a.DOB, a.IsActive ,b.GenderID,b.GenderName from StaffInfo a inner join Gender b ON a.GenderID=b.GenderID  where a.StaffPin=@StaffPin";
            var dt = con.GetDataThroughDataTable(query, param);

            return(StaffInfo.ConvertToStaffInfo(dt.Rows[0]));
        }