Beispiel #1
0
        public IList <Department_Test> GetDepartmentList(Department_Test Department_Test)
        {
            IList <Department_Test> fetchedClient = new List <Department_Test>();

            try
            {
                //using (var Context = new Cubicle_EntityEntities())
                //{
                //    IQueryable<Department_Test> query = Context.Department_Test;
                //    if (Department_Test.Department_TestName != string.Empty)
                //        query = query.Where(p => p.Department_TestName.ToUpper().Contains(Department_Test.Department_TestName.ToUpper()));
                //    if (Department_Test.Department_TestCode != string.Empty)
                //        query = query.Where(p => p.Department_TestCode.ToUpper().Contains(Department_Test.Department_TestCode.ToUpper()));
                //    fetchedClient = query.ToList();
                //}
            }
            catch (Exception ex)
            {
                //bool false = BusinessLogicExceptionHandler.HandleException(ref ex);
                if (false)
                {
                    throw ex;
                }
            }
            return(fetchedClient);
        }
Beispiel #2
0
        public Boolean CheckDuplicate(Department_Test Department_Test, Boolean IsInsert)
        {
            Boolean Result = true;

            try
            {
                var c = _departmentRepository_test.GetSingle(p => p.Department_TestCode.ToUpper() == Department_Test.Department_TestCode.ToUpper() && p.Department_TestName.ToUpper() == Department_Test.Department_TestName.ToUpper());
                if (!IsInsert)
                {
                    if (c == null)
                    {
                        Result = true;
                    }
                    else if (c.Department_TestID == Department_Test.Department_TestID)
                    {
                        Result = true;
                    }
                    else
                    {
                        Result = false;
                    }
                }
                else
                {
                    if (c == null)
                    {
                        Result = true;
                    }
                    else
                    {
                        Result = false;
                    }
                }
            }
            catch (Exception ex)
            {
                //bool false = BusinessLogicExceptionHandler.HandleException(ref ex);
                if (false)
                {
                    throw ex;
                }
            }
            return(Result);
        }