コード例 #1
0
    public string GeneratePaymentRequest(int FederationID, int UserID, int CampYear)
    {
        CIPDataAccess dal = new CIPDataAccess();

        try
        {
            SqlParameter[] param = new SqlParameter[4];
            param[0]           = new SqlParameter("@FederationID", FederationID);
            param[1]           = new SqlParameter("@UserID", UserID);
            param[2]           = new SqlParameter("@CampYear", CampYear);
            param[3]           = new SqlParameter("@PaymentID", SqlDbType.Int);
            param[3].Direction = ParameterDirection.Output;
            dal.ExecuteNonQuery("[usp_GeneratePaymentControl]", param);

            return(param[3].Value.ToString());
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            dal = null;
        }
    }
コード例 #2
0
        public int UserRegistration(string strEmail, string strPwd, out string CamperLoginID)
        {
            CIPDataAccess dal = new CIPDataAccess();
            int           rowsaffected;

            try
            {
                SqlParameter[] param = new SqlParameter[3];
                param[0]           = new SqlParameter("@Email", strEmail);
                param[1]           = new SqlParameter("@Password", strPwd);
                param[2]           = new SqlParameter("@oCamperLoginID", SqlDbType.NVarChar, 10);
                param[2].Direction = ParameterDirection.Output;

                rowsaffected = dal.ExecuteNonQuery("[usp_InsertUserRegistration]", out CamperLoginID, param);
                return(rowsaffected);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dal = null;
            }
        }
コード例 #3
0
        //Change user password
        public string ChangePassword()
        {
            CIPDataAccess objdal = new CIPDataAccess();
            string        strMsg;

            try
            {
                SqlParameter[] sparams = new SqlParameter[4];

                sparams[0]           = new SqlParameter("@UserId", UserId);
                sparams[1]           = new SqlParameter("@OldPwd", OldPassword);
                sparams[2]           = new SqlParameter("@NewPwd", Password);
                sparams[3]           = new SqlParameter("@Msg", SqlDbType.VarChar, 50);
                sparams[3].Direction = ParameterDirection.Output;

                objdal.ExecuteNonQuery("[usp_ChangePassword]", sparams);
                strMsg = sparams[3].Value.ToString();

                return(strMsg);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objdal = null;
            }
        }
コード例 #4
0
        //Update a user
        public void UpdateUser()
        {
            SqlParameter[] sparams = new SqlParameter[11];

            sparams[0]  = new SqlParameter("@UserId", UserId);
            sparams[1]  = new SqlParameter("@Password", Password);
            sparams[2]  = new SqlParameter("@FirstName", FirstName);
            sparams[3]  = new SqlParameter("@LastName", LastName);
            sparams[4]  = new SqlParameter("@PhoneNUmber", PhoneNumber);
            sparams[5]  = new SqlParameter("@Email", Email);
            sparams[6]  = new SqlParameter("@MovementID", MovementID);
            sparams[7]  = new SqlParameter("@FederationID", FederationID);
            sparams[8]  = new SqlParameter("@RoleID", RoleId);
            sparams[9]  = new SqlParameter("@superAdmin", null);
            sparams[10] = new SqlParameter("@camps", CampList);

            _objDAL = new CIPDataAccess();
            try
            {
                _objDAL.ExecuteNonQuery("[usp_UpdateAdminUser]", sparams);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                _objDAL = null;
            }
        }
コード例 #5
0
        //Creates a user
        public int CreateUser()
        {
            SqlParameter[] sparams = new SqlParameter[11];

            sparams[0]            = new SqlParameter("@Password", Password);
            sparams[1]            = new SqlParameter("@FirstName", FirstName);
            sparams[2]            = new SqlParameter("@LastName", LastName);
            sparams[3]            = new SqlParameter("@PhoneNUmber", PhoneNumber);
            sparams[4]            = new SqlParameter("@Email", Email);
            sparams[5]            = new SqlParameter("@MovementID", MovementID);
            sparams[6]            = new SqlParameter("@FederationID", FederationID);
            sparams[7]            = new SqlParameter("@RoleID", RoleId);
            sparams[8]            = new SqlParameter("@superAdmin", null);
            sparams[9]            = new SqlParameter("@camps", CampList);
            sparams[10]           = new SqlParameter("@UsrId", SqlDbType.Int);
            sparams[10].Direction = ParameterDirection.Output;

            _objDAL = new CIPDataAccess();
            int iUsrId;

            try
            {
                _objDAL.ExecuteNonQuery("[usp_InsertAdminUser]", sparams);
                iUsrId = Convert.ToInt32(sparams[10].Value);
                return(iUsrId);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                _objDAL = null;
            }
        }
コード例 #6
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        comformationInfo.Visible = true;
        submitemail.Visible      = false;
        string        sEmail = email.Text.Trim();
        CIPDataAccess dal    = new CIPDataAccess();
        int           rowsaffected;

        try
        {
            SqlParameter[] param = new SqlParameter[1];
            param[0] = new SqlParameter("@email", sEmail);

            rowsaffected = dal.ExecuteNonQuery("[usp_InsertRegistrationEmail]", param);
        }
        catch { }
    }
コード例 #7
0
        //Deletes a user
        public void DeleteUser(int iUsrId)
        {
            SqlParameter[] sparams = new SqlParameter[1];
            sparams[0] = new SqlParameter("@userId", iUsrId);

            _objDAL = new CIPDataAccess();
            try
            {
                _objDAL.ExecuteNonQuery("usp_DeleteAdminUser", sparams);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                _objDAL = null;
            }
        }
コード例 #8
0
        //Lock or Unlock the record for the user
        public void LockUnlockRecord(string strMode)
        {
            SqlParameter[] sparams = new SqlParameter[3];
            sparams[0] = new SqlParameter("@Mode ", strMode);
            sparams[1] = new SqlParameter("@UserId", UserId);
            sparams[2] = new SqlParameter("@FJCID", FJCID);

            CIPDataAccess objdal = new CIPDataAccess();

            try
            {
                objdal.ExecuteNonQuery("[usp_LockUnlockRecords]", sparams);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objdal = null;
            }
        }
コード例 #9
0
        public int LinkFJCIDsCamper(int CamperLoginID, string FJCID)
        {
            CIPDataAccess dal = new CIPDataAccess();
            int           rowsaffected;

            try
            {
                SqlParameter[] param = new SqlParameter[2];
                param[0] = new SqlParameter("@CamperLoginID", CamperLoginID);
                param[1] = new SqlParameter("@FJCID", FJCID);

                rowsaffected = dal.ExecuteNonQuery("[usp_LinkFJCIDsToCamper]", param);

                return(rowsaffected);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dal = null;
            }
        }