Пример #1
0
        public void AddPlayCount(OfficialMatch model)
        {
            SysCache.Clear();
            model.Attach();
            model.JoinCount++;

            dal.Update(model);
        }
Пример #2
0
        public static void AddPlayCount(OfficialMatch model)
        {
            if (model == null)
            {
                return;
            }

            bizOfficialMatch.Instance().AddPlayCount(model);
        }
Пример #3
0
        public ActionResult CreateOfficialSuccess()
        {
            string MatchName = Request["txtGameName"];
            int GameId = MainFunc.GetInteger(Request["drpPlayGame"]);
            DateTime BeginTime = MainFunc.GetDateTime(string.Format("{0} {1}:00", Request["txtBeginDate"], Request["drpBeginTime"])).Value;
            DateTime EndTime = MainFunc.GetDateTime(string.Format("{0} {1}:00", Request["txtEndDate"], Request["drpEndTime"])).Value;
            string route = Request["jsonGuiZe"];
            string GmRemark = "";

            JSONArray json = JSONConvert.DeserializeArray(route);

            if (json != null)
            {
                route = "";
                for (int i = 0; i < json.Count; i++)
                {
                    JSONObject obj = json[i] as JSONObject;
                    int first = MainFunc.GetInteger(obj["BeginSequence"]);
                    int end = MainFunc.GetInteger(obj["EndSequence"]);
                    int Score = MainFunc.GetInteger(obj["Score"]);

                    if (first != end)
                    {
                        GmRemark += string.Format("��{0}-{1}��   ����{2}�ɱ�  ", first, end, Score);
                    }
                    else
                    {
                        GmRemark += string.Format("��{0}��   ����{1}�ɱ�  ", first, Score);
                    }

                    if (!string.IsNullOrEmpty(route))
                    {
                        route += "|";
                    }

                    route += string.Format("{0},{1},{2}", first, end, Score);
                }

                OfficialMatch model = new OfficialMatch();
                model.fid = GameId;
                model.GmBeginTime = BeginTime;
                model.GmEndTime = EndTime;
                model.GmName = MatchName;
                model.GmRemark = GmRemark;

                if (BeginTime <= DateTime.Now && EndTime > DateTime.Now)
                {
                    model.GmState = 1;
                }
                else if (BeginTime > DateTime.Now && EndTime > DateTime.Now)
                {
                    model.GmState = 2;
                }
                else
                {
                    model.GmState = 3;
                }

                DataSet ds = OfficialMatchFacade.CreateOfficialMatch(model, route);

                if (MainFunc.IsDataSetNoNull(ds))
                {
                    int gmid = MainFunc.GetInteger(ds.Tables[0].Rows[0][0]);
                    ViewData["gmid"] = gmid;
                }
            }

            return View();
        }
Пример #4
0
 public DataSet CreateOfficialMatch(OfficialMatch model, string route)
 {
     SysCache.Clear();
     return dal.CreateOfficialMatch(model, route);
 }
Пример #5
0
 public static DataSet CreateOfficialMatch(OfficialMatch model, string route)
 {
     return bizOfficialMatch.Instance().CreateOfficialMatch(model, route);
 }