public DataTable GetMasterMarketName(int sportid)
 {
     try
     {
         using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
         {
             objConn.Open();
             SqlCommand cmd = new SqlCommand("sp_MasterMarket", objConn);
             cmd.Parameters.AddWithValue("@SportID", sportid);
             cmd.Parameters.AddWithValue("@Mode", "Select");
             cmd.ExecuteNonQuery();
             SqlDataAdapter ad = new SqlDataAdapter(cmd);
             DataTable      dt = new DataTable();
             ad.Fill(dt);
             objConn.Close();
             cmd.Dispose();
             return(dt);
         }
     }
     catch (Exception ex)
     {
         ErrorLog(ex.ToString());
         return(null);
     }
 }
 public void UpdateMarketResults(DataTable dt, int matchid, int sportid)
 {
     try
     {
         DataTable ds = new DataTable();
         using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
         {
             objConn.Open();
             foreach (DataRow row in dt.Rows)
             {
                 try
                 {
                     SqlCommand cmd = new SqlCommand("sp_UpdateMarketResult", objConn);
                     cmd.CommandType = CommandType.StoredProcedure;
                     cmd.Parameters.AddWithValue("@MatchID", matchid);
                     cmd.Parameters.AddWithValue("@SportID", sportid);
                     cmd.Parameters.AddWithValue("@ResultName", row["ResultName"].ToString());
                     cmd.Parameters.AddWithValue("@Result", row["Result"].ToString());
                     cmd.CommandTimeout = 500;
                     cmd.ExecuteNonQuery();
                 }
                 catch (SqlException ex)
                 {
                     TraceServices(dt.Rows[0].ToString() + " " + ex.ToString());
                 }
             }
             objConn.Close();
         }
     }
     catch (Exception ex)
     {
         ErrorLog(ex.ToString());
     }
 }
Exemplo n.º 3
0
        public string UpdateCoupon(long selectionid, string toal, string selection)
        {
            try
            {
                SqlParameter[] arrParam = { new SqlParameter("@selectionid", selectionid), new SqlParameter("@mode", "UpdateToals"), new SqlParameter("@toals", toal), new SqlParameter("@selection", selection) };
                int            no       = 0;
                using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
                {
                    SqlCommand cmd = new SqlCommand("sp_UpdateCoupon", objConn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddRange(arrParam);
                    cmd.CommandTimeout = 500;
                    objConn.Open();
                    no = cmd.ExecuteNonQuery();
                    objConn.Close();
                }

                if (no > 0)
                {
                    return("Coupon updated successfully");
                }

                else
                {
                    return("An error occured while updating coupon");
                }
            }
            catch (Exception ex)
            {
                throw new Exception("An error occured while updating coupon");
            }
        }
Exemplo n.º 4
0
        public void InsertMatchinfoDev(Matches match, int sportid)
        {
            try
            {
                using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
                {
                    SqlParameter[] arrParam = { new SqlParameter("@MatchDate", match.date),                     new SqlParameter("@Time",       match.time),                            new SqlParameter("@Home",  match.home)
                                                ,                              new SqlParameter("@Draw",        match.draw),                    new SqlParameter("@Away",               match.away),               new SqlParameter("@BettingLink",match.bettinglink)
                                                ,                              new SqlParameter("@CreatedDate", match.createddate),             new SqlParameter("@DisplayEndDateTime", match.Displayenddatetime), new SqlParameter("@sportid", sportid),
                                                new SqlParameter("@leagueid",  Convert.ToInt32(match.league)),  new SqlParameter("@ResultLink", match.resultlink) };

                    SqlCommand cmd = new SqlCommand("sp_InsertMatchinfoDev", objConn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddRange(arrParam);
                    cmd.CommandTimeout = 500;
                    objConn.Open();
                    cmd.ExecuteNonQuery();
                    objConn.Close();
                }
            }
            catch (Exception ex)
            {
                ErrorLog(ex.ToString());
            }
        }
Exemplo n.º 5
0
 public DataTable GetMarketOdds(long marketid, string bookies)
 {
     try
     {
         DataSet ds = new DataSet();
         using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
         {
             SqlCommand cmd = new SqlCommand("sp_Market", objConn);
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@mode", "MatchOddsByBookies");
             cmd.Parameters.AddWithValue("@bookies", bookies);
             cmd.Parameters.AddWithValue("@bettingmarketid", marketid);
             cmd.CommandTimeout = 500;
             objConn.Open();
             SqlDataAdapter da = new SqlDataAdapter(cmd);
             da.Fill(ds);
             objConn.Close();
             return(ds.Tables[0]);
         }
     }
     catch (Exception ex)
     {
         ErrorLog(ex.ToString());
         return(null);
     }
 }
Exemplo n.º 6
0
        public DataSet GetMarket(XmlDocument doc, long marketid, long matchid, string bookies)
        {
            try
            {
                DataSet        ds        = new DataSet();
                StringReader   str       = new StringReader(doc.OuterXml);
                XmlTextReader  xmlreader = new XmlTextReader(str);
                SqlParameter[] arrParam  = { new SqlParameter("@Market_XML", xmlreader), new SqlParameter("@mode", "NewInsert"), new SqlParameter("@bookies", bookies), new SqlParameter("@bettingmarketid", marketid), new SqlParameter("@matchid", matchid) };

                using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
                {
                    SqlCommand cmd = new SqlCommand("sp_Market", objConn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddRange(arrParam);
                    cmd.CommandTimeout = 500;
                    SqlDataAdapter da = new SqlDataAdapter(cmd);
                    da.Fill(ds);
                    //objConn.Open();
                    //cmd.ExecuteNonQuery();
                    //objConn.Close();
                }
                return(ds);
            }
            catch (Exception ex)
            {
                ErrorLog(ex.ToString());
                return(null);
            }
        }
Exemplo n.º 7
0
        public void UpdateBookiesMenu(bool Checked, string Bookiename)
        {
            try
            {
                int no = 0;
                //DataSet ds = new DataSet();
                using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
                {
                    SqlCommand cmd = new SqlCommand("sp_BookiesMenu", objConn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@mode", "UpdateBookiesMenu");
                    cmd.Parameters.AddWithValue("@Checked", Checked);
                    cmd.Parameters.AddWithValue("@Bookiename", Bookiename);
                    cmd.CommandTimeout = 500;
                    objConn.Open();
                    no = cmd.ExecuteNonQuery();
                    objConn.Close();
                }


                //return "Records deleted successfully";
            }
            catch (Exception ex)
            {
                ErrorLog(ex.ToString());
            }
        }
Exemplo n.º 8
0
 public void InsertLinks(List <UrlModel> urls)
 {
     foreach (var url in urls)
     {
         try
         {
             using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
             {
                 SqlCommand cmd = new SqlCommand("insert into CrawledData(PageUrl,FullUrl,FullUrl2,IsLinkCrawled,IsDataCrawled,IsInDomain,Header,Footer,HtmlContent) values(@PageUrl,@FullUrl,@FullUrl2,@IsLinkCrawled,@IsDataCrawled,@IsInDomain,@Header,@Footer,@HtmlContent)", objConn);
                 cmd.Parameters.AddWithValue("@PageUrl", url.PageUrl);
                 cmd.Parameters.AddWithValue("@FullUrl", url.FullUrl);
                 cmd.Parameters.AddWithValue("@FullUrl2", url.FullUrl2);
                 cmd.Parameters.AddWithValue("@IsLinkCrawled", false);
                 cmd.Parameters.AddWithValue("@IsDataCrawled", false);
                 cmd.Parameters.AddWithValue("@IsInDomain", url.IsInDomain);
                 cmd.Parameters.AddWithValue("@Header", "");
                 cmd.Parameters.AddWithValue("@Footer", "");
                 cmd.Parameters.AddWithValue("@HtmlContent", "");
                 cmd.CommandTimeout = 500;
                 objConn.Open();
                 cmd.ExecuteNonQuery();
                 objConn.Close();
             }
         }
         catch (Exception ex)
         {
             ErrorLog(ex.ToString());
         }
     }
 }
        public string[] GetMatchinfobyid(int id)
        {
            try
            {
                DataSet ds = new DataSet();
                using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
                {
                    SqlCommand cmd = new SqlCommand("select * from matchinfo where id='" + id + "'", objConn);
                    //  cmd.CommandType = CommandType.StoredProcedure;

                    cmd.CommandTimeout = 500;
                    objConn.Open();
                    SqlDataReader reader = cmd.ExecuteReader();
                    string[]      info   = new string[2];
                    if (reader.Read())
                    {
                        info[0] = reader["BettingLink"].ToString();
                        info[1] = reader["Time"].ToString();
                    }
                    reader.Close();
                    cmd.Dispose();
                    objConn.Close();
                    return(info);
                }
            }
            catch (Exception ex)
            {
                ErrorLog(ex.ToString());
                return(null);
            }
        }
Exemplo n.º 10
0
        public DataSet NewRecords(XmlDocument doc)
        {
            try
            {
                DataSet        ds        = new DataSet();
                StringReader   str       = new StringReader(doc.OuterXml);
                XmlTextReader  xmlreader = new XmlTextReader(str);
                SqlParameter[] arrParam  = { new SqlParameter("@MatchInfo_XML", xmlreader), new SqlParameter("@mode", "Sp") };

                using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
                {
                    SqlCommand cmd = new SqlCommand("sp_InsertMatchInfo", objConn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddRange(arrParam);
                    cmd.CommandTimeout = 500;
                    SqlDataAdapter da = new SqlDataAdapter(cmd);
                    da.Fill(ds);
                    //cmd.ExecuteNonQuery();
                    //objConn.Close();
                    return(ds);
                }
            }
            catch (Exception ex)
            {
                ErrorLog(ex.ToString());
                return(null);
            }
        }
Exemplo n.º 11
0
        public string UpdateMatch(long id, string matchdate, string displayenddatetime)
        {
            try
            {
                SqlParameter[] arrParam = { new SqlParameter("@id", id), new SqlParameter("@mode", "UpdateMatch"), new SqlParameter("@matchdate", matchdate), new SqlParameter("@displayenddatetime", displayenddatetime) };
                int            no       = 0;
                using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
                {
                    SqlCommand cmd = new SqlCommand("sp_InsertMatchInfo", objConn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddRange(arrParam);
                    cmd.CommandTimeout = 500;
                    objConn.Open();
                    no = cmd.ExecuteNonQuery();
                    objConn.Close();
                }

                if (no > 0)
                {
                    return("Match date updated successfully");
                }

                else
                {
                    return("An error occured while updating match date");
                }
            }
            catch (Exception ex)
            {
                ErrorLog(ex.ToString());
                return(null);
            }
        }
Exemplo n.º 12
0
        public string DeleteMarketOdds(long marketid)
        {
            try
            {
                int no = 0;
                //DataSet ds = new DataSet();
                using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
                {
                    SqlCommand cmd = new SqlCommand("sp_Market", objConn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@mode", "DeleteByMarketId");
                    cmd.Parameters.AddWithValue("@bettingmarketid", marketid);
                    cmd.CommandTimeout = 500;
                    objConn.Open();
                    no = cmd.ExecuteNonQuery();
                    objConn.Close();
                }

                return(no.ToString());
                //return "Records deleted successfully";
            }
            catch (Exception ex)
            {
                ErrorLog(ex.ToString());
                return(null);
            }
        }
Exemplo n.º 13
0
        public string AddMArket(XmlDocument doc, string couponid)
        {
            try
            {
                StringReader   str       = new StringReader(doc.OuterXml);
                XmlTextReader  xmlreader = new XmlTextReader(str);
                SqlParameter[] arrParam  = { new SqlParameter("@CouponInfo_XML", xmlreader), new SqlParameter("@coupon_id", couponid), new SqlParameter("@mode", "AddMarkets") };

                using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
                {
                    SqlCommand cmd = new SqlCommand("sp_Coupon", objConn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddRange(arrParam);
                    cmd.CommandTimeout = 500;
                    objConn.Open();
                    int no = cmd.ExecuteNonQuery();
                    objConn.Close();
                }
                return("Added successfully");
            }
            catch (Exception ex)
            {
                return("An internal error ocurred while saving this coupon");
            }
        }
Exemplo n.º 14
0
        public DataSet GetMatchesByCouponId(string couponid)
        {
            try
            {
                DataSet ds = new DataSet();

                SqlParameter[] arrParam = { new SqlParameter("@mode", "SelectMatchesByCouponId"), new SqlParameter("@coupon_id", couponid) };

                using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
                {
                    SqlCommand cmd = new SqlCommand("sp_Coupon", objConn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddRange(arrParam);
                    cmd.CommandTimeout = 500;
                    SqlDataAdapter da = new SqlDataAdapter(cmd);
                    da.Fill(ds);
                    //objConn.Open();
                    //cmd.ExecuteNonQuery();
                    //objConn.Close();
                }
                return(ds);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Exemplo n.º 15
0
        public DataTable GetMatchResult(int mid, int sportid)
        {
            try
            {
                DataTable ds = new DataTable();

                using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
                {
                    SqlCommand cmd = new SqlCommand("sp_GetMarketResult", objConn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@MatchID", mid);
                    cmd.Parameters.AddWithValue("@SportID", sportid);
                    cmd.CommandTimeout = 500;
                    SqlDataAdapter da = new SqlDataAdapter(cmd);
                    da.Fill(ds);
                    //objConn.Open();
                    //cmd.ExecuteNonQuery();
                    //objConn.Close();
                }
                return(ds);
            }
            catch (Exception ex)
            {
                ErrorLog(ex.ToString());
                return(null);
            }
        }
Exemplo n.º 16
0
        public DataSet GetCouponMarket(XmlDocument doc, long marketid, long matchid, string bookies, string couponid)
        {
            try
            {
                DataSet        ds        = new DataSet();
                StringReader   str       = new StringReader(doc.OuterXml);
                XmlTextReader  xmlreader = new XmlTextReader(str);
                SqlParameter[] arrParam  = { new SqlParameter("@CouponInfo_XML", xmlreader), new SqlParameter("@mode", "MarketAndToals"), new SqlParameter("@bookies", bookies), new SqlParameter("@bettingmarketid", marketid), new SqlParameter("@coupon_id", couponid), new SqlParameter("@matchid", matchid) };

                using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
                {
                    SqlCommand cmd = new SqlCommand("sp_Coupon", objConn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddRange(arrParam);
                    cmd.CommandTimeout = 500;
                    SqlDataAdapter da = new SqlDataAdapter(cmd);
                    da.Fill(ds);
                    //objConn.Open();
                    //cmd.ExecuteNonQuery();
                    //objConn.Close();
                }
                return(ds);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Exemplo n.º 17
0
        /// <summary>
        /// select match result according to match id
        /// </summary>
        /// <parameter>MatchID</parameter>
        /// <returns>DataTable</returns>
        public DataSet GetMatchResult(int matchid)
        {
            try
            {
                DataSet ds = new DataSet();
                using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
                {
                    SqlCommand cmd = new SqlCommand("sp_GetMatchResult", objConn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@MatchID", matchid);
                    cmd.Parameters.AddWithValue("@Type", "First");
                    SqlDataAdapter da = new SqlDataAdapter(cmd);
                    DataTable      dt = new DataTable();
                    da.Fill(dt);
                    ds.Tables.Add(dt);

                    cmd             = new SqlCommand("sp_GetMatchResult", objConn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@MatchID", matchid);
                    cmd.Parameters.AddWithValue("@Type", "Second");
                    da = new SqlDataAdapter(cmd);
                    dt = new DataTable();
                    da.Fill(dt);
                    ds.Tables.Add(dt);
                    return(ds);
                }
            }
            catch (Exception ex)
            {
                ErrorLog(ex.ToString());
                return(null);
            }
        }
Exemplo n.º 18
0
        public DataTable GetMatchByCoupon(bool archived)
        {
            try
            {
                DataTable ds = new DataTable();

                using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
                {
                    SqlCommand cmd = new SqlCommand("sp_Match", objConn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    if (archived == false)
                    {
                        cmd.Parameters.AddWithValue("@Mode", "SelectNotArchivedMatch");
                    }
                    else
                    {
                        cmd.Parameters.AddWithValue("@Mode", "SelectArchivedMatch");
                    }
                    //  cmd.Parameters.AddWithValue("@SportID", sportid);
                    cmd.CommandTimeout = 500;
                    SqlDataAdapter da = new SqlDataAdapter(cmd);
                    da.Fill(ds);
                }
                return(ds);
            }
            catch (Exception ex)
            {
                ErrorLog(ex.ToString());
                return(null);
            }
        }
Exemplo n.º 19
0
        public void InsertMatchInfo(XmlDocument doc)
        {
            try
            {
                StringReader   str       = new StringReader(doc.OuterXml);
                XmlTextReader  xmlreader = new XmlTextReader(str);
                SqlParameter[] arrParam  = { new SqlParameter("@MatchInfo_XML", xmlreader), new SqlParameter("@mode", "Insert") };

                using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
                {
                    SqlCommand cmd = new SqlCommand("sp_InsertMatchInfo", objConn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddRange(arrParam);
                    cmd.CommandTimeout = 500;
                    objConn.Open();
                    cmd.ExecuteNonQuery();
                    objConn.Close();
                }
            }
            catch (Exception ex)
            {
                ErrorLog(ex.ToString());
                //throw new Exception(ex.Message);
            }
        }
Exemplo n.º 20
0
 /// <summary>
 /// Get Link and ID of MatchInfo, and Crawling.
 /// </summary>
 /// <returns></returns>
 public DataTable GetMatchResultLinkForCrawl()
 {
     try
     {
         DataTable ds = new DataTable();
         using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
         {
             SqlCommand     cmd = new SqlCommand("select id,ResultLink,BettingLink from MatchInfo where id not in(select MatchId from Matchresult)", objConn);
             SqlDataAdapter da  = new SqlDataAdapter(cmd);
             da.Fill(ds);
             return(ds);
         }
     }
     catch (Exception ex)
     {
         ErrorLog(ex.ToString());
         return(null);
     }
 }
Exemplo n.º 21
0
 public DataTable GetMatchListByTime()
 {
     try
     {
         DataTable ds = new DataTable();
         using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
         {
             SqlCommand     cmd = new SqlCommand("select id,ResultLink,BettingLink from MatchInfo where id not in(select MatchId from Matchresult) and Time<='" + DateTime.Now.AddHours(-4).AddMinutes(-30).TimeOfDay + "' and Day(DisplayEndDateTime)='" + DateTime.Now.Day + "' and Month(DisplayEndDateTime)='" + DateTime.Now.Month + "' and Year(DisplayEndDateTime)='" + DateTime.Now.Year + "'", objConn);
             SqlDataAdapter da  = new SqlDataAdapter(cmd);
             da.Fill(ds);
             return(ds);
         }
     }
     catch (Exception ex)
     {
         ErrorLog(ex.ToString());
         return(null);
     }
 }
Exemplo n.º 22
0
 public int GetSportID(int matchid)
 {
     try
     {
         DataSet ds = new DataSet();
         using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
         {
             SqlCommand cmd = new SqlCommand("select sportid from matchinfo where id='" + matchid + "'", objConn);
             cmd.CommandTimeout = 500;
             objConn.Open();
             string sportid = Convert.ToString(cmd.ExecuteScalar());
             objConn.Close();
             return(sportid != "" ? Convert.ToInt32(sportid) : 0);
         }
     }
     catch (Exception ex)
     {
         ErrorLog(ex.ToString());
         return(0);
     }
 }
Exemplo n.º 23
0
 public DataSet GetLeagues()
 {
     try
     {
         DataSet ds = new DataSet();
         using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
         {
             SqlCommand cmd = new SqlCommand("sp_Leagues", objConn);
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@mode", "Select");
             SqlDataAdapter da = new SqlDataAdapter(cmd);
             da.Fill(ds);
             return(ds);
         }
     }
     catch (Exception ex)
     {
         ErrorLog(ex.ToString());
         return(null);
     }
 }
Exemplo n.º 24
0
 public DataTable GetSports()
 {
     try
     {
         DataSet ds = new DataSet();
         using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
         {
             SqlCommand cmd = new SqlCommand("sp_InsertMatchInfo", objConn);
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@mode", "GetSports");
             SqlDataAdapter da = new SqlDataAdapter(cmd);
             da.Fill(ds);
             return(ds.Tables[0]);
         }
     }
     catch (Exception ex)
     {
         ErrorLog(ex.ToString());
         return(null);
     }
 }
Exemplo n.º 25
0
 public DataTable GetBettingMarkets(long matchid)
 {
     try
     {
         DataSet ds = new DataSet();
         using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
         {
             SqlCommand cmd = new SqlCommand("sp_BettingMarket", objConn);
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@mode", "Select");
             cmd.Parameters.AddWithValue("@matchid", matchid);
             SqlDataAdapter da = new SqlDataAdapter(cmd);
             da.Fill(ds);
             return(ds.Tables[0]);
         }
     }
     catch (Exception ex)
     {
         ErrorLog(ex.ToString());
         return(null);
     }
 }
Exemplo n.º 26
0
 public DataSet GetCoupons(bool IsArchived)
 {
     try
     {
         DataSet ds = new DataSet();
         using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
         {
             SqlCommand cmd = new SqlCommand("sp_Coupon", objConn);
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@IsArchived", IsArchived);
             cmd.Parameters.AddWithValue("@mode", "SelectAll");
             cmd.CommandTimeout = 500;
             SqlDataAdapter da = new SqlDataAdapter(cmd);
             da.Fill(ds);
             return(ds);
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemplo n.º 27
0
 public DataSet GetUpdatedCouponInfo(string couponid)
 {
     try
     {
         DataSet ds = new DataSet();
         using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
         {
             SqlCommand cmd = new SqlCommand("sp_GetCoupon", objConn);
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@mode", "UpdatedInfo");
             cmd.Parameters.AddWithValue("@coupon_id", couponid);
             cmd.CommandTimeout = 500;
             SqlDataAdapter da = new SqlDataAdapter(cmd);
             da.Fill(ds);
             return(ds);
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemplo n.º 28
0
        public string DeleteAllMarketsRecord()
        {
            try
            {
                //DataSet ds = new DataSet();
                using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
                {
                    SqlCommand cmd = new SqlCommand("sp_BettingMarket", objConn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@mode", "DeleteAll");
                    objConn.Open();
                    cmd.ExecuteNonQuery();
                    objConn.Close();
                }

                return("Records deleted successfully");
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }
Exemplo n.º 29
0
 public string DeleteFirstPageRecords()
 {
     try
     {
         //DataSet ds = new DataSet();
         using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
         {
             SqlCommand cmd = new SqlCommand("sp_InsertMatchInfo", objConn);
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@mode", "DeleteAll");
             objConn.Open();
             cmd.ExecuteNonQuery();
             objConn.Close();
         }
         return("Records deleted successfully");
     }
     catch (Exception ex)
     {
         ErrorLog(ex.ToString());
         return(null);
     }
 }
Exemplo n.º 30
0
        /// <summary>
        ///  Store(Insert) 6 Result of Match.
        ///  Dev Nagar
        /// </summary>
        /// <param name="All Result array string"></param>
        public void InsertChampionResult(string[] result)
        {
            try
            {
                SqlParameter[] arrParam = { new SqlParameter("@MatchID",         Convert.ToInt32(result[0])),
                                            new SqlParameter("@HTScore",         result[2]),
                                            new SqlParameter("@FGScorer",        result[3]),
                                            new SqlParameter("@LGScorer",        result[4]),
                                            new SqlParameter("@TotalScore",      result[1]),
                                            new SqlParameter("@FGTime",          result[5]),
                                            new SqlParameter("@LGTime",          result[6]),
                                            new SqlParameter("@AllGPlayer",      result[7]),
                                            new SqlParameter("@FHGPlayer",       result[8]),
                                            new SqlParameter("@LHGPlayer",       result[9]),
                                            new SqlParameter("@FAGPlayer",       result[10]),
                                            new SqlParameter("@LAGPlayer",       result[11]),
                                            new SqlParameter("@FirstBooking",    result[12]),
                                            new SqlParameter("@LastBooking",     result[13]),
                                            new SqlParameter("@TotalYellowCard", result[14]),
                                            new SqlParameter("@TotalRedCard",    result[15]),
                                            new SqlParameter("@BookingIndexes",  result[16]) };

                using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
                {
                    SqlCommand cmd = new SqlCommand("sp_insertMatchResult", objConn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddRange(arrParam);
                    cmd.CommandTimeout = 500;
                    objConn.Open();
                    cmd.ExecuteNonQuery();
                    objConn.Close();
                }
            }
            catch (Exception ex)
            {
                ErrorLog(ex.ToString());
            }
        }