Ejemplo n.º 1
0
        protected void rBTNAssign_Click(object sender, EventArgs e)
        {
            //var strPlayerGUID = rLBPlayer.SelectedValue;
            var  strPlayerGUID = hddPlayerGUID.Value;
            Guid PlayerGuid    = Guid.Parse(strPlayerGUID);

            if (rDDSeasonTeam.SelectedValue == "0")     // Put player in recycle bin
            {
                SeasonPlayerDomainModel   SP    = new SeasonPlayerDomainModel();
                SeasonPlayerBusinessLogic SPBLL = new SeasonPlayerBusinessLogic();
                SP.SeasonID   = Convert.ToInt32(rDDSeason.SelectedValue);
                SP.PlayerGUID = PlayerGuid;
                SPBLL.InsertSeasonPlayerRecycle(SP);
            }
            else
            {
                SeasonTeamPlayerDomainModel STP = new SeasonTeamPlayerDomainModel();


                STP.SeasonID   = Convert.ToInt32(rDDSeason.SelectedValue);
                STP.TeamID     = Convert.ToInt32(rDDSeasonTeam.SelectedValue);
                STP.PlayerGUID = PlayerGuid;
                STP.Points     = Convert.ToInt32(rNTBCurrBid.Value);

                DraftPlayerBLL.DraftPlayer(STP);
            }
            strPageState = "Pick";
            ManageButtons();
            RepaintScreen();
        }
Ejemplo n.º 2
0
 public void TradePlayer(SeasonTeamPlayerDomainModel STP, int NewTeamID, int Points)
 {
     using (CSBAAzureEntities context = new CSBAAzureEntities())
     {
         context.Database.ExecuteSqlCommand("sp_Team_Roster_Update {0}, {1}, {2}, {3}, {4}", STP.SeasonID, STP.PlayerGUID, STP.TeamID, NewTeamID, Points);
     }
 }
Ejemplo n.º 3
0
        protected void rGridTeam_UpdateCommand(object sender, GridCommandEventArgs e)
        {
            try
            {
                GridEditableItem eeditedItem = e.Item as GridEditableItem;

                SeasonTeamPlayerDomainModel   STP   = new SeasonTeamPlayerDomainModel();
                DraftPlayerBusinessLogicLayer DrBLL = new DraftPlayerBusinessLogicLayer();

                STP.SeasonID   = Convert.ToInt32((eeditedItem.FindControl("lblSeasonID") as Label).Text);
                STP.PlayerGUID = new Guid((eeditedItem.FindControl("lblPlayerGUID") as Label).Text);
                STP.TeamID     = Convert.ToInt32((eeditedItem.FindControl("lblTeamID") as Label).Text);
                int NewTeamID = Convert.ToInt32((eeditedItem.FindControl("rDDSeasonTeam") as RadDropDownList).SelectedValue);
                int Points    = Convert.ToInt32((eeditedItem.FindControl("rNUMPoints") as RadNumericTextBox).Text);

                DrBLL.TradePlayer(STP, NewTeamID, Points);

                rGridTeam.Rebind();
            }
            catch (Exception ex)
            {
                StackTrace st        = new StackTrace();
                StackFrame sf        = st.GetFrame(0);
                string     errMethod = sf.GetMethod().Name.ToString();                                           // Get the current method name
                string     errMsg    = "600";                                                                    // Gotta pass something, we're retro-fitting an existing method
                Session["LastException"] = ex;                                                                   // Throw the exception in the session variable, will be used in error page
                string url = string.Format(ConfigurationManager.AppSettings["ErrorPageURL"], errMethod, errMsg); //Set the URL
                Response.Redirect(url);                                                                          // Go to the error page.
            }
        }
Ejemplo n.º 4
0
 public void DraftPlayer(SeasonTeamPlayerDomainModel STP)
 {
     using (CSBAAzureEntities context = new CSBAAzureEntities())
     {
         var _cSTP = new SeasonTeamPlayer
         {
             PlayerGUID = STP.PlayerGUID,
             SeasonID   = STP.SeasonID,
             TeamID     = STP.TeamID,
             Points     = STP.Points
         };
         context.SeasonTeamPlayers.Add(_cSTP);
         context.SaveChanges();
     }
 }
 public void TradePlayer(SeasonTeamPlayerDomainModel STP, int NewTeamID, int Points)
 {
     DAL.TradePlayer(STP, NewTeamID, Points);
 }
 public void DraftPlayer(SeasonTeamPlayerDomainModel STP)
 {
     DAL.DraftPlayer(STP);
 }