示例#1
0
        public static Result  GetCategory(int categoryID)
        {
            var webRes = new Result(false);

            try
            {
                var item = new OETLib.BusinessObjects.Model.Category();

                webRes.Data    = OETLib.BusinessObjects.Model.CategoryList.GetCategoryList().FirstOrDefault(d => d.CategoryID == categoryID);
                webRes.Success = true;
            }
            catch
            {
                webRes.ErrorText = "There was a problem getting the object ";
            }
            //return new SaveResult(category.TrySave(typeof(OETLib.BusinessObjects.Model.CategoryList.GetCategoryList().FirstOrDefault(d => d.CategoryID == categoryID)));
            return(webRes);
        }
示例#2
0
        public static Result SaveItem(OETLib.BusinessObjects.Model.Category category)
        {
            var webRes = new Result(false);

            {
                try
                {
                    var e = category.TrySave(typeof(OETLib.BusinessObjects.Model.CategoryList));

                    webRes.Success = true;
                }
                catch
                {
                    webRes.ErrorText = "There was a problem saving the object ";
                }
            }
            return(webRes);
        }