Beispiel #1
0
        public static ARCustomerWLTran UpdateItem(ARCustomerWLTran model)
        {
            String result = String.Empty;

            using (var reader = SqlHelper.ExecuteReader(CommandType.StoredProcedure, "ARCustomerWLTran_Update", CreateSqlParameter(model)))
            {
                while (reader.Read())
                {
                    result = (String)reader[0];
                }
            }
            return(GetItemByID(model.TranID, model.CompanyID));
        }
Beispiel #2
0
        public static ARCustomerWLTranCollection Search(SearchFilter SearchKey)
        {
            ARCustomerWLTranCollection collection = new ARCustomerWLTranCollection();

            using (var reader = SqlHelper.ExecuteReader("ARCustomerWLTran_Search", SearchFilterManager.SqlSearchDynParam(SearchKey)))
            {
                while (reader.Read())
                {
                    ARCustomerWLTran obj = new ARCustomerWLTran();
                    obj = GetItemFromReader(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }
Beispiel #3
0
        private static ARCustomerWLTran GetItemFromReader(IDataReader dataReader)
        {
            ARCustomerWLTran objItem = new ARCustomerWLTran();

            objItem.CompanyID = SqlHelper.GetInt(dataReader, "CompanyID");

            objItem.TranID = SqlHelper.GetInt64(dataReader, "TranID");

            objItem.CustomerID = SqlHelper.GetString(dataReader, "CustomerID");

            objItem.ProviderID = SqlHelper.GetInt(dataReader, "ProviderID");

            objItem.CuryWinlossAmt = SqlHelper.GetDecimal(dataReader, "CuryWinlossAmt");

            objItem.WinlossAmt = SqlHelper.GetDecimal(dataReader, "WinlossAmt");

            objItem.CuryPaymentAmt = SqlHelper.GetDecimal(dataReader, "CuryPaymentAmt");

            objItem.PaymentAmt = SqlHelper.GetDecimal(dataReader, "PaymentAmt");

            objItem.TranDate = SqlHelper.GetDateTime(dataReader, "TranDate");

            objItem.Rate = SqlHelper.GetDecimal(dataReader, "Rate");

            objItem.CreatedUser = SqlHelper.GetString(dataReader, "CreatedUser");

            objItem.CreatedDate = SqlHelper.GetDateTime(dataReader, "CreatedDate");

            objItem.LastModifiedUser = SqlHelper.GetString(dataReader, "LastModifiedUser");

            objItem.LastModifiedDate = SqlHelper.GetDateTime(dataReader, "LastModifiedDate");

            objItem.SettleAmount = SqlHelper.GetDecimal(dataReader, "SettleAmount");

            objItem.IsPayment = SqlHelper.GetBoolean(dataReader, "IsPayment");

            if (SqlHelper.ColumnExists(dataReader, "CuryRateID"))
            {
                objItem.CuryRateID = SqlHelper.GetInt(dataReader, "CuryRateID");
            }

            if (SqlHelper.ColumnExists(dataReader, "TotalRecord"))
            {
                objItem.TotalRecord = SqlHelper.GetInt(dataReader, "TotalRecord");
            }

            return(objItem);
        }
Beispiel #4
0
        public static ARCustomerWLTran GetItemByID(Int64 TranID, int CompanyID)
        {
            ARCustomerWLTran item = new ARCustomerWLTran();
            var sqlParams         = new SqlParameter[]
            {
                new SqlParameter("@TranID", TranID),
                new SqlParameter("@CompanyID", CompanyID),
            };

            using (var reader = SqlHelper.ExecuteReader("ARCustomerWLTran_GetByID", sqlParams))
            {
                while (reader.Read())
                {
                    item = GetItemFromReader(reader);
                }
            }
            return(item);
        }
Beispiel #5
0
        public static ARCustomerWLTran AddItem(ARCustomerWLTran model)
        {
            Int64 result = 0;

            try
            {
                using (var reader = SqlHelper.ExecuteReader(CommandType.StoredProcedure, "ARCustomerWLTran_Add", CreateSqlParameter(model)))
                {
                    while (reader.Read())
                    {
                        result = (Int64)reader[0];
                    }
                }
            }
            catch (Exception ObjEx)
            {
            }
            return(GetItemByID(result, model.CompanyID));
        }
Beispiel #6
0
        public static ARCustomerWLTranCollection GetAllItem(int CompanyID)
        {
            ARCustomerWLTranCollection collection = new ARCustomerWLTranCollection();

            var sqlParams = new SqlParameter[]
            {
                new SqlParameter("@CompanyID", CompanyID),
            };

            using (var reader = SqlHelper.ExecuteReader("ARCustomerWLTran_GetAll", sqlParams))
            {
                while (reader.Read())
                {
                    ARCustomerWLTran obj = new ARCustomerWLTran();
                    obj = GetItemFromReader(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }
Beispiel #7
0
 private static SqlParameter[] CreateSqlParameter(ARCustomerWLTran model)
 {
     return(new SqlParameter[]
     {
         new SqlParameter("@CompanyID", model.CompanyID),
         new SqlParameter("@TranID", model.TranID),
         new SqlParameter("@CustomerID", model.CustomerID),
         new SqlParameter("@ProviderID", model.ProviderID),
         new SqlParameter("@CuryWinlossAmt", model.CuryWinlossAmt),
         new SqlParameter("@WinlossAmt", model.WinlossAmt),
         new SqlParameter("@CuryPaymentAmt", model.CuryPaymentAmt),
         new SqlParameter("@PaymentAmt", model.PaymentAmt),
         new SqlParameter("@TranDate", model.TranDate),
         new SqlParameter("@Rate", model.Rate),
         new SqlParameter("@CuryRateID", model.CuryRateID),
         new SqlParameter("@SettleAmount", model.SettleAmount),
         new SqlParameter("@IsPayment", model.IsPayment),
         new SqlParameter("@CreatedUser", model.CreatedUser),
         new SqlParameter("@CreatedDate", model.CreatedDate),
         new SqlParameter("@LastModifiedUser", model.LastModifiedUser),
         new SqlParameter("@LastModifiedDate", model.LastModifiedDate),
     });
 }