예제 #1
0
 public void GetProfileByFilterTest()
 {
     ProfileBusiness target = new ProfileBusiness(); // TODO: Initialize to an appropriate value
     SessionInfo sessioninfo = null; // TODO: Initialize to an appropriate value
     string name = string.Empty; // TODO: Initialize to an appropriate value
     int startIndex = 0; // TODO: Initialize to an appropriate value
     int count = 0; // TODO: Initialize to an appropriate value
     string sorting = string.Empty; // TODO: Initialize to an appropriate value
     List<MA_USER_PROFILE> expected = null; // TODO: Initialize to an appropriate value
     List<MA_USER_PROFILE> actual;
     actual = target.GetProfileByFilter(sessioninfo, name, startIndex, count, sorting);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
예제 #2
0
        public static object GetProfileByFilter(SessionInfo sessioninfo, string name, int jtStartIndex, int jtPageSize, string jtSorting)
        {
            try
            {
                //Return result to jTable
                ProfileBusiness _profilebusiness = new ProfileBusiness();
                //Get data from database
                List<MA_USER_PROFILE> status = _profilebusiness.GetProfileByFilter(sessioninfo, name, jtSorting);

                //Return result to jTable
                return new { Result = "OK",
                             Records = jtPageSize > 0 ? status.Skip(jtStartIndex).Take(jtPageSize).ToList() : status,
                             TotalRecordCount = status.Count };
            }
            catch (BusinessWorkflowsException bex)
            {
                return new { Result = "ERROR", Message = bex.Message };
            }
            catch (Exception ex)
            {
                return new { Result = "ERROR", Message = ex.Message };
            }
        }