示例#1
0
 private int PlayersAssigned()
 {
     int functionReturnValue = 0;
     if (Master.AccessType == "R")
         return functionReturnValue;
     var oTeams = new CSBC.Components.Season.ClsTeams();
     functionReturnValue = 0;
     try
     {
         functionReturnValue = oTeams.GetPlayersCount(DivisionId, (int)Session["CompanyID"], (int)Session["SeasonID"]);
     }
     catch (Exception ex)
     {
         Session["ErrorMSG"] = "PlayersAssigned::" + ex.Message;
     }
     finally
     {
         oTeams = null;
     }
     return functionReturnValue;
 }
示例#2
0
 private int getGroup(string DivisionID, string sGroup)
 {
     int functionReturnValue = 0;
     var oTeams = new CSBC.Components.Season.ClsTeams();
     functionReturnValue = 0;
     try
     {
         functionReturnValue = oTeams.GetTeamCount(Int32.Parse(DivisionID), sGroup, (int)Session["CompanyID"], (int)Session["SeasonID"]);
     }
     catch (Exception ex)
     {
         Session["ErrorMSG"] = "getGroup::" + ex.Message;
     }
     finally
     {
         oTeams = null;
     }
     return functionReturnValue;
 }
示例#3
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;
     }
 }
示例#4
0
文件: Teams.aspx.cs 项目: rsalit/CSBC
 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;
     }
 }
示例#5
0
文件: Teams.aspx.cs 项目: rsalit/CSBC
 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;
     }
 }
示例#6
0
 private void LoadTeams()
 {
     var rep = new TeamRepository(new CSBCDbContext());
     // var teams = rep.GetSeasonTeams(Master.SeasonId);
     var oTeams = new CSBC.Components.Season.ClsTeams();
     DataTable rsData = default(DataTable);
     try
     {
         rsData = oTeams.LoadDivisionTeams(ScheduleNo, Master.CompanyId, Master.SeasonId, true);
         //txtHome.Text = rsData.Rows[0]["Home"].ToString();
     }
     catch (Exception ex)
     {
         lblError.Text = "LoadTeams::" + ex.Message;
     }
     finally
     {
         oTeams = null;
     }
 }