Exemple #1
0
        public List <OldEmployeeDTO> GetOldEmployeeList(GetOldEmployeeDTO objEmployee)
        {
            List <OldEmployeeDTO> employeelist = new List <OldEmployeeDTO>();

            using (DbLayer dbLayer = new DbLayer())
            {
                SqlCommand SqlCmd = new SqlCommand("spSelectEmployeeByService");
                SqlCmd.CommandType = CommandType.StoredProcedure;
                SqlCmd.Parameters.AddWithValue("@Service", objEmployee.Id);
                SqlCmd.Parameters.AddWithValue("@ActionBy", objEmployee.ActionBy);
                employeelist = dbLayer.GetEntityList <OldEmployeeDTO>(SqlCmd);
            }
            return(employeelist);
        }
Exemple #2
0
        public HttpResponseMessage GetOldEmployeeList(GetOldEmployeeDTO objEmployee)
        {
            HttpResponseMessage message;

            try
            {
                // ClientLeadChangeDataAccessLayer dal = new ClientLeadChangeDataAccessLayer();
                var dynObj = new { result = _clientServices.GetOldEmployeeList(objEmployee) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynObj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Something wrong. Try Again!" });
                ErrorLog.CreateErrorMessage(ex, "ClientLeadChange", "GetOldEmployeeList");
            }
            return(message);
        }