public Int32 Save(CashPaymentDetails Details) { try { MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; string SQL = "CALL procSaveCashPayment(@BranchID, @TerminalNo, @SyncID, @CashPaymentID, @TransactionID, @Amount, @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("CashPaymentID", Details.CashPaymentID); cmd.Parameters.AddWithValue("TransactionID", Details.TransactionID); cmd.Parameters.AddWithValue("Amount", Details.Amount); 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(CashPaymentDetails Details) { try { MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; string SQL = "CALL procSaveCashPayment(@BranchID, @TerminalNo, @SyncID, @CashPaymentID, @TransactionID, @Amount, @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("CashPaymentID", Details.CashPaymentID); cmd.Parameters.AddWithValue("TransactionID", Details.TransactionID); cmd.Parameters.AddWithValue("Amount", Details.Amount); 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(CashPaymentDetails Details) { try { Save(Details); return Int64.Parse(base.getLAST_INSERT_ID(this)); } catch (Exception ex) { throw base.ThrowException(ex); } }
public Int64 Insert(CashPaymentDetails Details) { try { Save(Details); return(Int64.Parse(base.getLAST_INSERT_ID(this))); } catch (Exception ex) { throw base.ThrowException(ex); } }
/// <summary> /// Get the cash payment details of a certain transaction. /// </summary> /// <param name="BranchID"></param> /// <param name="TerminalNo"></param> /// <param name="SyncID">Same also as the TransactionID</param> /// <returns></returns> public CashPaymentDetails[] 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)); } CashPaymentDetails[] arrCashDetails = new CashPaymentDetails[0]; if (items != null) { arrCashDetails = new CashPaymentDetails[items.Count]; items.CopyTo(arrCashDetails); } return(arrCashDetails); } catch (Exception ex) { throw base.ThrowException(ex); } }
/// <summary> /// Get the cash payment details of a certain transaction. /// </summary> /// <param name="BranchID"></param> /// <param name="TerminalNo"></param> /// <param name="SyncID">Same also as the TransactionID</param> /// <returns></returns> public CashPaymentDetails[] 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)); } CashPaymentDetails[] arrCashDetails = new CashPaymentDetails[0]; if (items != null) { arrCashDetails = new CashPaymentDetails[items.Count]; items.CopyTo(arrCashDetails); } return arrCashDetails; } catch (Exception ex) { throw base.ThrowException(ex); } }