コード例 #1
0
ファイル: DALPin.cs プロジェクト: satishkumareff/Diwakar
    public int InsertPinNew(BOPin objPin)
    {
        dCmd             = objDatabaseHelper.Command;
        dCmd.CommandText = "SP_InserPin";
        dCmd.CommandType = CommandType.StoredProcedure;
        try
        {
            objDatabaseHelper.BeginTransaction();

            objDatabaseHelper.AddParameter("@PinAmount", objPin.PinAmount, SqlDbType.Decimal);
            objDatabaseHelper.AddParameter("@CreationDate", objPin.CreationDate, SqlDbType.DateTime);
            objDatabaseHelper.AddParameter("@CreatedBy", objPin.CreatedBy, SqlDbType.NVarChar, 50);
            objDatabaseHelper.AddParameter("@CreatedFor", objPin.CreatedTo, SqlDbType.NVarChar, 50);
            objDatabaseHelper.AddParameter("@TransPassword", objPin.TransectionPassword, SqlDbType.NVarChar, 50);
            objDatabaseHelper.AddParameter("@PinCount", objPin.NumberOfPin, SqlDbType.NVarChar, 50);
            objDatabaseHelper.AddParameter("@OrderId", objPin.OrderId1, SqlDbType.BigInt, 8);
            objDatabaseHelper.AddParameter("@ProductId", objPin.ProductId, SqlDbType.BigInt, 8);
            returnValue = Convert.ToInt32(objDatabaseHelper.ExecuteNonQuery(dCmd.CommandText, dCmd.CommandType, DatabaseHelper.ConnectionState.KeepOpen));
            objDatabaseHelper.CommitTransaction();
        }
        catch
        {
            objDatabaseHelper.RollbackTransaction();
        }

        finally
        {
            if (objDatabaseHelper.Connection.State == System.Data.ConnectionState.Open)
            {
                objDatabaseHelper.Connection.Close();
            }
        }
        return(returnValue);
    }
コード例 #2
0
ファイル: BALPin.cs プロジェクト: satishkumareff/Diwakar
    public BOPin checkPinAvalability(BOPin objPin)
    {
        DALPin objDALPin = new DALPin();

        try
        {
            return(objDALPin.CheckPinAvalability(objPin));
        }
        catch
        {
            throw;
        }
        finally
        {
            objDALPin = null;
        }
    }
コード例 #3
0
ファイル: BALPin.cs プロジェクト: satishkumareff/Diwakar
    public int insertPinNew(BOPin objPin)
    {
        DALPin objDALPin = new DALPin();

        try
        {
            return(objDALPin.InsertPinNew(objPin));
        }
        catch
        {
            throw;
        }
        finally
        {
            objDALPin = null;
        }
    }
コード例 #4
0
ファイル: DALPin.cs プロジェクト: satishkumareff/Diwakar
    public BOPin CheckPinAvalability(BOPin objPin)
    {
        SqlDataReader rdPin = null;

        dCmd             = objDatabaseHelper.Command;
        dCmd.CommandText = "SP_CheckPinValidity";
        dCmd.CommandType = CommandType.StoredProcedure;
        try
        {
            objDatabaseHelper.BeginTransaction();

            objDatabaseHelper.AddParameter("@PinCode", objPin.PinCode, SqlDbType.NVarChar, 50);

            rdPin = objDatabaseHelper.ExecuteReader(dCmd.CommandText, dCmd.CommandType, DatabaseHelper.ConnectionState.KeepOpen);
            if (rdPin.HasRows)
            {
                while (rdPin.Read())
                {
                    objPin.Message = rdPin["PinValidation"].ToString();
                }
                rdPin.Close();
            }
            objDatabaseHelper.CommitTransaction();
        }
        catch
        {
            objDatabaseHelper.RollbackTransaction();
        }
        finally
        {
            if (objDatabaseHelper.Connection.State == System.Data.ConnectionState.Open)
            {
                objDatabaseHelper.Connection.Close();
            }
        }
        return(objPin);
    }