Exemplo n.º 1
0
        public static List <StoreBankingDetail> GetReportClaimBankingMMS(string claimMonth, int companyId, int locationId, int claimSupplierId, int claimTypeId)
        {
            List <StoreBankingDetail> list = new List <StoreBankingDetail>();

            Database  db         = DatabaseFactory.CreateDatabase("Spar-StoreRep");
            string    sqlCommand = "GetReportClaimBankingMMS";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "@ClaimMonth", DbType.String, claimMonth);
            db.AddInParameter(dbCommand, "@CompanyId", DbType.Int32, companyId);
            db.AddInParameter(dbCommand, "@LocationId", DbType.Int32, locationId);
            db.AddInParameter(dbCommand, "@ClaimSupplierId", DbType.Int32, claimSupplierId);
            db.AddInParameter(dbCommand, "@ClaimTypeId", DbType.Int32, claimTypeId);

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    StoreBankingDetail storeBankingDetail = new StoreBankingDetail();
                    storeBankingDetail.StoreName          = dataReader["StoreName"].ToString();
                    storeBankingDetail.AccountNumber      = dataReader["AccountNumber"].ToString();
                    storeBankingDetail.AccountType        = dataReader["AccountType"].ToString();
                    storeBankingDetail.BranchNumber       = dataReader["BranchNumber"].ToString();
                    storeBankingDetail.OwnReference       = dataReader["OwnReference"].ToString();
                    storeBankingDetail.RecipientReference = dataReader["RecipientReference"].ToString();
                    storeBankingDetail.EmailNotify1       = dataReader["EmailNotify1"].ToString();
                    storeBankingDetail.EmailAddress1      = dataReader["EmailAddress1"].ToString();
                    storeBankingDetail.EmailSubject1      = dataReader["EmailSubject1"].ToString();
                    storeBankingDetail.Amount             = Convert.ToDecimal(dataReader["Amount"]);
                    list.Add(storeBankingDetail);
                }
            }
            return(list);
        }
Exemplo n.º 2
0
        public static StoreBankingDetail GetStoreBankingDetailByStoreBankingDetailId(int storeBankingDetailId)
        {
            Database  db         = DatabaseFactory.CreateDatabase("Spar-StoreRep");
            string    sqlCommand = "GetStoreBankingDetailByStoreBankingDetailId";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "@StoreBankingDetailId", DbType.Int32, storeBankingDetailId);
            db.AddOutParameter(dbCommand, "@StoreId", DbType.Int32, 4);
            db.AddOutParameter(dbCommand, "@BranchNumber", DbType.Int32, 4);
            db.AddOutParameter(dbCommand, "@AccountNumber", DbType.Int64, 4);
            db.AddOutParameter(dbCommand, "@CompanyId", DbType.Int32, 4);
            db.AddOutParameter(dbCommand, "@StoreBankAccountTypeId", DbType.Int32, 4);
            db.AddOutParameter(dbCommand, "@EmailNotify1", DbType.String, 50);
            db.AddOutParameter(dbCommand, "@EmailAddress1", DbType.String, 50);
            db.ExecuteNonQuery(dbCommand);
            StoreBankingDetail storeBankingDetail = new StoreBankingDetail();

            storeBankingDetail.StoreBankingDetailId = storeBankingDetailId;
            storeBankingDetail.StoreId                = Convert.ToInt32(db.GetParameterValue(dbCommand, "StoreId"));
            storeBankingDetail.BranchNumber           = db.GetParameterValue(dbCommand, "BranchNumber").ToString();
            storeBankingDetail.AccountNumber          = db.GetParameterValue(dbCommand, "AccountNumber").ToString();
            storeBankingDetail.CompanyId              = Convert.ToInt32(db.GetParameterValue(dbCommand, "CompanyId"));
            storeBankingDetail.StoreBankAccountTypeId = Convert.ToInt32(db.GetParameterValue(dbCommand, "StoreBankAccountTypeId"));
            storeBankingDetail.EmailNotify1           = db.GetParameterValue(dbCommand, "EmailNotify1").ToString();
            storeBankingDetail.EmailAddress1          = db.GetParameterValue(dbCommand, "EmailAddress1").ToString();
            return(storeBankingDetail);
        }