Exemplo n.º 1
0
        public static @class AddClass(@class @class, AppUser AppUser)
        {
            Dictionary <string, object> Params   = ObjectUtil.FillMap(@class);
            Dictionary <string, object> RespPost = Transaction.PostInput(Transaction.URL, "addClass", AppUser, Params);

            if (RespPost != null && RespPost["result"].ToString() == "0")
            {
                Dictionary <string, object> DataMap  = StringUtil.JSONStringToMap(RespPost["data"].ToString());
                Dictionary <string, object> ClassMap = StringUtil.JSONStringToMap(DataMap["class"].ToString());
                @class NewClass = (@class)ObjectUtil.FillObjectWithMap(new @class(), ClassMap);
                return(NewClass);
            }
            return(null);
        }
Exemplo n.º 2
0
        public static author AddAuthor(author author, AppUser AppUser)
        {
            Dictionary <string, object> Params   = ObjectUtil.FillMap(author);
            Dictionary <string, object> RespPost = Transaction.PostInput(Transaction.URL, "addAuthor", AppUser, Params);

            if (RespPost != null && RespPost["result"].ToString() == "0")
            {
                Dictionary <string, object> DataMap   = StringUtil.JSONStringToMap(RespPost["data"].ToString());
                Dictionary <string, object> authorMap = StringUtil.JSONStringToMap(DataMap["author"].ToString());
                author Newauthor = (author)ObjectUtil.FillObjectWithMap(new author(), authorMap);
                return(Newauthor);
            }
            return(null);
        }
Exemplo n.º 3
0
        public static category AddCategory(category category, AppUser AppUser)
        {
            Dictionary <string, object> Params   = ObjectUtil.FillMap(category);
            Dictionary <string, object> RespPost = Transaction.PostInput(Transaction.URL, "addCategory", AppUser, Params);

            if (RespPost != null && RespPost["result"].ToString() == "0")
            {
                Dictionary <string, object> DataMap     = StringUtil.JSONStringToMap(RespPost["data"].ToString());
                Dictionary <string, object> categoryMap = StringUtil.JSONStringToMap(DataMap["category"].ToString());
                category Newcategory = (category)ObjectUtil.FillObjectWithMap(new category(), categoryMap);
                return(Newcategory);
            }
            return(null);
        }
Exemplo n.º 4
0
        public static publisher AddPublisher(publisher publisher, AppUser AppUser)
        {
            Dictionary <string, object> Params   = ObjectUtil.FillMap(publisher);
            Dictionary <string, object> RespPost = Transaction.PostInput(Transaction.URL, "addPublisher", AppUser, Params);

            if (RespPost != null && RespPost["result"].ToString() == "0")
            {
                Dictionary <string, object> DataMap      = StringUtil.JSONStringToMap(RespPost["data"].ToString());
                Dictionary <string, object> publisherMap = StringUtil.JSONStringToMap(DataMap["publisher"].ToString());
                publisher Newpublisher = (publisher)ObjectUtil.FillObjectWithMap(new publisher(), publisherMap);
                return(Newpublisher);
            }
            return(null);
        }
Exemplo n.º 5
0
        public static student AddStudent(student Student, AppUser AppUser)
        {
            Dictionary <string, object> Params   = ObjectUtil.FillMap(Student);
            Dictionary <string, object> RespPost = Transaction.PostInput(Transaction.URL, "addStudent", AppUser, Params);

            if (RespPost != null && RespPost["result"].ToString() == "0")
            {
                Dictionary <string, object> DataMap    = StringUtil.JSONStringToMap(RespPost["data"].ToString());
                Dictionary <string, object> StudentMap = StringUtil.JSONStringToMap(DataMap["student"].ToString());
                student NewStudent = (student)ObjectUtil.FillObjectWithMap(new student(), StudentMap);
                return(NewStudent);
            }
            return(null);
        }
Exemplo n.º 6
0
        public static book AddBook(book Book, AppUser AppUser)
        {
            Dictionary <string, object> Params   = ObjectUtil.FillMap(Book);
            Dictionary <string, object> RespPost = Transaction.PostInput(Transaction.URL, "addBook", AppUser, Params);

            if (RespPost != null && RespPost["result"].ToString() == "0")
            {
                Dictionary <string, object> DataMap = StringUtil.JSONStringToMap(RespPost["data"].ToString());
                Dictionary <string, object> BookMap = StringUtil.JSONStringToMap(DataMap["book"].ToString());
                book NewBook = (book)ObjectUtil.FillObjectWithMap(new book(), BookMap);
                return(NewBook);
            }
            return(null);
        }