public Int32 Save(CreditPaymentChequeDetails Details) { try { MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; string SQL = "CALL procSaveCreditPaymentCheque(@BranchID, @TerminalNo, @SyncID, @CreditPaymentChequeID, @CreditPaymentID, @CPRefBranchID, @CPRefTerminalNo, @TransactionID, @ChequeNo, @Amount, @ValidityDate, @Remarks, @TransactionNo, @CreatedOn, @LastModified);"; cmd.Parameters.AddWithValue("BranchID", Details.BranchDetails.BranchID); cmd.Parameters.AddWithValue("TerminalNo", Details.TerminalNo); cmd.Parameters.AddWithValue("SyncID", Details.SyncID); cmd.Parameters.AddWithValue("CreditPaymentChequeID", Details.CreditPaymentChequeID); cmd.Parameters.AddWithValue("CreditPaymentID", Details.CreditPaymentID); cmd.Parameters.AddWithValue("CPRefBranchID", Details.CPRefBranchID); cmd.Parameters.AddWithValue("CPRefTerminalNo", Details.CPRefTerminalNo); cmd.Parameters.AddWithValue("TransactionID", Details.TransactionID); cmd.Parameters.AddWithValue("ChequeNo", Details.ChequeNo); cmd.Parameters.AddWithValue("Amount", Details.Amount); cmd.Parameters.AddWithValue("ValidityDate", Details.ValidityDate); cmd.Parameters.AddWithValue("Remarks", Details.Remarks); cmd.Parameters.AddWithValue("TransactionNo", Details.TransactionNo); 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); } }
public Int32 Save(CreditPaymentChequeDetails Details) { try { MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; string SQL = "CALL procSaveCreditPaymentCheque(@BranchID, @TerminalNo, @SyncID, @CreditPaymentChequeID, @CreditPaymentID, @CPRefBranchID, @CPRefTerminalNo, @TransactionID, @ChequeNo, @Amount, @ValidityDate, @Remarks, @TransactionNo, @CreatedOn, @LastModified);"; cmd.Parameters.AddWithValue("BranchID", Details.BranchDetails.BranchID); cmd.Parameters.AddWithValue("TerminalNo", Details.TerminalNo); cmd.Parameters.AddWithValue("SyncID", Details.SyncID); cmd.Parameters.AddWithValue("CreditPaymentChequeID", Details.CreditPaymentChequeID); cmd.Parameters.AddWithValue("CreditPaymentID", Details.CreditPaymentID); cmd.Parameters.AddWithValue("CPRefBranchID", Details.CPRefBranchID); cmd.Parameters.AddWithValue("CPRefTerminalNo", Details.CPRefTerminalNo); cmd.Parameters.AddWithValue("TransactionID", Details.TransactionID); cmd.Parameters.AddWithValue("ChequeNo", Details.ChequeNo); cmd.Parameters.AddWithValue("Amount", Details.Amount); cmd.Parameters.AddWithValue("ValidityDate", Details.ValidityDate); cmd.Parameters.AddWithValue("Remarks", Details.Remarks); cmd.Parameters.AddWithValue("TransactionNo", Details.TransactionNo); 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); } }
public Int64 Insert(CreditPaymentChequeDetails Details) { try { Save(Details); return Int64.Parse(base.getLAST_INSERT_ID(this)); } catch (Exception ex) { throw base.ThrowException(ex); } }
public Int64 Insert(CreditPaymentChequeDetails Details) { try { Save(Details); return(Int64.Parse(base.getLAST_INSERT_ID(this))); } catch (Exception ex) { throw base.ThrowException(ex); } }
/// <summary> /// Get the Cheque Payment details of a certain Transaction. /// </summary> /// <param name="BranchID"></param> /// <param name="TerminalNo"></param> /// <param name="SyncID">sabme as the TransactionID</param> /// <returns></returns> public CreditPaymentChequeDetails[] Details(Int32 BranchID, string TerminalNo, Int64 TransactionID) { try { MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; string SQL = SQLSelect() + "WHERE BranchID = @BranchID AND TerminalNo = @TerminalNo AND TransactionID = @TransactionID;"; cmd.Parameters.AddWithValue("BranchID", BranchID); cmd.Parameters.AddWithValue("TerminalNo", TerminalNo); cmd.Parameters.AddWithValue("TransactionID", TransactionID); cmd.CommandText = SQL; string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName); base.MySqlDataAdapterFill(cmd, dt); ArrayList items = new ArrayList(); foreach (System.Data.DataRow dr in dt.Rows) { items.Add(setDetails(dr)); } CreditPaymentChequeDetails[] arrCashDetails = new CreditPaymentChequeDetails[0]; if (items != null) { arrCashDetails = new CreditPaymentChequeDetails[items.Count]; items.CopyTo(arrCashDetails); } return(arrCashDetails); } catch (Exception ex) { throw base.ThrowException(ex); } }
/// <summary> /// Get the Cheque Payment details of a certain Transaction. /// </summary> /// <param name="BranchID"></param> /// <param name="TerminalNo"></param> /// <param name="SyncID">sabme as the TransactionID</param> /// <returns></returns> public CreditPaymentChequeDetails[] Details(Int32 BranchID, string TerminalNo, Int64 TransactionID) { try { MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; string SQL = SQLSelect() + "WHERE BranchID = @BranchID AND TerminalNo = @TerminalNo AND TransactionID = @TransactionID;"; cmd.Parameters.AddWithValue("BranchID", BranchID); cmd.Parameters.AddWithValue("TerminalNo", TerminalNo); cmd.Parameters.AddWithValue("TransactionID", TransactionID); cmd.CommandText = SQL; string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName); base.MySqlDataAdapterFill(cmd, dt); ArrayList items = new ArrayList(); foreach (System.Data.DataRow dr in dt.Rows) { items.Add(setDetails(dr)); } CreditPaymentChequeDetails[] arrCashDetails = new CreditPaymentChequeDetails[0]; if (items != null) { arrCashDetails = new CreditPaymentChequeDetails[items.Count]; items.CopyTo(arrCashDetails); } return arrCashDetails; } catch (Exception ex) { throw base.ThrowException(ex); } }