Esempio n. 1
0
 protected void btnSend_Click(object sender, EventArgs e)
 {
     try
     {
         if (!CheckInput())
         {
             return;
         }
         string            homeName  = txtHomeName.Text.Trim();
         string            awayName  = txtAwayName.Text.Trim();
         DateTime          startTime = Convert.ToDateTime(txtStartTime.Text);
         EuropeMatchEntity entity    = new EuropeMatchEntity(0, homeName, awayName, startTime.Date, startTime, 0, 0,
                                                             0,
                                                             1, DateTime.Now, DateTime.Now);
         if (!EuropeMatchMgr.Insert(entity))
         {
             ShowMessage("发布失败");
         }
         else
         {
             ShowMessage("发布成功");
             BindData();
         }
     }
     catch (Exception ex)
     {
         ShowMessage("发布失败:" + ex);
     }
     txtHomeName.Text  = "";
     txtStartTime.Text = "";
     txtAwayName.Text  = "";
 }
Esempio n. 2
0
        /// <summary>
        /// 发布一场比赛
        /// </summary>
        /// <param name="homeName"></param>
        /// <param name="awayName"></param>
        /// <param name="matchTime"></param>
        /// <returns></returns>
        public MessageCodeResponse ReleaseMatch(string homeName, string awayName, DateTime matchTime)
        {
            EuropeMatchEntity entity = new EuropeMatchEntity(0, homeName, awayName, matchTime.Date, matchTime, 0, 0, 0,
                                                             1, DateTime.Now, DateTime.Now);

            if (!EuropeMatchMgr.Insert(entity))
            {
                return(ResponseHelper.Create <MessageCodeResponse>(MessageCode.NbUpdateFail));
            }
            return(ResponseHelper.CreateSuccess <MessageCodeResponse>());
        }