Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UserRole = (Role)Convert.ToInt32(Session["RoleID"]);

        lblMsg.Text         = "";
        chkAllCamps.Enabled = true;
        //btnReport123.Enabled = true;

        MakeKeyStatusBold();

        if (!IsPostBack)
        {
            using (CIPMSEntities1 ctx = new CIPMSEntities1())
            {
                ddlCampYear.DataSource    = ctx.tblCampYears.Select(x => new { id = x.ID, text = x.CampYear });
                ddlCampYear.SelectedValue = Application["CampYearID"].ToString();
                ddlCampYear.DataBind();
            }

            if (UserRole == Role.CampDirector)
            {
                ddlFed.Visible      = false;
                ddlFed.DataSourceID = null;

                chklistCamp.DataSourceID = null;
                chklistCamp.DataSource   = CampsDA.GetCampByJWestCampDirector(Int32.Parse(ddlCampYear.SelectedValue), Int32.Parse(Session["UserID"].ToString()));
                chklistCamp.DataBind();

                chkAllCamps.Visible = false;
            }
        }
    }
Beispiel #2
0
    protected void btnGenerate_Click(object sender, EventArgs e)
    {
        int campYearID = Int32.Parse(ddlCampYear.SelectedValue);

        using (var ctx = new CIPMSEntities1())
        {
            var list = from row in ctx.tblFederationCampsContactDetails.Include("tblCamp")
                       where row.CampYearID == campYearID - 1
                       orderby row.FederationID, row.tblCamp.ID
            select row;

            foreach (var row in list)
            {
                // create new detail rows.  EF will insert entities automatically because referecing to the existing camps
                var p = new tblFederationCampsContactDetail
                {
                    CampYearID    = campYearID,
                    tblCamp       = ctx.tblCamps.Where(x => x.ID == row.tblCamp.ID + 1000).First(),
                    FederationID  = row.FederationID,
                    Contact       = row.Contact,
                    Phone         = row.Phone,
                    Email         = row.Email,
                    NavigationURL = row.NavigationURL,
                    ParentInfoPreviousClickURL = row.ParentInfoPreviousClickURL
                };
            }
            ctx.SaveChanges();
        }
        lblMsg.Text = "Data generated successfully.";
    }
Beispiel #3
0
    protected void btnGenerate_Click(object sender, EventArgs e)
    {
        int campYearID = Int32.Parse(ddlCampYear.SelectedValue);

        using (CIPMSEntities1 ctx = new CIPMSEntities1())
        {
            var list = from row in ctx.tblUserCamps
                       where row.CampYearid == campYearID - 1
                       orderby row.UserId, row.CampId
            select row;

            foreach (var row in list)
            {
                // create new detail rows.  EF will insert entities automatically because referecing to the existing camps
                ctx.AddTotblUserCamps(new tblUserCamp
                {
                    CampYearid = campYearID,
                    UserId     = row.UserId,
                    CampId     = row.CampId + 1000
                });
            }
            ctx.SaveChanges();
        }
        lblMsg.Text = "Data generated successfully.";
    }
Beispiel #4
0
    protected void btnGenerate_Click(object sender, EventArgs e)
    {
        int campYearID = Int32.Parse(ddlCampYear.SelectedValue);

        using (var ctx = new CIPMSEntities1())
        {
            var list = from grantrow in ctx.tblFedCampGrants
                       where grantrow.CampYearID == campYearID - 1
                       orderby grantrow.FederationID, grantrow.CampID
            select grantrow;

            foreach (var row in list)
            {
                // create new FedCampGrant
                ctx.AddTotblFedCampGrants(new tblFedCampGrant
                {
                    CampYearID   = campYearID,
                    CampID       = row.CampID == 0 ? 0 : row.CampID + 1000,
                    FederationID = row.FederationID,
                    TimeInCamp   = row.TimeInCamp,
                    DaysAtLeast  = row.DaysAtLeast,
                    GrantAmount  = row.GrantAmount
                });
            }

            ctx.SaveChanges();
        }
        lblMsg.Text = "Data generated successfully.";
    }
Beispiel #5
0
    protected void btnGenerate_Click(object sender, EventArgs e)
    {
        int campYearID = Int32.Parse(ddlCampYear.SelectedValue);

        using (var ctx = new CIPMSEntities1())
        {
            var list = from camp in ctx.tblCamps
                       where camp.CampYearID == campYearID - 1
                       select camp;

            foreach (var newCamp in list)
            {
                ctx.AddTotblCamps(new tblCamp
                {
                    CampYearID   = campYearID,
                    ID           = newCamp.ID + 1000,
                    Inactive     = false,
                    Name         = newCamp.Name,
                    IsManual     = false,
                    State        = newCamp.State,
                    JDataID      = newCamp.JDataID,
                    IsWestCamp   = newCamp.IsWestCamp,
                    IsAdamahCamp = newCamp.IsAdamahCamp,
                    IsURJCamp    = newCamp.IsURJCamp
                });
            }

            ctx.SaveChanges();
        }
        lblMsg.Text = "Data generated successfully.";
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        UserRole = (Role)Convert.ToInt32(Session["RoleID"]);

        lblMsg.Text = "";

        MakeKeyStatusBold();

        if (!IsPostBack)
        {
            using (CIPMSEntities1 ctx = new CIPMSEntities1())
            {
                ddlCampYear.DataSource    = ctx.tblCampYears.Select(x => new { id = x.ID, text = x.CampYear });
                ddlCampYear.SelectedValue = Application["CampYearID"].ToString();
                ddlCampYear.DataBind();
            }
        }

        // Delete old work files
        string workFileDir = Server.MapPath(@"~/Docs");

        // need to check and see if any old files are left behind
        DirectoryInfo myDir = new DirectoryInfo(workFileDir);

        foreach (FileSystemInfo myFile in myDir.GetFileSystemInfos("*.xls"))
        {
            // Delete any files that are 1 min old
            //if ((DateTime.Now - myFile.CreationTime).Minutes > 1)
            myFile.Delete();
        }
    }
Beispiel #7
0
    protected void btnGenerate_Click(object sender, EventArgs e)
    {
        int campYearID = Int32.Parse(ddlCampYear.SelectedValue);

        using (CIPMSEntities1 ctx = new CIPMSEntities1())
        {
            var list = from row in ctx.tblNationalCamps
                       where row.CampYearID == campYearID - 1
                       orderby row.FederationID, row.CampID
            select row;

            foreach (var row in list)
            {
                // create new FedCampGrant
                ctx.AddTotblNationalCamps(new tblNationalCamp
                {
                    CampYearID   = campYearID,
                    CampID       = row.CampID + 1000,
                    FederationID = row.FederationID
                });
            }

            ctx.SaveChanges();
        }
        lblMsg.Text = "Data generated successfully.";
    }
Beispiel #8
0
    protected void btnGenerate_Click(object sender, EventArgs e)
    {
        int campYearID = Int32.Parse(ddlCampYear.SelectedValue);

        using (var ctx = new CIPMSEntities1())
        {
            var list = from row in ctx.tblFederationCamps.Include("tblCamp")
                       where row.CampYearID == campYearID - 1
                       orderby row.FederationID, row.tblCamp.ID
            select row;

            foreach (var row in list)
            {
                if (row.tblCamp != null)
                {
                    var camp = ctx.tblCamps.Where(x => x.ID == row.tblCamp.ID + 1000).FirstOrDefault();

                    if (camp != null)
                    {
                        var p = new tblFederationCamp
                        {
                            ID           = row.ID + 1000,
                            CampYearID   = campYearID,
                            tblCamp      = camp,
                            FederationID = row.FederationID,
                            isJDS        = row.isJDS,
                            Inactive     = false
                        };
                    }
                }
            }
            ctx.SaveChanges();
        }
        lblMsg.Text = "Data generated successfully.";
    }
Beispiel #9
0
    protected void btnGenerate_Click(object sender, EventArgs e)
    {
        int campYearID = Int32.Parse(ddlCampYear.SelectedValue);

        using (CIPMSEntities1 ctx = new CIPMSEntities1())
        {
            var list = from row in ctx.tblFederationGrades
                       where row.CampYearID == campYearID - 1
                       orderby row.FederationID, row.EligibleGrade
            select row;

            foreach (var row in list)
            {
                // create new detail rows.  EF will insert entities automatically because referecing to the existing camps
                if (row.FederationID != 89)
                {
                    ctx.AddTotblFederationGrades(new tblFederationGrade
                    {
                        CampYearID    = campYearID,
                        FederationID  = row.FederationID,
                        EligibleGrade = row.EligibleGrade,
                        TimeInCamp    = row.TimeInCamp
                    });
                }
            }
            ctx.SaveChanges();
        }
        lblMsg.Text = "Data generated successfully.";
    }
Beispiel #10
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        int campYearID = Int32.Parse(ddlCampYear.SelectedValue);

        using (CIPMSEntities1 ctx = new CIPMSEntities1())
        {
            ctx.uspFedCampGrantDelete(campYearID);
        }
        lblMsg.Text = "Data deleted successfully.";
    }
Beispiel #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         using (CIPMSEntities1 ctx = new CIPMSEntities1())
         {
             ddlCampYear.DataSource    = ctx.tblCampYears.Select(x => new { id = x.ID, text = x.CampYear });
             ddlCampYear.SelectedValue = Application["CampYearID"].ToString();
             ddlCampYear.DataBind();
         }
     }
 }
Beispiel #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        lblMsg.Text = "";

        if (!IsPostBack)
        {
            using (CIPMSEntities1 ctx = new CIPMSEntities1())
            {
                ddlCampYear.DataSource     = ctx.tblCampYears.Where(x => x.CurrentYear == true).Select(x => new { id = x.ID, text = x.CampYear });
                ddlCampYear.DataValueField = "id";
                ddlCampYear.DataTextField  = "text";
                ddlCampYear.DataBind();
            }
        }
    }
Beispiel #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UserRole    = (Role)Convert.ToInt32(Session["RoleID"]);
        lblMsg.Text = "";
        MakeKeyStatusBold();

        if (!IsPostBack)
        {
            using (CIPMSEntities1 ctx = new CIPMSEntities1())
            {
                ddlCampYear.DataSource    = ctx.tblCampYears.Select(x => new { id = x.ID, text = x.CampYear });
                ddlCampYear.SelectedValue = Application["CampYearID"].ToString();
                ddlCampYear.DataBind();
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        lblMsg.Text  = "";
        lblMsg2.Text = "";

        if (!IsPostBack)
        {
            ResetWarning(false);
            using (var ctx = new CIPMSEntities1())
            {
                ddlCampYear.DataSource    = ctx.tblCampYears.Select(x => new { id = x.ID, text = x.CampYear });
                ddlCampYear.SelectedValue = Application["CampYearID"].ToString();
                ddlCampYear.DataBind();
            }
        }
    }
Beispiel #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            UserRole = (Role)Convert.ToInt32(Session["RoleID"]);
            using (CIPMSEntities1 ctx = new CIPMSEntities1())
            {
                ddlCampYear.DataSource    = ctx.tblCampYears.Select(x => new { id = x.ID, text = x.CampYear });
                ddlCampYear.SelectedValue = Application["CampYearID"].ToString();
                ddlCampYear.DataBind();
            }

            if (UserRole == Role.CampDirector)
            {
                ddlFed.Visible      = false;
                ddlFed.DataSourceID = null;
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        UserRole            = (Role)Convert.ToInt32(Session["RoleID"]);
        lblMsg.Text         = "";
        chkAllCamps.Visible = true;

        MakeKeyStatusBold();

        // We have to determine if its Fed Admin
        if (!IsPostBack)
        {
            if (UserRole == Role.CampDirector || UserRole == Role.FederationAdmin)
            {
                chkAllFeds.Visible   = false;
                chkByProgram.Visible = false;
            }

            using (CIPMSEntities1 ctx = new CIPMSEntities1())
            {
                ddlCampYear.DataSource    = ctx.tblCampYears.Select(x => new { id = x.ID, text = x.CampYear });
                ddlCampYear.SelectedValue = Application["CampYearID"].ToString();
                ddlCampYear.DataBind();
            }

            for (int i = 0; i < 2; i++)
            {
                if (i == 0)
                {
                    chklistCountryPopular.Items[i].Attributes.Add("title", "Russia, Belarus, Estonia, Kazakhstan, Lithuania, Ukraine, Armenia, Azerbaijan, Georgia, Latvia, Moldova, Uzbekistan, Kyrgyzstan, Turkmenistan, Tajikistan");
                    chklistCountryPopular.Items[i].Attributes.Add("id", "pretty");
                }
                else
                {
                    chklistCountryPopular.Items[i].Attributes.Add("title", "Mexico, Belize, Costa Rica, El Salvador, Guatemala, Honduras, Panama, Argentina, Bolivia, Brazil, Chile, Colombia, Ecuador, French Guiana, Guyana, Paraguay, Peru, Suriname, Uruguay, Venezuela, Falkland Islands");
                    chklistCountryPopular.Items[i].Attributes.Add("id", "pretty2");
                }
            }
        }
    }
Beispiel #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UserRole            = (Role)Convert.ToInt32(Session["RoleID"]);
        lblMsg.Text         = "";
        chkAllCamps.Visible = true;

        if (UserRole == Role.CampDirector || UserRole == Role.FederationAdmin)
        {
            chkAllFeds.Visible = false;
        }

        MakeKeyStatusBold();

        if (!IsPostBack)
        {
            using (CIPMSEntities1 ctx = new CIPMSEntities1())
            {
                ddlCampYear.DataSource    = ctx.tblCampYears.Select(x => new { id = x.ID, text = x.CampYear });
                ddlCampYear.SelectedValue = Application["CampYearID"].ToString();
                ddlCampYear.DataBind();
            }
        }
    }