Exemple #1
0
        //Validating Camper
        public Boolean ValidateCamper(string strEmail, string strPassword, out DataSet dsRetLogin)
        {
            CIPDataAccess dal = new CIPDataAccess();

            try
            {
                DataSet        dsLogin;
                SqlParameter[] param = new SqlParameter[2];
                param[0] = new SqlParameter("@Email", strEmail);
                param[1] = new SqlParameter("@Password", strPassword);

                dsLogin    = dal.getDataset("[usp_ValidateCamper]", param);
                dsRetLogin = dsLogin;

                if (dsLogin.Tables[0].Rows.Count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dal = null;
            }
        }
Exemple #2
0
        public DataSet getManualReturningCamperDetails(string fName, string lName, string Dob)
        {
            SqlParameter[] sparams = new SqlParameter[3];

            sparams[0] = new SqlParameter("@FirstName", (fName == string.Empty ? null : fName));
            sparams[1] = new SqlParameter("@LastName", (lName == string.Empty ? null : lName));
            sparams[2] = new SqlParameter("@DOB", (Dob == string.Empty ? null : Dob));
            //sparams[3] = new SqlParameter("@FederationId", (strFederationId == string.Empty ? null : strFederationId));

            CIPDataAccess dal = new CIPDataAccess();
            DataSet       dsCamperDetails;

            try
            {
                dsCamperDetails = dal.getDataset("[usp_getManualReturningCamperDetails]", sparams);
                return(dsCamperDetails);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dal = null;
            }
        }
Exemple #3
0
        //Gets user details based on FirstName, LastName, Email, Federation and/or Camp
        public DataSet GetUserDetails()
        {
            SqlParameter[] sparams = new SqlParameter[6];

            sparams[0] = new SqlParameter("@FirstName", (FirstName == string.Empty ? null : FirstName));
            sparams[1] = new SqlParameter("@LastName", (LastName == string.Empty ? null : LastName));
            sparams[2] = new SqlParameter("@Email", (Email == string.Empty ? null : Email));
            sparams[3] = new SqlParameter("@Federation", (FederationID == 0 ? -1 : FederationID));
            sparams[4] = new SqlParameter("@CampID", (CampID == 0 ? -1 : CampID));
            sparams[5] = new SqlParameter("@MovementID", (MovementID == 0 ? -1 : MovementID));

            _objDAL = new CIPDataAccess();
            DataSet dsUsrDetails;

            try
            {
                dsUsrDetails = _objDAL.getDataset("usp_SearchUsers", sparams);
                return(dsUsrDetails);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                _objDAL = null;
            }
        }
Exemple #4
0
        public DataSet SearchCamperDetails(string FJCID, string CY)
        {
            SortColumn = "-1";
            SortOrder  = "-1";

            SqlParameter[] sparams = new SqlParameter[25];

            sparams[0]  = new SqlParameter("@CamperName", (FirstName == string.Empty ? null : FirstName));
            sparams[1]  = new SqlParameter("@CamperLastName", (LastName == string.Empty ? null : LastName));
            sparams[2]  = new SqlParameter("@CamperEmailId", (EmailId == string.Empty ? null : EmailId));
            sparams[3]  = new SqlParameter("@FJCID", (FJCID == string.Empty? null : FJCID));
            sparams[4]  = new SqlParameter("@FederationID", (FederationID == "-1" ? null : FederationID));
            sparams[5]  = new SqlParameter("@CamplISt", (Camplist == string.Empty ? null : Camplist));
            sparams[6]  = new SqlParameter("@Age", (Age == 0 ? -1 : Age));
            sparams[7]  = new SqlParameter("@Grade", (Grade == 0 ? -1 : Grade));
            sparams[8]  = new SqlParameter("@ModIFiedBy", (ModifiedBy == 0 ? -1 : ModifiedBy));
            sparams[9]  = new SqlParameter("@Status", (Status == string.Empty ? null : Status));
            sparams[10] = new SqlParameter("@ZipCode", (ZipCode == string.Empty ? "-1" : ZipCode));
            sparams[11] = new SqlParameter("@ZipCodeFROM", (ZipCodeFrom == string.Empty ? "-1" : ZipCodeFrom));
            sparams[12] = new SqlParameter("@ZipCodeTo", (ZipCodeTo == string.Empty ? "-1" : ZipCodeTo));
            sparams[13] = new SqlParameter("@DateCreatedFROM", (DateCreatedFrom == string.Empty ? null : DateCreatedFrom));
            sparams[14] = new SqlParameter("@DateCreatedTo", (DateCreatedTo == string.Empty ? null : DateCreatedTo));
            sparams[15] = new SqlParameter("@DateSubmittedFROM", (DateSubmittedFrom == string.Empty ? null : DateSubmittedFrom));
            sparams[16] = new SqlParameter("@DateSubmittedTo", (DateSubmittedTo == string.Empty ? null : DateSubmittedTo));
            sparams[17] = new SqlParameter("@LastUpdatedFROM", (DateUpdatedFrom == string.Empty ? null : DateUpdatedFrom));
            sparams[18] = new SqlParameter("@LastUpdatedTo", (DateUpdatedTo == string.Empty ? null : DateUpdatedTo));
            sparams[19] = new SqlParameter("@SortFlag", (SortFlag == true ? "Y" : "N"));
            sparams[20] = new SqlParameter("@SortColumn", (SortColumn == "-1" ? "FJCID" : SortColumn)); //     sparams[20] = new SqlParameter("@SortColumn", (SortColumn == "-1" ? "FJCID" : SortColumn));
            sparams[21] = new SqlParameter("@SortOrder", (SortOrder == "-1" ? "Asc" : SortOrder));
            sparams[22] = new SqlParameter("@WorkQueue", (WorkQueue == true ? "Y" : "N"));
            sparams[23] = new SqlParameter("@UserRole", (UserId == 0 ? -1 : UserId));
            sparams[24] = new SqlParameter("@CampYear", (CampYear == string.Empty ? "0" : CampYear));

            CIPDataAccess dal = new CIPDataAccess();
            DataSet       dsCamperDetails;

            try
            {
                dsCamperDetails = dal.getDataset("usp_SearchCamperApplicationForFJCAdmin", sparams);
                return(dsCamperDetails);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dal = null;
            }
        }
Exemple #5
0
        public DataSet GetAdminUserDetails(string strUserID)
        {
            CIPDataAccess dal = new CIPDataAccess();

            try
            {
                SqlParameter[] param = new SqlParameter[1];
                param[0] = new SqlParameter("@UserID", strUserID);
                return(dal.getDataset("[usp_GetAdminUserDetails]", param));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dal = null;
            }
        }
Exemple #6
0
        //to get the camper details..like password based on his emailID
        public DataSet GetCamperCredentials(string strEmail)
        {
            CIPDataAccess dal = new CIPDataAccess();

            try
            {
                SqlParameter[] param = new SqlParameter[1];
                param[0] = new SqlParameter("@Email", strEmail);
                DataSet dsCities;
                dsCities = dal.getDataset("[usp_GetCamperCredentials]", param);
                return(dsCities);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dal = null;
            }
        }
Exemple #7
0
        public DataSet GetCamperDetails(int iCamperId)
        {
            SqlParameter[] sparams = new SqlParameter[1];
            sparams[0] = new SqlParameter("@CamperId", iCamperId);

            CIPDataAccess dal = new CIPDataAccess();
            DataSet       dsCamperDetails;

            try
            {
                dsCamperDetails = dal.getDataset("[usp_GetCamperDetails]", sparams);
                return(dsCamperDetails);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dal = null;
            }
        }
Exemple #8
0
        //Gets user details by UserId
        public DataSet GetUserById(int iUsrId)
        {
            SqlParameter[] sparams = new SqlParameter[1];
            sparams[0] = new SqlParameter("@UsrId", iUsrId);

            _objDAL = new CIPDataAccess();
            DataSet dsUsrDetails;

            try
            {
                dsUsrDetails = _objDAL.getDataset("[usp_GetUserById]", sparams);
                return(dsUsrDetails);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                _objDAL = null;
            }
        }
Exemple #9
0
    private void PopulateGrid()
    {
        string Federation = "Federations: All";

        System.IO.StringWriter       tw = new System.IO.StringWriter();
        System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);

        CIPDataAccess dal = new CIPDataAccess();
        DataSet       dsExport;

        string FederationID = string.Empty;

        try
        {
            FederationID = Session["FedId"].ToString();

            SqlParameter[] param = new SqlParameter[2];
            if (FederationID.Trim() == string.Empty)
            {
                param[0] = new SqlParameter("@FederationID", null);
            }
            else
            {
                Federation = "Federation: " + Session["FedName"].ToString();
                param[0]   = new SqlParameter("@FederationID", FederationID);
            }

            if (ddlCampYear.SelectedIndex == 0)
            {
                param[1] = new SqlParameter("@Year", null);
            }
            else
            {
                param[1] = new SqlParameter("@Year", ddlCampYear.SelectedItem.Text);
            }

            dsExport = dal.getDataset("[usp_GetViewDump]", param);

            string FileName = excelClientFile + (ddlCampYear.SelectedIndex > 0 ? ddlCampYear.SelectedItem.Text + "-" : "") + String.Format("{0:M/d/yyyy}", DateTime.Now) + ".xls";

            Response.ContentType     = "application/vnd.ms-excel";
            Response.ContentEncoding = System.Text.Encoding.GetEncoding("windows-1255");
            Response.AddHeader("Content-Disposition", "attachment; filename=" + FileName);

            if (dsExport.Tables[0].Rows.Count == 0)
            {
                this.Controls.Remove(gvExport);
                Response.Write("No matching records found.");
                Response.End();
            }
            else
            {
                for (int i = 0; i < dsExport.Tables[0].Rows.Count; i++)
                {
                    dsExport.Tables[0].Rows[i]["Zip"] = "'" + dsExport.Tables[0].Rows[i]["Zip"];
                }

                gvExport.DataSource = dsExport;
                gvExport.DataBind();
                gvExport.Visible = true;
                hw.WriteLine("<table><tr><td><b><font size='3'>" +
                             "Campers Data Export" +
                             "</font></b></td></tr>");

                hw.WriteLine("<tr><td><font size='2'>" + Federation +
                             "</font></td></tr>");

                hw.WriteLine("<tr><td><font size='2'>" +
                             "Export Date: " + String.Format("{0:M/d/yyyy hh:mm tt}", DateTime.Now) +
                             "</font></td></tr></table>");

                HtmlForm form1 = (HtmlForm)Master.FindControl("form1");
                form1.Controls.Clear();
                form1.Controls.Add(gvExport);
                form1.RenderControl(hw);

                this.EnableViewState = false;
                Response.Write(tw.ToString());
                Response.End();
            }
        }
        catch (Exception ex)
        {
        }
    }