Пример #1
0
 public abstract void match(ref match_input input, out match_result result);
Пример #2
0
 public abstract void dfa_match(ref dfa_match_input input, out match_result result);
Пример #3
0
 private static extern void pcrenet_dfa_match(ref dfa_match_input input, out match_result result);
Пример #4
0
 public override void dfa_match(ref dfa_match_input input, out match_result result)
 => pcrenet_dfa_match(ref input, out result);
Пример #5
0
 public static void dfa_match(ref dfa_match_input input, out match_result result)
 => _impl.dfa_match(ref input, out result);
Пример #6
0
 public static void match(ref match_input input, out match_result result)
 => _impl.match(ref input, out result);
Пример #7
0
        public ActionResult MatchResult(string matchid, string status)
        {
            List <users> ul     = (List <users>)Session["Data"];
            int          userid = ul[0].userid;
            int          mid    = int.Parse(matchid);

            using (var context = new Entities())
            {
                if ((from cc in context.match_result where cc.mid == mid select cc).Count() == 2)
                {
                    TempData["Message"] = "This match has already been added to result table!";
                    return(RedirectToAction("match-result"));
                }
                else
                {
                    int clubid  = (from c in context.clubs where c.userid == userid select c.clubid).SingleOrDefault();
                    int club2id = (from c2 in context.matches where c2.mid == mid select c2.club2).SingleOrDefault();
                    if (status == "win")
                    {
                        match_result mr = new match_result
                        {
                            mid      = mid,
                            clubid   = clubid,
                            points   = 100,
                            C_status = "W"
                        };
                        match_result mr1 = new match_result
                        {
                            mid      = mid,
                            clubid   = club2id,
                            points   = 10,
                            C_status = "L"
                        };
                        context.match_result.Add(mr);
                        context.match_result.Add(mr1);
                        context.SaveChanges();
                    }
                    else if (status == "lose")
                    {
                        match_result mr = new match_result
                        {
                            mid      = mid,
                            clubid   = club2id,
                            points   = 100,
                            C_status = "W"
                        };
                        match_result mr1 = new match_result
                        {
                            mid      = mid,
                            clubid   = clubid,
                            points   = 10,
                            C_status = "L"
                        };
                        context.match_result.Add(mr);
                        context.match_result.Add(mr1);
                        context.SaveChanges();
                    }
                    else if (status == "draw")
                    {
                        match_result mr = new match_result
                        {
                            mid      = mid,
                            clubid   = clubid,
                            points   = 50,
                            C_status = "D"
                        };
                        match_result mr1 = new match_result
                        {
                            mid      = mid,
                            clubid   = club2id,
                            points   = 50,
                            C_status = "D"
                        };
                        context.match_result.Add(mr);
                        context.match_result.Add(mr1);
                        context.SaveChanges();
                    }
                }
                TempData["Message"] = "Results have been saved to result table!";
                return(RedirectToAction("match-result"));
            }
        }