Exemplo n.º 1
0
 private void UpdRow(long TeamID)
 {
     var oTeam = new CSBC.Components.Season.ClsTeams();
     try
     {
         var _with12 = oTeam;
         _with12.TeamName = txtName.Text;
         _with12.TeamNumber = txtTeamNumber.Text;
         _with12.TeamColorID = Int32.Parse(cmbColors.SelectedValue);
         _with12.CoachID = Int32.Parse(cmbCoach.SelectedValue);
         _with12.DivisionID = Int32.Parse(cmbDivisions.SelectedValue);
         _with12.CoCoachID = Int32.Parse(cmbAsstCoach.SelectedValue);
         _with12.SponsorID = Int32.Parse(cmbSponsors.SelectedValue);             ///put this back
         _with12.CreatedUser = (string)Session["UserName"];
         _with12.SeasonID = Master.SeasonId;
         oTeam.UpdRow(TeamID, Master.CompanyId, 0);                      //send time zone info....
     }
     catch (Exception ex)
     {
         Session["ErrorMSG"] = "UpdRow::" + ex.Message;
     }
     finally
     {
         oTeam = null;
     }
 }
Exemplo n.º 2
0
 //private void UpdRow(long RowID)
 //{
 //    var rep = new DivisionRepository(new CSBCDbContext());
 //    var division = new Division();
 //    DateTime date;
 //    try
 //    {
 //        division.SeasonID = (int)Session["SeasonID"];
 //        division.CompanyID = Master.CompanyId;
 //        division.Div_Desc = txtName.Text;
 //        division.MinDate = DateTime.Parse(txtMinDate.Text);
 //        division.MaxDate = DateTime.Parse(txtMaxDate.Text);
 //        if (radGender.SelectedIndex == 0)
 //            division.Gender = "M";
 //        if (radGender.SelectedIndex == 1)
 //            division.Gender = "F";
 //        if (DateTime.TryParse(txtMinDate2.Text, out date))
 //            division.MinDate2 = date;
 //        DateTime goodDate;
 //        if (DateTime.TryParse(txtMaxDate2.Text, out goodDate))
 //            division.MaxDate2 = DateTime.Parse(txtMaxDate2.Text);
 //        if (radGender2.SelectedIndex == 0)
 //            division.Gender2 = "M";
 //        if (radGender2.SelectedIndex == 1)
 //            division.Gender2 = "F";
 //        division.DraftVenue = txtVenue.Text;
 //        if (DateTime.TryParse(txtDate.Text, out date))
 //            division.DraftDate = date;
 //        division.DraftTime = txtTime.Text;
 //        division.DirectorID = Int32.Parse(cboAD.SelectedValue);
 //        division.CoDirectorID = 0;
 //        //cboAD.SelectedValue
 //        division.CreatedUser = Session["UserName"].ToString();
 //        rep.Update(division);
 //    }
 //    catch (Exception ex)
 //    {
 //        Session["ErrorMSG"] = "UpdRow::" + ex.Message;
 //    }
 //}
 //private void ADDRow()
 //{
 //    var oDivisions = new CSBC.Components.Season.ClsDivisions();
 //    DateTime date;
 //    try
 //    {
 //        var _with7 = oDivisions;
 //        _with7.SeasonID = (int)Session["SeasonID"];
 //        _with7.Div_Desc = txtName.Text;
 //        _with7.DirectorID = Int32.Parse(cboAD.SelectedValue.ToString());
 //        _with7.DraftVenue = txtVenue.Text;
 //        if (DateTime.TryParse(txtDate.Text, out date))
 //            _with7.DraftDate = date;
 //        _with7.DraftTime = txtTime.Text;
 //        _with7.MinDate = DateTime.Parse(txtMinDate.Text);
 //        _with7.MaxDate = DateTime.Parse(txtMaxDate.Text);
 //        if (radGender.SelectedIndex == 0)
 //            _with7.Gender = "M";
 //        if (radGender.SelectedIndex == 1)
 //            _with7.Gender = "F";
 //        if (DateTime.TryParse(txtMinDate2.Text, out date))
 //            _with7.MinDate2 = date;
 //        if (DateTime.TryParse(txtMaxDate2.Text, out date))
 //            _with7.MaxDate2 = DateTime.Parse(txtMaxDate2.Text);
 //        if (radGender2.SelectedIndex == 0)
 //            _with7.Gender2 = "M";
 //        if (radGender2.SelectedIndex == 1)
 //            _with7.Gender2 = "F";
 //        _with7.CreatedUser = Session["UserName"].ToString();
 //        oDivisions.UpdRow((long)0, (int)Session["CompanyID"], (int)Session["TimeZone"]);
 //        DivisionId = _with7.DivisionID;
 //    }
 //    catch (Exception ex)
 //    {
 //        Session["ErrorMSG"] = "ADDRow::" + ex.Message;
 //    }
 //    finally
 //    {
 //        oDivisions = null;
 //    }
 //    AddGroup(DivisionId, "REFUNDS");
 //    AddGroup(DivisionId, "WAITING LIST");
 //    AddGroup(DivisionId, "NO SHOW");
 //}
 private void AddGroup(int DivisionID, string sGroup)
 {
     if (Master.AccessType == "R" | getGroup(DivisionID.ToString(), sGroup) > 0)
         return;
     var oTeams = new CSBC.Components.Season.ClsTeams();
     try
     {
         var _with8 = oTeams;
         _with8.SeasonID = (int)Session["SeasonID"];
         _with8.DivisionID = DivisionID;
         _with8.TeamName = sGroup;
         _with8.TeamNumber = "0";
         _with8.CoCoachID = 0;
         _with8.CreatedUser = Session["UserName"].ToString();
         oTeams.UpdRow(0, (int)Session["CompanyID"], (int)Session["TimeZone"]);
     }
     catch (Exception ex)
     {
         Session["ErrorMSG"] = "AddGroup::" + ex.Message;
     }
     finally
     {
         oTeams = null;
     }
 }
Exemplo n.º 3
0
 private void AddRow()
 {
     if ((string)Session["AccessType"] == "R")
         return;
     var team = new CSBC.Components.Season.ClsTeams();
     try
     {
         team.SeasonID = (int)Session["SeasonID"];
         team.DivisionID = Int32.Parse(cmbDivisions.SelectedValue);
         team.CoachID = Int32.Parse(cmbCoach.SelectedValue);
         team.CoCoachID = Int32.Parse(cmbAsstCoach.SelectedValue);
         team.SponsorID = Int32.Parse(cmbSponsors.SelectedValue);
         team.TeamName = txtName.Text;
         team.TeamColorID = Int32.Parse(cmbColors.SelectedValue);
         team.TeamNumber = txtTeamNumber.Text;
         team.CreatedUser = (string)Session["UserName"];
         team.UpdRow(0, (int)Session["CompanyID"], (int)Session["TimeZone"]);
         Session["TeamId"] = team.TeamId;
     }
     catch (Exception ex)
     {
         Session["ErrorMSG"] = ex.Message;
     }
     finally
     {
         team = null;
     }
 }