Esempio n. 1
0
        public EmpType searchEmpTypeByEmpTypeID(string strEmpTypeID)
        {
            string sqlStr = dbUtil.getSqlStatement("SQL_Emp_EmpType_SearchByEmpTypeID");

            SqlParameter[] sqlParms = {
                new SqlParameter("@EmpTypeID",SqlDbType.VarChar,20)
            };

            sqlParms[0].Value = strEmpTypeID;

            try
            {
                EmpType et = new EmpType();

                DataSet searchResult = DAO.DBAccess.ExecuteAdapter(DAO.DBAccess.SQLConnectionString, CommandType.Text, sqlStr, sqlParms);

                UtilService utilService = new UtilService();
                if (!utilService.isNullDataset(searchResult))
                {
                    et.EmpTypeID = searchResult.Tables[0].Rows[0]["ID"].ToString();
                    et.Name = searchResult.Tables[0].Rows[0]["Name"].ToString();
                    et.Description = searchResult.Tables[0].Rows[0]["Description"].ToString();
                }

                return et;
            }
            catch (Exception ex)
            {
                throw new DAOException("E0001", ex);
            }
        }
Esempio n. 2
0
 public void getEmpTypeByEmpTypeIDTest()
 {
     EmployeeImpl target = new EmployeeImpl(); // TODO: Initialize to an appropriate value
     string strEmpTypeID = string.Empty; // TODO: Initialize to an appropriate value
     EmpType expected = new EmpType(); // TODO: Initialize to an appropriate value
     EmpType actual;
     actual = target.getEmpTypeByEmpTypeID(strEmpTypeID);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Esempio n. 3
0
        public List<EmpType> searchEmpTypeAll()
        {
            string sqlStr = dbUtil.getSqlStatement("SQL_Emp_EmpType_SearchAll");

            try
            {
                List<EmpType> empTypeList = new List<EmpType>();
                DataSet searchResult = DAO.DBAccess.ExecuteAdapter(DAO.DBAccess.SQLConnectionString, CommandType.Text, sqlStr, null);
                foreach (DataTable dt in searchResult.Tables)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        EmpType empType = new EmpType();
                        empType.EmpTypeID = dr["ID"].ToString();
                        empType.Name = dr["Name"].ToString();
                        empType.Description = dr["Description"].ToString();
                        empTypeList.Add(empType);
                    }
                }

                return empTypeList;
            }
            catch (Exception ex)
            {
                throw new DAOException("E0001", ex);
            }
        }