Пример #1
0
    public DataSet getTransactionDetails_ALL_Paging(int start, int end)
    {
        DataSet dt = new DataSet();
        using (DM dbManager = new DM())
        {
            dbManager.Command.CommandText = @"select * from 
                                               (select (ROW_NUMBER() OVER (ORDER BY TransactionLog.ID ))AS ROW,
                                                * from TransactionLog ) as res where row between " + start + " and " + end + " ";
            // dbManager.Command.CommandText = "Select id,title,substring(detail,1,500) as DetailsFirstHalf,detail,tags from articlesforposting";

            dbManager.LoadDataSet(dt);

        }
        return dt;
    }
Пример #2
0
    public DataSet getTransactionDetails_User_Paging(int start, int end, string ewalletNumber)
    {
        DataSet dt = new DataSet();
        using (DM dbManager = new DM())
        {
            dbManager.Command.CommandText = @"select * from 
                                               (select (ROW_NUMBER() OVER (ORDER BY eWallet_History.ID ))AS ROW,
                                                * from eWallet_History where ewalletNumber=@ewalletNumber ) as res where row between " + start + " and " + end + " ";
            dbManager.Command.Parameters.AddWithValue("@ewalletNumber", ewalletNumber);

            dbManager.LoadDataSet(dt);

        }
        return dt;
    }
Пример #3
0
    public int CheckValidUser(string username, string password)
    {

        int flag = -1;
        try
        {
            SqlDataReader reader = null;
            string userType = string.Empty;
            int ID = 0;
            DataSet ds = new DataSet();
            using (DM dbManager = new DM())
            {
                //                dbManager.Command.CommandText = @"SELECT * FROM AdminUsers 
                //                                                    WHERE  username= @UserName COLLATE SQL_Latin1_General_CP1_CS_AS AND Password=(SELECT HASHBYTES('SHA1',@Password))";
                dbManager.Command.CommandText = @"SELECT * FROM AdminUsers 
                                                    WHERE  username= @UserName COLLATE SQL_Latin1_General_CP1_CS_AS AND Password=@Password";



                dbManager.Command.Parameters.AddWithValue("@userName", username);
                dbManager.Command.Parameters.AddWithValue("@Password", password);
                reader = dbManager.GetDataReader();
                if (reader.Read() == true)
                {
                    General.Session.UserName = reader.GetValue(1).ToString();

                    ID = Convert.ToInt32(reader.GetValue(0).ToString());


                    flag = 1;
                }
            }

        }
        catch (Exception exp)
        {
            throw;
        }
        return flag;

    }
Пример #4
0
    public DataSet getTransactionTable_Amount_feetype(string transactionNumber)
    {
        DataSet ds = new DataSet();
        try
        {

            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"SELECT  Amount,feetype from TransactionLog Where TransactionNumber=@trnumber";

                dbManager.Command.Parameters.AddWithValue("@trnumber", transactionNumber);

                dbManager.LoadDataSet(ds);
            }
        }
        catch (Exception exp)
        {
            throw;
        }
        return ds;
    }
Пример #5
0
    public void updateApplication_AcceptReject(int applicationID, int status, string reason)
    {
        int mewID = 0;

        try
        {
            using (DM dbManager = new DM())
            {



                dbManager.Command.CommandText = @"update StudentApplications set AdmissionGranted =@status ,ReasonText=@reason
                where ID=@ID";

                dbManager.Command.Parameters.AddWithValue("@ID", applicationID);
                dbManager.Command.Parameters.AddWithValue("@status", status);
                dbManager.Command.Parameters.AddWithValue("@reason", reason);

                dbManager.Command.ExecuteNonQuery();


            }


        }
        catch (Exception exp)
        {
            throw;
        }



    }
Пример #6
0
    public DataSet getCourse_paging(int start, int end)
    {
        DataSet dt = new DataSet();
        using (DM dbManager = new DM())
        {
            dbManager.Command.CommandText = @"select * from 
                                               (select (ROW_NUMBER() OVER (ORDER BY ct.ID ))AS ROW,
                                                  ct.ID,Course,CourseDescription,(Select programname from ProgramsTable where ID=pc.ProgramID) as programName from CoursesTable ct
join  ProgramCourse_Mapping pc  on pc.CourseID=ct.ID 
) as res where row between " + start + " and " + end + " ";

            dbManager.LoadDataSet(dt);

        }
        return dt;
    }
Пример #7
0
    public DataSet getApplication_allUser_Admin(int start, int end)
    {
        int count = 0;
        DataSet ds = new DataSet();
        try
        {

            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"select * from 
                                               (select (ROW_NUMBER() OVER (ORDER BY sp.ID ))AS ROW, sp.ID,sp.UserID,(Select ProgramName from ProgramsTable where id=sp.ProgramID) as programName,
(Select Course from CoursesTable where id=sp.FirstCourse) as Course1,
(Select Course from CoursesTable where id=sp.SecondCourse) as Course2,
(Select ScheduleDate +'<br />'+ScheduleTime from Students_CbtScheduleInfo where Userid=sp.UserID) as CbtSchedule,
Campus,
 CASE WHEN FeePaid = 1 THEN 'Yes' ELSE 'No' END AS FeePaid,
 CASE WHEN OptionalCourse = 1 THEN 'Yes' ELSE 'No' END AS OptionalCourse,
CASE WHEN FormFilled = 1 THEN 'Yes' ELSE 'No' END AS FormFilled
 ,txrefnumber,sp.DateCreated
 ,Status
,formnumber ,ct.cbtscore,ct.jambscore,ct.admissionscore  from StudentApplications sp 

left join   dbo.Students_CbtResults ct on ct.UserID=sp.userID where

sp.formfilled=1 and sp.AdmissionGranted=0 ) as res where row between " + start + " and " + end + " ";

                dbManager.LoadDataSet(ds);


            }
        }
        catch (Exception exp)
        {
            throw;
        }
        return ds;
    }
Пример #8
0
    public DataSet loadJamDataByUserID(string userID)
    {
        DataSet ds = new DataSet();
        try
        {

            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"SELECT * from JAMB_Data where userID=@uID";

                dbManager.Command.Parameters.AddWithValue("@uID", userID);
                dbManager.LoadDataSet(ds);
            }
        }
        catch (Exception exp)
        {
            throw;
        }
        return ds;
    }
Пример #9
0
    public DataSet updateTransaction_ERROR_ewallet(DateTime transactionDate, string responseCode, string responseDescripton, string txnRef, string ewalletNum, int amount)
    {
        DataSet ds = new DataSet();
        try
        {

            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"Update TransactionLog 
                Set TransactionDate=@tdate ,ResponseCode=@response,ResponseDescription=@rdescription 
                where TransactionNumber=@tnumber;update StudentApplications set status=5 ;

                Insert into eWallet_History(ewalletNumber,Description,Amount,Type,TransasctionRef,UserID,status)
                Values (@1,@2,@3,@4,@5,@6,@7) ;";

                dbManager.Command.Parameters.AddWithValue("@response", responseCode);
                dbManager.Command.Parameters.AddWithValue("@tdate", transactionDate);
                dbManager.Command.Parameters.AddWithValue("@rdescription", responseDescripton);
                dbManager.Command.Parameters.AddWithValue("@tnumber", txnRef);

                dbManager.Command.Parameters.AddWithValue("@1", ewalletNum);
                dbManager.Command.Parameters.AddWithValue("@2", "Deposit Funds into eWallet Account");
                dbManager.Command.Parameters.AddWithValue("@3", amount);
                dbManager.Command.Parameters.AddWithValue("@4", "Debit");
                dbManager.Command.Parameters.AddWithValue("@5", txnRef);
                dbManager.Command.Parameters.AddWithValue("@6", Membership.GetUser().ProviderUserKey.ToString());
                dbManager.Command.Parameters.AddWithValue("@7", 5);


                dbManager.LoadDataSet(ds);
            }
        }
        catch (Exception exp)
        {
            throw;
        }
        return ds;
    }
Пример #10
0
    public string getStudent_CompleteName(string userID)
    {

        string fullName = string.Empty;
        try
        {
            SqlDataReader reader = null;
            string userType = string.Empty;
            DataSet ds = new DataSet();
            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"SELECT  Fullname from user_otherinfo where [userID]=@userID";
                dbManager.Command.Parameters.AddWithValue("@userID", userID);

                reader = dbManager.GetDataReader();
                if (reader.Read() == true)
                {
                    fullName = reader.GetValue(0).ToString();
                }


            }

        }
        catch (Exception exp)
        {
            throw;
        }
        return fullName;

    }
Пример #11
0
    public bool updateTransactionStatus_eWallet(string cardnumber, string MerchantRefrence, string PaymentRefrence, string RetrievalRefrence,
 string transactionDate, string responseCode, string responseDescripton, string txnRef, string ewalletNum, int amount)
    {
        bool flag = false;
        try
        {

            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"Update TransactionLog 
                Set CardNumber=@cardnumber,MerchantRefrence=@mr,PaymentRefrence=@pr,RetrievalReferenceNumber=@rf,
                TransactionDate=@tdate,ResponseCode=@response,ResponseDescription=@rdescription 
                where TransactionNumber=@tnumber ;
                Insert into eWallet_History(ewalletNumber,Description,Amount,Type,TransasctionRef,portal,status)
                Values (@1,@2,@3,@4,@5,@6,@7) ;

               UPDATE Ewallet SET CurrentBalance = CurrentBalance + @3 WHERE Enumber = @1";

                dbManager.Command.Parameters.AddWithValue("@cardnumber", cardnumber);
                dbManager.Command.Parameters.AddWithValue("@mr", MerchantRefrence);
                dbManager.Command.Parameters.AddWithValue("@pr", PaymentRefrence);
                dbManager.Command.Parameters.AddWithValue("@rf", RetrievalRefrence);
                dbManager.Command.Parameters.AddWithValue("@tdate", transactionDate);
                dbManager.Command.Parameters.AddWithValue("@response", responseCode);
                dbManager.Command.Parameters.AddWithValue("@rdescription", responseDescripton);
                dbManager.Command.Parameters.AddWithValue("@tnumber", txnRef);
                dbManager.Command.Parameters.AddWithValue("@1", ewalletNum);
                dbManager.Command.Parameters.AddWithValue("@2", "Deposit Funds into eWallet Account");
                dbManager.Command.Parameters.AddWithValue("@3", amount);
                dbManager.Command.Parameters.AddWithValue("@4", "Debit");
                dbManager.Command.Parameters.AddWithValue("@5", txnRef);
                dbManager.Command.Parameters.AddWithValue("@6", Membership.GetUser().ProviderUserKey.ToString());
                dbManager.Command.Parameters.AddWithValue("@7", 1);




                dbManager.Command.ExecuteNonQuery();
                flag = true;
            }
        }
        catch (Exception exp)
        {
            flag = false;
        }

        return flag;
    }
Пример #12
0
    public DataSet getAlluserRelatedInfo(string userID)
    {
        DataSet ds = new DataSet();
        try
        {

            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"select *,(Select State from Application_States at Where at.ID=sb.state ) as stateNew,
            (Select area from Application_Areas ar Where ar.ID=sb.LocalGovtArea ) as govtNew,
               (Select InstitutionName from Application_JambInstitutions aji 
                Where aji.ID=spr.InstitutionAttented  ) as  InstitutionNew
from Students_BioData sb
join dbo.Students_PreviousRecord spr on sb.UserID=spr.userID
join dbo.Students_CbtScheduleInfo cbt  on sb.UserID=cbt.userID

where sb.UserID=@uID
";
                dbManager.Command.Parameters.AddWithValue("@uID", userID);

                dbManager.LoadDataSet(ds);
            }
        }
        catch (Exception exp)
        {
            throw;
        }
        return ds;



    }
Пример #13
0
    public int countApplications()
    {
        int countProduct = -1;
        DataSet ds = new DataSet();
        try
        {
            SqlDataReader reader = null;
            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"select count(id) from  StudentApplications where formfilled=1 and AdmissionGranted=0";


                //reader = dbManager.GetDataReader();
                // dbManager.LoadDataSet(ds);
                countProduct = dbManager.getScopeIdentity();
            }


        }
        catch (Exception exp)
        {

        }
        return countProduct;

    }
Пример #14
0
    public DataSet loadCbtScheduleUserID(string userID)
    {
        DataSet ds = new DataSet();
        try
        {

            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"SELECT *,(Select top 1 ID from CBT_Schedules cs 
where cs.ScheduleDate=si.ScheduleDate and cs.scheduleTime=si.ScheduleTime) as timeID from Students_CbtScheduleInfo si where userID=@uID";

                dbManager.Command.Parameters.AddWithValue("@uID", userID);

                dbManager.LoadDataSet(ds);
            }
        }
        catch (Exception exp)
        {
            throw;
        }
        return ds;
    }
Пример #15
0
    public DataSet loadPreviousAcademicRecordByUserID(string userID)
    {
        DataSet ds = new DataSet();
        try
        {

            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"SELECT * from Students_PreviousRecord where userID=@uID";

                dbManager.Command.Parameters.AddWithValue("@uID", userID);
                dbManager.LoadDataSet(ds);
            }
        }
        catch (Exception exp)
        {
            throw;
        }
        return ds;
    }
Пример #16
0
    public DataSet loadOlevelDataUserID_fs2(string userID)
    {
        DataSet ds = new DataSet();
        try
        {

            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"SELECT * from Student_OlevelInfo_SecondSitting where userID=@uID";

                dbManager.Command.Parameters.AddWithValue("@uID", userID);
                dbManager.LoadDataSet(ds);
            }
        }
        catch (Exception exp)
        {
            throw;
        }
        return ds;
    }
Пример #17
0
    public int getTransactionTable_Amount_New(string transactionNumber)
    {

        int flag = -1;
        try
        {
            SqlDataReader reader = null;
            string userType = string.Empty;
            DataSet ds = new DataSet();
            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"SELECT  Amount from TransactionLog Where TransactionNumber=@trnumber;
                delete from transactionLog where TransactionNumber=@trnumber ";
                dbManager.Command.Parameters.AddWithValue("@trnumber", transactionNumber);

                reader = dbManager.GetDataReader();
                if (reader.Read() == true)
                {
                    flag = Convert.ToInt32(reader.GetValue(0).ToString());
                }


            }

        }
        catch (Exception exp)
        {
            throw;
        }
        return flag;

    }
Пример #18
0
    public void updateeWalletBalance(int amount, string userID)
    {
        using (DM dbManager = new DM())
        {
            dbManager.Command.CommandText = @"
               UPDATE Ewallet SET CurrentBalance = CurrentBalance - @3 WHERE enumber = @6;";

            dbManager.Command.Parameters.AddWithValue("@3", amount);
            dbManager.Command.Parameters.AddWithValue("@6", userID);
            dbManager.Command.ExecuteNonQuery();
        }
    }
Пример #19
0
    public bool updateTransactionStatus_resetForm(string cardnumber, string MerchantRefrence, string PaymentRefrence, string RetrievalRefrence,
 string transactionDate, string responseCode, string responseDescripton, string txnRef, string applicationID)
    {
        bool flag = false;
        try
        {

            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"Update TransactionLog 
                Set CardNumber=@cardnumber,MerchantRefrence=@mr,PaymentRefrence=@pr,RetrievalReferenceNumber=@rf,
                TransactionDate=@tdate,ResponseCode=@response,ResponseDescription=@rdescription 
                where TransactionNumber=@tnumber ;
                update StudentApplications set formfilled=0  where ID=@applicationID ;";

                dbManager.Command.Parameters.AddWithValue("@cardnumber", cardnumber);
                dbManager.Command.Parameters.AddWithValue("@mr", MerchantRefrence);
                dbManager.Command.Parameters.AddWithValue("@pr", PaymentRefrence);
                dbManager.Command.Parameters.AddWithValue("@rf", RetrievalRefrence);
                dbManager.Command.Parameters.AddWithValue("@tdate", transactionDate);
                dbManager.Command.Parameters.AddWithValue("@response", responseCode);
                dbManager.Command.Parameters.AddWithValue("@rdescription", responseDescripton);
                dbManager.Command.Parameters.AddWithValue("@tnumber", txnRef);
                dbManager.Command.Parameters.AddWithValue("@applicationID", applicationID);

                dbManager.Command.ExecuteNonQuery();
                flag = true;
            }
        }
        catch (Exception exp)
        {
            flag = false;
        }

        return flag;
    }
Пример #20
0
    public void transferFunds_WalletBalance(int amount, string userID, string receiverUser, string sendereWallet, string desc, string txref,string portal)
    {
        receiverUser = utilities.Encrypt(receiverUser);
        sendereWallet = utilities.Encrypt(sendereWallet);


        using (DM dbManager = new DM())
        {
            try
            {
                dbManager.Command.CommandText = @"begin tran
            UPDATE Ewallet SET CurrentBalance = CurrentBalance + @1 WHERE Enumber = @3;
            UPDATE Ewallet SET CurrentBalance = CurrentBalance - @1 WHERE Enumber = @4; 
            Insert into eWallet_History(ewalletNumber,Description,Amount,FeeType,Status,TransasctionRef,Datetime,portal)
            Values(@4,@5,@1,@6,@7,@8,@9,@10)
            commit;";

                dbManager.Command.Parameters.AddWithValue("@1", amount);

                dbManager.Command.Parameters.AddWithValue("@3", receiverUser);

                dbManager.Command.Parameters.AddWithValue("@4", sendereWallet);
                dbManager.Command.Parameters.AddWithValue("@5", desc);
                dbManager.Command.Parameters.AddWithValue("@6", "Funds Transfer");
                dbManager.Command.Parameters.AddWithValue("@7", 1);
                dbManager.Command.Parameters.AddWithValue("@8", txref);
                dbManager.Command.Parameters.AddWithValue("@9", DateTime.Now.ToString("yyyy-MM-dd"));
                dbManager.Command.Parameters.AddWithValue("@10", portal);
                dbManager.Command.ExecuteNonQuery();
            }
            catch(Exception e){

            }
        }
    }
Пример #21
0
    public int getAttempts(string userID)
    {

        int attempts = 0;
        try
        {
            SqlDataReader reader = null;
            string userType = string.Empty;
            DataSet ds = new DataSet();
            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"SELECT  FailedPasswordAttemptCount from Memberships where [userID]=@userID";
                dbManager.Command.Parameters.AddWithValue("@userID", userID);

                reader = dbManager.GetDataReader();
                if (reader.Read() == true)
                {
                    attempts = Convert.ToInt16(reader.GetValue(0).ToString());
                }


            }

        }
        catch (Exception exp)
        {
            throw;
        }
        return attempts;

    }
Пример #22
0
    public void updateApplicationPaymentStatus(int applicationID, string txnref, string query, int flag)
    {
        int mewID = 0;

        try
        {
            using (DM dbManager = new DM())
            {



                dbManager.Command.CommandText = query;
                if (flag == 0)
                {
                    dbManager.Command.Parameters.AddWithValue("@ID", applicationID);
                }
                else if (flag == 1)
                {
                    dbManager.Command.Parameters.AddWithValue("@tnumber", txnref);
                }


                dbManager.Command.ExecuteNonQuery();


            }


        }
        catch (Exception exp)
        {
            throw;
        }



    }
Пример #23
0
    public void Update_eWallet_Status_Balance(string trnum, string userID, int amount)
    {
        string a = trnum;
        String status = utilities.Encrypt("0");
        try
        {
            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"BEGIN tran
               UPDATE eWalletPaymentdeposit_application SET Status = 1 WHERE TransactionNo = @1; 
               update Ewallet set CurrentBalance= CurrentBalance + @amount  Where Enumber=@userID;
               update eWallet_history set status=1 where TransasctionRef=@2
              commit";

               dbManager.Command.Parameters.AddWithValue("@2",a);
                dbManager.Command.Parameters.AddWithValue("@1", utilities.Encrypt(trnum));
                dbManager.Command.Parameters.AddWithValue("@amount", amount.ToString());
                dbManager.Command.Parameters.AddWithValue("@userID", utilities.Encrypt(userID));
                dbManager.Command.ExecuteNonQuery();


            }
        }
        catch (Exception ex)
        { }
    }
Пример #24
0
    public int insertTransactionNumber(string txnref, string amount, string userID, string paymentMethod, string paymentType,string portal,string enumber)
    {
        int id = -1;
        try
        {

            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"Insert into TransactionLog_eWallet(TransactionNumber,Amount,UserID,PaidUsing,feetype,TransactionDate,portal,eWalletnum) Values (@trnumber,@amount,@studentID,@PaidUsing,@feetype,@trdate,@portal,@enumber) ; SELECT SCOPE_IDENTITY() ;";

                dbManager.Command.Parameters.AddWithValue("@trnumber", txnref);
                dbManager.Command.Parameters.AddWithValue("@amount", amount);
                dbManager.Command.Parameters.AddWithValue("@studentID", userID);
                dbManager.Command.Parameters.AddWithValue("@PaidUsing", paymentMethod);
                dbManager.Command.Parameters.AddWithValue("@feetype", paymentType);
                dbManager.Command.Parameters.AddWithValue("@trdate",DateTime.Now.ToString("yyyy-MM-dd"));
                dbManager.Command.Parameters.AddWithValue("@portal", portal);
                dbManager.Command.Parameters.AddWithValue("@enumber", enumber);


                id = Convert.ToInt32(dbManager.Command.ExecuteScalar());
            }
        }
        catch (Exception exp)
        {
            throw;
        }

        return id;
    }
Пример #25
0
    public DataSet updateTransaction_ERROR(DateTime transactionDate, string responseCode, string responseDescripton, string txnRef)
    {
        DataSet ds = new DataSet();
        try
        {

            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"Update TransactionLog 
                Set TransactionDate=@tdate ,ResponseCode=@response,ResponseDescription=@rdescription 
                where TransactionNumber=@tnumber;update StudentApplications set status=5 ";

                dbManager.Command.Parameters.AddWithValue("@response", responseCode);
                dbManager.Command.Parameters.AddWithValue("@tdate", transactionDate);
                dbManager.Command.Parameters.AddWithValue("@rdescription", responseDescripton);
                dbManager.Command.Parameters.AddWithValue("@tnumber", txnRef);

                dbManager.LoadDataSet(ds);
            }
        }
        catch (Exception exp)
        {
            throw;
        }
        return ds;
    }
Пример #26
0
    public int insertTransactionNumber_eW(string txnref, string amount, string userID, string paymentMethod, string paymentType)
    {
        int id = -1;
        try
        {

            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"Insert into TransactionLog(TransactionNumber,Amount,studentID,PaidUsing,transactiondate,feetype) Values (@trnumber,@amount,@studentID,@PaidUsing,@date,@ptype) ; SELECT SCOPE_IDENTITY() ;";

                dbManager.Command.Parameters.AddWithValue("@trnumber", txnref);
                dbManager.Command.Parameters.AddWithValue("@amount", amount);
                dbManager.Command.Parameters.AddWithValue("@studentID", userID);
                dbManager.Command.Parameters.AddWithValue("@PaidUsing", paymentMethod);
                dbManager.Command.Parameters.AddWithValue("@date", DateTime.Now.ToShortDateString());
                dbManager.Command.Parameters.AddWithValue("@ptype", paymentType);

                id = Convert.ToInt32(dbManager.Command.ExecuteScalar());
            }
        }
        catch (Exception exp)
        {
            throw;
        }

        return id;
    }
Пример #27
0
    public int insertUserOtherInfo(string Fullname, string Phonenumber, string userID)
    {
        int id = -1;
        try
        {

            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"Insert into User_OtherInfo(FullName,PhoneNum,UserID) Values (@fname,@phone,@userID) ; SELECT SCOPE_IDENTITY() ;";

                dbManager.Command.Parameters.AddWithValue("@fname", Fullname);
                dbManager.Command.Parameters.AddWithValue("@phone", Phonenumber);
                dbManager.Command.Parameters.AddWithValue("@userID", userID);


                id = Convert.ToInt32(dbManager.Command.ExecuteScalar());

            }
        }
        catch (Exception exp)
        {
            throw;
        }

        return id;
    }
Пример #28
0
    public int insertTransactionNumber_eWallet(string txnref, string amount, string enumber, string userID)
    {
        int id = -1;
        try
        {

            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"Insert into TransactionLog_eWallet(TransactionNumber,Amount,eWalletnum,userID) Values (@trnumber,@amount,@eWalletnum,@userID) ; SELECT SCOPE_IDENTITY() ;";

                dbManager.Command.Parameters.AddWithValue("@trnumber", txnref);
                dbManager.Command.Parameters.AddWithValue("@amount", amount);
                dbManager.Command.Parameters.AddWithValue("@eWalletnum", enumber);
                dbManager.Command.Parameters.AddWithValue("@userID", userID);

                id = Convert.ToInt32(dbManager.Command.ExecuteScalar());
            }
        }
        catch (Exception exp)
        {
            throw;
        }

        return id;
    }
Пример #29
0
    public int inserteWalletTranscationrow(string ewalletnumber, string description, string Amount, string tType, string transcationnum
        , string Portal)
    {
        int id = -1;
        try
        {

            using (DM dbManager = new DM())
            {
                string dt = DateTime.Now.ToString("yyyy-MM-dd");
                dbManager.Command.CommandText = @"INSERT INTO [eWallet_History]
           ([ewalletNumber]
           ,[Description]
           ,[Amount]
           ,[FeeType]
           ,[TransasctionRef]
           ,[portal]
           ,[Status]
           ,[Datetime]) Values (@1,@2,@3,@4,@5,@6,@7,@8) ; SELECT SCOPE_IDENTITY() ;";

                dbManager.Command.Parameters.AddWithValue("@1", ewalletnumber);
                dbManager.Command.Parameters.AddWithValue("@2", description);
                dbManager.Command.Parameters.AddWithValue("@3", Amount);
                dbManager.Command.Parameters.AddWithValue("@4", tType);
                dbManager.Command.Parameters.AddWithValue("@5", transcationnum);
                dbManager.Command.Parameters.AddWithValue("@6", Portal);
                dbManager.Command.Parameters.AddWithValue("@7", 0);
                dbManager.Command.Parameters.AddWithValue("@8", dt);
                id = Convert.ToInt32(dbManager.Command.ExecuteScalar());

            }
        }
        catch (Exception exp)
        {
            throw;
        }

        return id;
    }
Пример #30
0
    public int createeWalletAccount(string userid,string enumber, string pin, string name, string address, string portal)
    {
        int id = -1;
        try
        {

            using (DM dbManager = new DM())
            {
                dbManager.Command.CommandText = @"Insert into [Ewallet](
           [Enumber]
           ,[Pin]
           ,[Name]
           ,[Address]
           ,[Portal]
           ,[Datecreated],[Status],[CurrentBalance],[UserId]
) Values (@1,@2,@3,@4,@5,@6,@7,@8,@9) ; SELECT SCOPE_IDENTITY() ;";
                string date = DateTime.Now.Date.ToString("yyyy-MM-d") ;
                SqlParameter param1 = new SqlParameter("@1", enumber);
                
                SqlParameter param2= new SqlParameter("@2", pin);
                SqlParameter param3 = new SqlParameter("@3", name);
                SqlParameter param4 = new SqlParameter("@4", address);
                SqlParameter param5= new SqlParameter("@5", portal);
                SqlParameter param6 = new SqlParameter("@6",date);
                SqlParameter param7 = new SqlParameter("@7", "1");
                SqlParameter param8 = new SqlParameter("@8", "0");
                SqlParameter param9 = new SqlParameter("@9", userid);

                dbManager.Command.Parameters.Add(param1);
                dbManager.Command.Parameters.Add(param2);
                dbManager.Command.Parameters.Add(param3);
                dbManager.Command.Parameters.Add(param4);
                dbManager.Command.Parameters.Add(param5);
                dbManager.Command.Parameters.Add(param6);
                dbManager.Command.Parameters.Add(param7);
                dbManager.Command.Parameters.Add(param8);
                dbManager.Command.Parameters.Add(param9);
                //dbManager.Command.Parameters.AddWithValue("@2", pin);
                //dbManager.Command.Parameters.AddWithValue("@3", name);
                //dbManager.Command.Parameters.AddWithValue("@4", address);
                //dbManager.Command.Parameters.AddWithValue("@5", portal);

                id = Convert.ToInt32(dbManager.Command.ExecuteScalar());
            }
        }
        catch (Exception exp)
        {

        }

        return id;
    }