Ejemplo n.º 1
0
        public bool Insert(ContactCreditCardInfoDetails Details)
        {
            try
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = "CALL procContactCreditModify(@CustomerID, @GuarantorID, @CreditCardTypeID, @CreditCardNo, @CreditAwardDate, @CreditCardStatus, @ExpiryDate, @CreditActive, @CreditLimit);";

                cmd.Parameters.AddWithValue("@CustomerID", Details.CustomerID);
                cmd.Parameters.AddWithValue("@GuarantorID", Details.GuarantorID);
                cmd.Parameters.AddWithValue("@CreditCardTypeID", Convert.ToInt16(Details.CardTypeDetails.CardTypeID));
                cmd.Parameters.AddWithValue("@CreditCardNo", Details.CreditCardNo);
                cmd.Parameters.AddWithValue("@CreditAwardDate", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                cmd.Parameters.AddWithValue("@CreditCardStatus", Details.CreditCardStatus.ToString("d"));
                cmd.Parameters.AddWithValue("@ExpiryDate", Details.ExpiryDate.ToString("yyyy-MM-dd"));
                cmd.Parameters.AddWithValue("@CreditActive", Convert.ToInt16(Details.CreditActive));
                cmd.Parameters.AddWithValue("@CreditLimit", Details.CreditLimit);

                cmd.CommandText = SQL;
                bool bolRetValue = false;
                if (base.ExecuteNonQuery(cmd) > 0)
                {
                    bolRetValue = true;
                }
                return(bolRetValue);
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Ejemplo n.º 2
0
		public bool Insert(ContactCreditCardInfoDetails Details)
		{
			try  
			{
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = "CALL procContactCreditModify(@CustomerID, @GuarantorID, @CreditCardTypeID, @CreditCardNo, @CreditAwardDate, @CreditCardStatus, @ExpiryDate, @CreditActive, @CreditLimit);";

                cmd.Parameters.AddWithValue("@CustomerID", Details.CustomerID);
                cmd.Parameters.AddWithValue("@GuarantorID", Details.GuarantorID);
                cmd.Parameters.AddWithValue("@CreditCardTypeID", Convert.ToInt16(Details.CardTypeDetails.CardTypeID));
                cmd.Parameters.AddWithValue("@CreditCardNo", Details.CreditCardNo);
                cmd.Parameters.AddWithValue("@CreditAwardDate", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                cmd.Parameters.AddWithValue("@CreditCardStatus", Details.CreditCardStatus.ToString("d"));
                cmd.Parameters.AddWithValue("@ExpiryDate", Details.ExpiryDate.ToString("yyyy-MM-dd"));
                cmd.Parameters.AddWithValue("@CreditActive", Convert.ToInt16(Details.CreditActive));
                cmd.Parameters.AddWithValue("@CreditLimit", Details.CreditLimit);

                cmd.CommandText = SQL;
				bool bolRetValue = false;
                if (base.ExecuteNonQuery(cmd) > 0) bolRetValue = true;
                return bolRetValue;
			}
			catch (Exception ex)
			{
				throw base.ThrowException(ex);
			}	
		}
Ejemplo n.º 3
0
        public Int32 Save(ContactCreditCardInfoDetails Details)
        {
            try
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = "CALL procSaveContactCreditCardInfo(@CustomerID, @GuarantorID, @CreditCardTypeID, @CreditCardNo, @CreditAwardDate, " +
                             "@TotalPurchases, @CreditPaid, @CreditCardStatus, @ExpiryDate, @EmbossedCardNo, " +
                             "@LastBillingDate, @Last2BillingDate, @CreatedOn, @LastModified);";

                cmd.Parameters.AddWithValue("CustomerID", Details.CustomerID);
                cmd.Parameters.AddWithValue("GuarantorID", Details.GuarantorID);
                cmd.Parameters.AddWithValue("CreditCardTypeID", Details.CardTypeDetails.CardTypeID);
                cmd.Parameters.AddWithValue("CreditCardNo", Details.CreditCardNo);
                cmd.Parameters.AddWithValue("CreditAwardDate", Details.CreditAwardDate);
                cmd.Parameters.AddWithValue("TotalPurchases", Details.TotalPurchases);
                cmd.Parameters.AddWithValue("CreditPaid", Details.CreditPaid);
                cmd.Parameters.AddWithValue("CreditCardStatus", Details.CreditCardStatus.ToString("d"));
                cmd.Parameters.AddWithValue("ExpiryDate", Details.ExpiryDate);
                cmd.Parameters.AddWithValue("EmbossedCardNo", Details.CreditCardNo);
                cmd.Parameters.AddWithValue("LastBillingDate", Details.LastBillingDate);
                cmd.Parameters.AddWithValue("Last2BillingDate", Details.Last2BillingDate);
                cmd.Parameters.AddWithValue("CreatedOn", Details.CreatedOn == DateTime.MinValue ? Constants.C_DATE_MIN_VALUE : Details.CreatedOn);
                cmd.Parameters.AddWithValue("LastModified", Details.LastModified == DateTime.MinValue ? Constants.C_DATE_MIN_VALUE : Details.LastModified);

                cmd.CommandText = SQL;
                return(base.ExecuteNonQuery(cmd));
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Ejemplo n.º 4
0
 public bool Update(ContactCreditCardInfoDetails Details)
 {
     try
     {
         return(Insert(Details));
     }
     catch (Exception ex)
     {
         throw base.ThrowException(ex);
     }
 }
Ejemplo n.º 5
0
        private ContactCreditCardInfoDetails setDetails(System.Data.DataTable dt)
        {
            ContactCreditCardInfoDetails Details = new ContactCreditCardInfoDetails();

            foreach (System.Data.DataRow dr in dt.Rows)
            {
                Details.CustomerID       = Int64.Parse(dr["CustomerID"].ToString());
                Details.GuarantorID      = Int64.Parse(dr["GuarantorID"].ToString());
                Details.CardTypeDetails  = new CardType(base.Connection, base.Transaction).Details(Int16.Parse(dr["CreditCardTypeID"].ToString()));
                Details.CreditCardNo     = "" + dr["CreditCardNo"].ToString();
                Details.CreditAwardDate  = DateTime.Parse(dr["CreditAwardDate"].ToString());
                Details.TotalPurchases   = decimal.Parse(dr["TotalPurchases"].ToString());
                Details.CreditPaid       = decimal.Parse(dr["CreditPaid"].ToString());
                Details.CreditCardStatus = (CreditCardStatus)Enum.Parse(typeof(CreditCardStatus), dr["CreditCardStatus"].ToString());
                Details.EmbossedCardNo   = "" + dr["EmbossedCardNo"].ToString();
                Details.ExpiryDate       = DateTime.Parse(dr["ExpiryDate"].ToString());
                Details.LastBillingDate  = DateTime.Parse(dr["LastBillingDate"].ToString());
                Details.Last2BillingDate = DateTime.Parse(dr["Last2BillingDate"].ToString());
                Details.CreatedOn        = DateTime.Parse(dr["CreatedOn"].ToString());
                Details.LastModified     = DateTime.Parse(dr["LastModified"].ToString());
            }

            return(Details);
        }
Ejemplo n.º 6
0
		public bool Update(ContactCreditCardInfoDetails Details)
		{
			try 
			{
                return Insert(Details);
			}
			catch (Exception ex)
			{
				throw base.ThrowException(ex);
			}	
		}
Ejemplo n.º 7
0
        private ContactCreditCardInfoDetails setDetails(System.Data.DataTable dt)
        {
            ContactCreditCardInfoDetails Details = new ContactCreditCardInfoDetails();
            foreach (System.Data.DataRow dr in dt.Rows)
            {
                Details.CustomerID = Int64.Parse(dr["CustomerID"].ToString());
                Details.GuarantorID = Int64.Parse(dr["GuarantorID"].ToString());
                Details.CardTypeDetails = new CardType(base.Connection, base.Transaction).Details(Int16.Parse(dr["CreditCardTypeID"].ToString()));
                Details.CreditCardNo = "" + dr["CreditCardNo"].ToString();
                Details.CreditAwardDate = DateTime.Parse(dr["CreditAwardDate"].ToString());
                Details.TotalPurchases = decimal.Parse(dr["TotalPurchases"].ToString());
                Details.CreditPaid = decimal.Parse(dr["CreditPaid"].ToString());
                Details.CreditCardStatus = (CreditCardStatus)Enum.Parse(typeof(CreditCardStatus), dr["CreditCardStatus"].ToString());
                Details.EmbossedCardNo = "" + dr["EmbossedCardNo"].ToString();
                Details.ExpiryDate = DateTime.Parse(dr["ExpiryDate"].ToString());
                Details.LastBillingDate = DateTime.Parse(dr["LastBillingDate"].ToString());
                Details.Last2BillingDate = DateTime.Parse(dr["Last2BillingDate"].ToString());
                Details.CreatedOn = DateTime.Parse(dr["CreatedOn"].ToString());
                Details.LastModified = DateTime.Parse(dr["LastModified"].ToString());
            }

            return Details;
        }
Ejemplo n.º 8
0
        public Int32 Save(ContactCreditCardInfoDetails Details)
        {
            try
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = "CALL procSaveContactCreditCardInfo(@CustomerID, @GuarantorID, @CreditCardTypeID, @CreditCardNo, @CreditAwardDate, " +
                                                    "@TotalPurchases, @CreditPaid, @CreditCardStatus, @ExpiryDate, @EmbossedCardNo, " +
                                                    "@LastBillingDate, @Last2BillingDate, @CreatedOn, @LastModified);";
                
                cmd.Parameters.AddWithValue("CustomerID", Details.CustomerID);
                cmd.Parameters.AddWithValue("GuarantorID", Details.GuarantorID);
                cmd.Parameters.AddWithValue("CreditCardTypeID", Details.CardTypeDetails.CardTypeID);
                cmd.Parameters.AddWithValue("CreditCardNo", Details.CreditCardNo);
                cmd.Parameters.AddWithValue("CreditAwardDate", Details.CreditAwardDate);
                cmd.Parameters.AddWithValue("TotalPurchases", Details.TotalPurchases);
                cmd.Parameters.AddWithValue("CreditPaid", Details.CreditPaid);
                cmd.Parameters.AddWithValue("CreditCardStatus", Details.CreditCardStatus.ToString("d"));
                cmd.Parameters.AddWithValue("ExpiryDate", Details.ExpiryDate);
                cmd.Parameters.AddWithValue("EmbossedCardNo", Details.CreditCardNo);
                cmd.Parameters.AddWithValue("LastBillingDate", Details.LastBillingDate);
                cmd.Parameters.AddWithValue("Last2BillingDate", Details.Last2BillingDate);
                cmd.Parameters.AddWithValue("CreatedOn", Details.CreatedOn == DateTime.MinValue ? Constants.C_DATE_MIN_VALUE : Details.CreatedOn);
                cmd.Parameters.AddWithValue("LastModified", Details.LastModified == DateTime.MinValue ? Constants.C_DATE_MIN_VALUE : Details.LastModified);

                cmd.CommandText = SQL;
                return base.ExecuteNonQuery(cmd);
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }