Beispiel #1
0
        public IHttpActionResult PostActivityTable(ActivityTable activityTable)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.ActivityTables.Add(activityTable);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (ActivityTableExists(activityTable.ID))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = activityTable.ID }, activityTable));
        }
Beispiel #2
0
        public IHttpActionResult PutActivityTable(string id, ActivityTable activityTable)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != activityTable.ID)
            {
                return(BadRequest());
            }

            db.Entry(activityTable).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ActivityTableExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        private ActivityTable MakeObject(SqlDataReader oReader)
        {
            oReader.Read();
            ActivityTable oActivityTable = new ActivityTable();

            oActivityTable = MapObject(oReader);
            return(oActivityTable);
        }
        private List <ActivityTable> MakeObjects(SqlDataReader oReader)
        {
            List <ActivityTable> oActivityTables = new List <ActivityTable>();

            while (oReader.Read())
            {
                ActivityTable oActivityTable = MapObject(oReader);
                oActivityTables.Add(oActivityTable);
            }
            return(oActivityTables);
        }
        private ActivityTable MapObject(SqlDataReader oReader)
        {
            ActivityTable oActivityTable = new ActivityTable();

            //oActivityTable.ActivityTableID = (int)oReader["ActivityTableID"];
            oActivityTable.TableName    = oReader["TABLE_NAME"].ToString();
            oActivityTable.TableType    = oReader["TABLE_TYPE"].ToString();
            oActivityTable.TableSchema  = oReader["TABLE_SCHEMA"].ToString();
            oActivityTable.TableCatalog = oReader["TABLE_CATALOG"].ToString();
            return(oActivityTable);
        }
Beispiel #6
0
        public IHttpActionResult GetActivityTable(string id)
        {
            ActivityTable activityTable = db.ActivityTables.Find(id);

            if (activityTable == null)
            {
                return(NotFound());
            }

            return(Ok(activityTable));
        }
Beispiel #7
0
        public IHttpActionResult DeleteActivityTable(string id)
        {
            ActivityTable activityTable = db.ActivityTables.Find(id);

            if (activityTable == null)
            {
                return(NotFound());
            }

            db.ActivityTables.Remove(activityTable);
            db.SaveChanges();

            return(Ok(activityTable));
        }
        public List <ActivityTable> Gets(int nUserID)
        {
            Connection.Open();
            Command.CommandText = ActivityTableDA.Gets(nUserID);

            SqlDataReader        reader           = Command.ExecuteReader();
            ActivityTable        _oActivityTable  = new ActivityTable();
            List <ActivityTable> _oActivityTables = new List <ActivityTable>();

            if (reader.HasRows)
            {
                _oActivityTables = MakeObjects(reader);
            }
            reader.Close();
            Connection.Close();
            return(_oActivityTables);
        }
Beispiel #9
0
        public ActionResult ViewActivityLogs(int nID, int nUserID)
        {
            SessionObj oSessionobj = new SessionObj(Session);

            if (nID > 0)
            {
                //_oActivityLogs = _oActivityLogsService.ge
            }
            else
            {
                _oActivityLogs = new ActivityLogs();
            }
            ActivityTable        oActivityTable   = new ActivityTable();
            List <ActivityTable> _oActivityTables = new List <ActivityTable>()
            {
            };
            ActivityTableService _oActivityTableService = new ActivityTableService();

            _oActivityTables = _oActivityTableService.Gets(nUserID);

            ViewBag.ActivityTables = _oActivityTables;
            return(View());
        }
Beispiel #10
0
        public static void InitializeTable()
        {
            SiteTable = getTable("sites1");
            if (SiteTable != null)
            {
                SiteTable.CreateIfNotExists();
            }
            //
            TemporalTable = getTable("temporal1");
            if (TemporalTable != null)
            {
                TemporalTable.CreateIfNotExists();
            }

            RevisionTable = getTable("revision1");
            if (RevisionTable != null)
            {
                RevisionTable.CreateIfNotExists();
            }

            ImagesContainer = getContainer("images1");

            SelectionListTable = getTable("selectionlist1");
            if (SelectionListTable != null)
            {
                SelectionListTable.CreateIfNotExists();
                SelectionInfoStore.CreateSkeleton();
            }

            HistoryTable = getTable("history1");
            if (HistoryTable != null)
            {
                HistoryTable.CreateIfNotExists();
            }

            BoardListTable = getTable("boardlist1");
            if (BoardListTable != null)
            {
                BoardListTable.CreateIfNotExists();
                BoardInfoStore.CreateSkeleton();
            }

            DiscussionListTable = getTable("discussionlist1");
            if (DiscussionListTable != null)
            {
                DiscussionListTable.CreateIfNotExists();
            }

            KeyStoreTable = getTable("keystore1");
            if (KeyStoreTable != null)
            {
                KeyStoreTable.CreateIfNotExists();
            }

            ActivityTable = getTable("activity1");
            if (ActivityTable != null)
            {
                ActivityTable.CreateIfNotExists();
            }

            DiscussionLoadTable = getTable("discussionload1");
            if (DiscussionLoadTable != null)
            {
                DiscussionLoadTable.CreateIfNotExists();
            }

            VoteBookTable = getTable("votebook1");
            if (VoteBookTable != null)
            {
                VoteBookTable.CreateIfNotExists();
            }
        }
        /// <summary>
        /// 开始
        /// </summary>
        public static void Start()
        {
            List <mw.ActivityConfig> listActivity = TableManager.Load <mw.ActivityConfig>("protodatas/ActivityConfig.protodata.bytes");

            if (null != listActivity)
            {
                foreach (var config in listActivity)
                {
                    ActivityTable.Add(config.id, config);
                }
            }

            List <mw.ItemConfig> itemList = TableManager.Load <mw.ItemConfig>();

            if (itemList != null)
            {
                foreach (var item in itemList)
                {
                    if (item.type != mw.Enums.ItemType.ITEM_TYPE_PET_STONE)
                    {
                        if (!TableManager.ItemTable.ContainsKey(item.id))
                        {
                            TableManager.ItemTable.Add(item.id, item);
                        }
                    }
                    else
                    {
                        if (!TableManager.PetStoneTable.ContainsKey(item.id))
                        {
                            TableManager.PetStoneTable.Add(item.id, item);
                        }
                    }
                }
            }

            List <mw.HeroBaseConfig> heroList = TableManager.Load <mw.HeroBaseConfig>();

            if (heroList != null)
            {
                foreach (var card in heroList)
                {
                    TableManager.HeroTable.Add(card.id, card);
                }
            }

            List <mw.PetConfig> petList = TableManager.Load <mw.PetConfig>();

            if (petList != null)
            {
                foreach (var pet in petList)
                {
                    TableManager.PetTable.Add(pet.idx, pet);
                }
            }

            List <mw.GMTDescConfig> gmtDescList = TableManager.Load <mw.GMTDescConfig>();

            if (gmtDescList != null)
            {
                foreach (var gmtDesc in gmtDescList)
                {
                    TableManager.GMTDescTable.Add(gmtDesc.id, gmtDesc);
                }
            }

            List <mw.RmbShopConfig> rmbShopList = TableManager.Load <mw.RmbShopConfig>();

            if (null != rmbShopList)
            {
                for (int i = 0; i < rmbShopList.Count; i++)
                {
                    string index = string.Format("{0}-{1}", rmbShopList[i].channel, rmbShopList[i].goods_RegisterId);

                    TableManager.RmbShopTable.Add(index, rmbShopList[i]);
                }
            }

            List <mw.MountConfig> mountList = TableManager.Load <mw.MountConfig>();

            if (null != mountList)
            {
                for (int i = 0; i < mountList.Count; ++i)
                {
                    if (!TableManager.MountTable.ContainsKey(mountList[i].id))
                    {
                        TableManager.MountTable.Add(mountList[i].id, mountList[i]);
                    }
                }
            }

            List <mw.StoneConfig> stoneList = TableManager.Load <mw.StoneConfig>();

            if (null != stoneList)
            {
                for (int i = 0; i < stoneList.Count; ++i)
                {
                    TableManager.StoneTable.Add(stoneList[i].id, stoneList[i]);
                }
            }
        }