Exemplo n.º 1
0
        protected void rBTNSaveChanges_Click(object sender, EventArgs e)
        {
            SeasonPlayerDomainModel _SeasonPlayer = new SeasonPlayerDomainModel();

            _SeasonPlayer.SeasonID = (Convert.ToInt32(rDDSeason.SelectedValue));

            PositionDomainModel _Position = new PositionDomainModel();

            _Position.PositionID = (Convert.ToInt16(rDDPosition.SelectedValue));

            SPBLL.DeleteSeasonPlayerAll(_SeasonPlayer, _Position);
            int iStOrder = 1;

            foreach (RadListBoxItem item in rLBPlayerSelected.Items)
            {
                SeasonPlayerDomainModel _SPNew = new SeasonPlayerDomainModel();

                _SPNew.SeasonID   = Convert.ToInt32(rDDSeason.SelectedValue);
                _SPNew.PlayerGUID = new Guid(item.Value.ToString());

                iStOrder += 1;
                SPBLL.InsertSeasonPlayer(_SPNew);
            }

            SetupListBoxes();
        }
Exemplo n.º 2
0
 public void DeleteSeasonPlayerAll(SeasonPlayerDomainModel _SeasonPlayer, PositionDomainModel _Position)
 {
     using (CSBAAzureEntities context = new CSBAAzureEntities())
     {
         context.Database.ExecuteSqlCommand("sp_SeasonPlayer_deleteAll {0}, {1}", _SeasonPlayer.SeasonID, _Position.PositionID);
     }
 }
Exemplo n.º 3
0
        protected void rGridPosition_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            try
            {
                PositionDomainModel PosDM = new PositionDomainModel();
                GridEditableItem eeditedItem = e.Item as GridEditableItem;
                PosDM.PositionID = Convert.ToInt32((eeditedItem.FindControl("lblPositionID") as Label).Text.ToString());
                PosDM.PositionTypeID = Convert.ToInt32((eeditedItem.FindControl("lblPositionTypeID") as Label).Text.ToString());
                PosDM.PositionName = (eeditedItem.FindControl("lblPositionName") as Label).Text.ToString().Trim();
                PosDM.PositionNameLong = (eeditedItem.FindControl("rTXTPositionNameLong") as RadTextBox).Text.ToString().Trim();
                PosDM.MaxCount = Convert.ToInt32((eeditedItem.FindControl("rNTBMaxCount") as RadNumericTextBox).Value);

                PosBLL.UpdatePosition(PosDM);
            }
            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.

            }
        }
Exemplo n.º 4
0
 public void DeletePosition(PositionDomainModel position)
 {
     using (CSBAAzureEntities context = new CSBAAzureEntities())
     {
         var cPosition = (from n in context.Positions where n.PositionID == position.PositionID select n).FirstOrDefault();
         context.Positions.Remove(cPosition);
         context.SaveChanges();
     }
 }
Exemplo n.º 5
0
 public void UpdatePosition(PositionDomainModel position)
 {
     using (CSBAAzureEntities context = new CSBAAzureEntities())
     {
         var cPosition = context.Positions.Find(position.PositionID);
         if (cPosition != null)
         {
             cPosition.PositionName     = position.PositionName;
             cPosition.MaxCount         = position.MaxCount;
             cPosition.PositionNameLong = position.PositionNameLong;
             context.SaveChanges();
         }
     }
 }
Exemplo n.º 6
0
        public PositionDomainModel InsertPosition(PositionDomainModel position)
        {
            using (CSBAAzureEntities context = new CSBAAzureEntities())
            {
                var _cPosition = new Position
                {
                    MaxCount         = position.MaxCount,
                    PositionName     = position.PositionName,
                    PositionNameLong = position.PositionNameLong,
                    PositionTypeID   = position.PositionTypeID
                };
                context.Positions.Add(_cPosition);
                context.SaveChanges();

                // pass TeamID back to BLL
                position.PositionID = _cPosition.PositionID;

                return(position);
            }
        }
Exemplo n.º 7
0
 public void DeleteSeasonPlayerAll(SeasonPlayerDomainModel _SeasonPlayer, PositionDomainModel _Position)
 {
     SPDAL.DeleteSeasonPlayerAll(_SeasonPlayer, _Position);
 }
Exemplo n.º 8
0
 public void DeletePosition(PositionDomainModel position)
 {
     DAL.DeletePosition(position);
 }
Exemplo n.º 9
0
 public void UpdatePosition(PositionDomainModel position)
 {
     DAL.UpdatePosition(position);
 }
Exemplo n.º 10
0
 public PositionDomainModel InsertPosition(PositionDomainModel position)
 {
     return(DAL.InsertPosition(position));
 }