本文整理汇总了C#中TransactionType.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# TransactionType.Equals方法的具体用法?C# TransactionType.Equals怎么用?C# TransactionType.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransactionType
的用法示例。
在下文中一共展示了TransactionType.Equals方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Should_return_true
public void Should_return_true()
{
var alpha = new TransactionType
{
Name = "foo",
};
var beta = new TransactionType
{
Name = "FOO"
};
alpha.Equals(beta).ShouldBeTrue();
}
示例2: CashOperation
//Column : 0 Petunia_Date
//Insert & Update Cash debt or credits
private bool CashOperation(DataTable transfarData, TransactionType transactionType, DBQueres DataWriter, DatabaseRead DataReader, MysqlRowCounter TableRowCounter)
{
//Column : 1 Description
try //Column : 2 Credit Taka or Debt Taka
{ //Column :
DataRow transfarDataRow = transfarData.Rows[0];
if (transactionType.Equals(TransactionType.debt))
{
DataWriter(string.Format("INSERT INTO {0} VALUES ('{1}','{2}',{3},0,{4}+{3},0)", thisDataSet.ThisTables[2][0].ToString(), transfarDataRow[0], transfarDataRow[1], transfarDataRow[2], LastRowVaue(thisDataSet.ThisColumn[8][0].ToString(), thisDataSet.ThisTables[2][0].ToString(), new DatabaseRead(DataReader), new MysqlRowCounter(TableRowCounter))));
return DataWriter(string.Format("UPDATE {0} SET {1}={1}+{2}, {3}={3}+{2} WHERE {4}='{5}'", thisDataSet.ThisTables[6][0].ToString(), thisDataSet.ThisColumn[6][0], transfarDataRow[2], thisDataSet.ThisColumn[8][0], thisDataSet.ThisColumn[0][0].ToString(), transfarDataRow[0]));
}
else if(transactionType.Equals(TransactionType.Credit))
{
DataWriter(string.Format("INSERT INTO {0} VALUES ('{1}','{2}',0,{3},{4}-{3},0)", thisDataSet.ThisTables[2][0].ToString(), transfarDataRow[0], transfarDataRow[1], transfarDataRow[2], LastRowVaue(thisDataSet.ThisColumn[8][0].ToString(), thisDataSet.ThisTables[2][0].ToString(), new DatabaseRead(DataReader), new MysqlRowCounter(TableRowCounter))));
return DataWriter(string.Format("UPDATE {0} SET {1}={1}-{2}, {3}={3}-{2} WHERE {4}='{5}'", thisDataSet.ThisTables[6][0].ToString(), thisDataSet.ThisColumn[7][0], transfarDataRow[2], thisDataSet.ThisColumn[8][0], thisDataSet.ThisColumn[0][0].ToString(), transfarDataRow[0]));
}
else
{
return false;
}
}
catch
{
return false;
}
}
示例3: Should_return_false
public void Should_return_false()
{
var alpha = new TransactionType
{
Name = "foo",
};
var beta = new TransactionType
{
Name = "bar"
};
alpha.Equals(beta).ShouldBeFalse();
}
示例4: SalesReturn
//Sales Return
public bool SalesReturn(DataTable transfarData, TransactionType transactionType, DBQueres DataWriter, DatabaseRead DataReader, MysqlRowCounter TableRowCounter)
{
try
{
DataRow transfarDataRow = transfarData.Rows[0];
AccountingDataSet commonDataSet = new AccountingDataSet();
DataWriter(string.Format("INSERT INTO {0} VALUES('{1}','{2}','{3}','{4}',{5},{6},{7},{8},0,0,{9}-{8})",thisDataSet.ThisTables[20][0],transfarDataRow[0],transfarDataRow[2],transfarDataRow[1],transactionType.Equals(TransactionType.Cash) ? TransactionType.Cash : TransactionType.Credit, transfarDataRow[3],transfarDataRow[4],transfarDataRow[5],transfarDataRow[6],LastRowVaue(thisDataSet.ThisColumn[9][0].ToString(),thisDataSet.ThisTables[20][0].ToString(),new DatabaseRead(DataReader),new MysqlRowCounter(TableRowCounter))));
commonDataSet.ThisCommonUse.Rows.Add(transfarDataRow[0],transfarDataRow[1],transfarDataRow[2],transfarDataRow[3],transfarDataRow[4],transfarDataRow[5],transfarDataRow[6],transfarDataRow[7]);
StockOperation(commonDataSet.ThisCommonUse, ProductOperationType.Purchase, new DBQueres(DataWriter), new DatabaseRead(DataReader), new MysqlRowCounter(TableRowCounter));
if (transactionType.Equals(TransactionType.Cash))
{
commonDataSet.ThisCommonUse.Clear();
commonDataSet.ThisCommonUse.Dispose(); //Column : 0 Petunia_Date
commonDataSet.ThisCommonUse.Rows.Add(transfarDataRow[0], transfarDataRow[1], transfarDataRow[7]); //Column : 1 Description
return CashOperation(commonDataSet.ThisCommonUse, TransactionType.Credit, new DBQueres(DataWriter), new DatabaseRead(DataReader), new MysqlRowCounter(TableRowCounter)); //Column : 2 Transaction /\ Product_ID
} //Column : 3 Quantity
else if (transactionType.Equals(TransactionType.debt)) //Column : 4 Rate
{ //Column : 5 Average_Rate
commonDataSet.ThisCommonUse.Clear(); //Column : 6 Invoice_Number
commonDataSet.ThisCommonUse.Dispose(); //Column : 7 Debt_Tk Or credit_Tk
commonDataSet.ThisCommonUse.Rows.Add(transfarDataRow[0], transfarDataRow[1], transfarDataRow[7], transfarDataRow[8],transfarDataRow[9]); //Column : 8 User_ID
return CreditorsAndDebitorsAccount(commonDataSet.ThisCommonUse, TransactionType.debt, new DatabaseRead(DataReader), new DBQueres(DataWriter), new MysqlRowCounter(TableRowCounter)); //Column :9 Product_ID
}
else
{
return false;
}
}
catch
{
return false;
}
}
示例5: BankAccount
//Insert into Bank
private bool BankAccount(DataTable transfarData,TransactionType transactionType,DatabaseRead DataReder, DBQueres DataWriter, MysqlRowCounter TableRowCounter)
{
try
{
DataRow transfarDataRow = transfarData.Rows[0];
if (transactionType.Equals(TransactionType.debt)) //Max Column 3
{ //Column : PETUNIA_DATE
return DataWriter(string.Format("INSERT INTO {0} VALUES('{1}','{2}',0,{3},{4}-{3},0)", thisDataSet.ThisTables[1][0].ToString(), transfarDataRow[0], transfarDataRow[1], transfarDataRow[2], LastRowVaue(thisDataSet.ThisColumn[9][0].ToString(), thisDataSet.ThisTables[1][0].ToString(), new DatabaseRead(DataReder), new MysqlRowCounter(TableRowCounter)))); //Column : DESCRIPTION
} //Column : DEBIT_TK or CREDIT_TK
else if (transactionType.Equals(TransactionType.Credit))
{
return DataWriter(string.Format("INSERT INTO {0} VALUES('{1}','{2}',{3},0,{4}+{3},0)", thisDataSet.ThisTables[1][0].ToString(), transfarDataRow[0], transfarDataRow[1], transfarDataRow[2], LastRowVaue(thisDataSet.ThisColumn[9][0].ToString(), thisDataSet.ThisTables[1][0].ToString(), new DatabaseRead(DataReder), new MysqlRowCounter(TableRowCounter))));
}
else
{
return false;
}
}
catch (Exception)
{
return false;
}
}
示例6: SalesLedger
//Sales Ledger
public bool SalesLedger(DataTable transfarData, TransactionType transactionType, DBQueres DataWriter, DatabaseRead DataReadr, MysqlRowCounter TableRowCounter)
{
try
{
AccountingDataSet commonDataSet = new AccountingDataSet();
DataRow transfarDataRow=transfarData.Rows[0];
DataWriter(string.Format("INSERT INTO {0} VALUES ('{1}','{2}','{3}','{4}','{5}','{6}',{7},0,{8},0,{9}+{8})", thisDataSet.ThisTables[20][0], transfarDataRow[0],transfarDataRow[6],transfarDataRow[1], transactionType, transfarDataRow[2], transfarDataRow[3], transfarDataRow[4], transfarDataRow[5],LastRowVaue(thisDataSet.ThisColumn[9][0].ToString(),thisDataSet.ThisTables[20][0].ToString(),new DatabaseRead(DataReadr),new MysqlRowCounter(TableRowCounter))));
commonDataSet.ThisCommonUse.Rows.Add(transfarDataRow[0], transfarDataRow[1], ProductOperationType.Sales, transfarDataRow[2],Convert.ToDouble(transfarDataRow[2]) * Convert.ToDouble(transfarDataRow[8]),transfarDataRow[8], transfarDataRow[4], transfarDataRow[5], transfarDataRow[6]);
StockOperation(commonDataSet.ThisCommonUse, ProductOperationType.Sales, new DBQueres(DataWriter), new DatabaseRead(DataReadr), new MysqlRowCounter(TableRowCounter));
if (transactionType.Equals(TransactionType.Cash))
{
commonDataSet.ThisCommonUse.Clear(); //Column :0 Petunia_Date
commonDataSet.ThisCommonUse.Dispose(); //Column :1 Description
commonDataSet.ThisCommonUse.Rows.Add(transfarDataRow[0], transfarDataRow[1],transfarDataRow[5]); //Column :2 Transaction //should be remove
return CashOperation(commonDataSet.ThisCommonUse, TransactionType.debt, new DBQueres(DataWriter), new DatabaseRead(DataReadr), new MysqlRowCounter(TableRowCounter)); //Column :2 Quantity
} //Column :3 Rate
else if (transactionType.Equals(TransactionType.Credit)) //Column :4 Invoice_Number
{ //Column :5 Debt_Tk or Credit_tk
commonDataSet.ThisCommonUse.Clear(); //Column :6 Product_ID
commonDataSet.ThisCommonUse.Dispose(); //Column :7 User_ID
commonDataSet.ThisCommonUse.Rows.Add(transfarDataRow[0], transfarDataRow[1], transfarDataRow[10]); //Column :8 Average_Rate
CashOperation(commonDataSet.ThisCommonUse, TransactionType.debt, new DBQueres(DataWriter), new DatabaseRead(DataReadr), new MysqlRowCounter(TableRowCounter)); //Column :9 Credit Balance
commonDataSet.ThisCommonUse.Clear(); //Column :10 Payment Balance
commonDataSet.ThisCommonUse.Dispose();
commonDataSet.ThisCommonUse.Rows.Add(transfarDataRow[0], transfarDataRow[1], transfarDataRow[9], transfarDataRow[7], transfarDataRow[6]);
return CreditorsAndDebitorsAccount(commonDataSet.ThisCommonUse, TransactionType.debt, new DatabaseRead(DataReadr), new DBQueres(DataWriter), new MysqlRowCounter(TableRowCounter));
}
else if (transactionType.Equals(TransactionType.check))
{
commonDataSet.ThisCommonUse.Clear();
commonDataSet.ThisCommonUse.Dispose();
commonDataSet.ThisCommonUse.Rows.Add(transfarDataRow[0], transfarDataRow[1], transfarDataRow[5]);
return BankAccount(commonDataSet.ThisCommonUse, TransactionType.Credit, new DatabaseRead(DataReadr), new DBQueres(DataWriter), new MysqlRowCounter(TableRowCounter));
}
else
{
return false;
}
}
catch
{
return false;
}
}
示例7: PurchaseLedger
//Purchase Ledger
public bool PurchaseLedger(DataTable transfarData, TransactionType transactionType, DBQueres DataWrite, DatabaseRead DataRader, MysqlRowCounter TableRowCounter)
{
try
{
AccountingDataSet commonDataSat = new AccountingDataSet();
DataRow transfarDataRow = transfarData.Rows[0];
//string tableStockLedger = thisDataSet.ThisTables.Rows[0][thisDataSet.ThisTables.Columns[0].ToString()].ToString();
DataWrite(string.Format("INSERT INTO {0} VALUES('{1}','{2}','{3}','{4}',{5},{6},'{7}','{8}',{9},0,{10}+{9},0)", thisDataSet.ThisTables[17][0], transfarDataRow[0],transfarDataRow[8], transfarDataRow[1], transactionType, transfarDataRow[2], transfarDataRow[3], transfarDataRow[4], transfarDataRow[5], transfarDataRow[6], LastRowVaue(thisDataSet.ThisColumn[8][0].ToString(), thisDataSet.ThisTables[17][0].ToString(), new DatabaseRead(DataRader), new MysqlRowCounter(TableRowCounter)))); //PurchaseLedger
commonDataSat.ThisCommonUse.Rows.Add(transfarDataRow[0], transfarDataRow[1],ProductOperationType.Purchase, transfarDataRow[2],transfarDataRow[6],transfarDataRow[4],transfarDataRow[5],transfarDataRow[6],transfarDataRow[8]);
StockOperation(commonDataSat.ThisCommonUse, ProductOperationType.Purchase, new DBQueres(DataWrite),new DatabaseRead(DataRader),new MysqlRowCounter(TableRowCounter));
if (transactionType.Equals(TransactionType.Cash)) //Column : 0 Petunia_Date
{ //Column : 1 Description
commonDataSat.ThisCommonUse.Clear(); //Column : 2 Transaction="";\\Should be Remove
commonDataSat.ThisCommonUse.Dispose(); //Column : 2 Quantity
commonDataSat.ThisCommonUse.Rows.Add(transfarDataRow[0],transfarDataRow[1],transfarDataRow[6]); //Column : 3 Rate
return CashOperation(commonDataSat.ThisCommonUse, TransactionType.Credit, new DBQueres(DataWrite), new DatabaseRead(DataRader), new MysqlRowCounter(TableRowCounter)); //Column : 4 Average_Rate
} //Column : 5 Invoice_Number
else if (transactionType.Equals(TransactionType.check)) //Column : 6 Debt_Tk or Credit_Tk
{ //Column : 7 User_ID
commonDataSat.ThisCommonUse.Clear(); //Column : 8 ProductID
commonDataSat.ThisCommonUse.Dispose(); //Column : 9 Credit Balance
commonDataSat.ThisCommonUse.Rows.Add(transfarDataRow[0], transfarDataRow[1], transfarDataRow[6]); //Column :10 Payment Balance
return BankAccount(commonDataSat.ThisCommonUse, TransactionType.Credit, new DatabaseRead(DataRader), new DBQueres(DataWrite), new MysqlRowCounter(TableRowCounter));
}
else if (transactionType.Equals(TransactionType.Credit))
{
commonDataSat.ThisCommonUse.Clear();
commonDataSat.ThisCommonUse.Dispose();
commonDataSat.ThisCommonUse.Rows.Add(transfarDataRow[0], transfarDataRow[1], transfarDataRow[10]);
CashOperation(commonDataSat.ThisCommonUse, TransactionType.Credit, new DBQueres(DataWrite), new DatabaseRead(DataRader), new MysqlRowCounter(TableRowCounter));
commonDataSat.ThisCommonUse.Clear();
commonDataSat.ThisCommonUse.Dispose();
commonDataSat.ThisCommonUse.Rows.Add(transfarDataRow[0],transactionType,transfarDataRow[9],transfarDataRow[7],transfarDataRow[8]);
return CreditorsAndDebitorsAccount(commonDataSat.ThisCommonUse, TransactionType.Credit, new DatabaseRead(DataRader), new DBQueres(DataWrite), new MysqlRowCounter(TableRowCounter));
}
else
{
return false;
}
}
catch
{
return false;
}
}
示例8: OfficeInstrumentLedger
//Office Instrument
public bool OfficeInstrumentLedger(DataTable transfarData, TransactionType transactionType, DBQueres DataWriter, DatabaseRead DataReader, MysqlRowCounter TableRowCounter)
{
try
{
AccountingDataSet commonDataSet = new AccountingDataSet();
DataRow transfarDataRow = transfarData.Rows[0];
DataWriter(string.Format("INSERT INTO {0} VALUES ('{1}','{2}',{3},0,{4}+{3},0)",thisDataSet.ThisTables[14][0], transfarDataRow[0], transfarDataRow[1], transfarDataRow[3], LastRowVaue(thisDataSet.ThisColumn[8][0].ToString(), thisDataSet.ThisTables[10][0].ToString(), new DatabaseRead(DataReader), new MysqlRowCounter(TableRowCounter))));
if (transactionType.Equals(TransactionType.Cash))
{
commonDataSet.ThisCommonUse.Clear();
commonDataSet.ThisCommonUse.Dispose(); //Column : 0 Petunia_Date
commonDataSet.ThisCommonUse.Rows.Add(transfarDataRow[0], transfarDataRow[1], transfarDataRow[3]); //Column : 1 Description
return CashOperation(commonDataSet.ThisCommonUse, TransactionType.Credit, new DBQueres(DataWriter), new DatabaseRead(DataReader), new MysqlRowCounter(TableRowCounter)); //Column : 2 Debt_Tk Or credit_Tk
}
else if (transactionType.Equals(TransactionType.check))
{
commonDataSet.ThisCommonUse.Clear();
commonDataSet.ThisCommonUse.Dispose();
commonDataSet.ThisCommonUse.Rows.Add(transfarDataRow[0], transfarDataRow[1], transfarDataRow[3]);
return BankAccount(commonDataSet.ThisCommonUse, TransactionType.debt, new DatabaseRead(DataReader), new DBQueres(DataWriter), new MysqlRowCounter(TableRowCounter));
}
else if (transactionType.Equals(TransactionType.Credit))
{
commonDataSet.ThisCommonUse.Clear();
commonDataSet.ThisCommonUse.Dispose();
commonDataSet.ThisCommonUse.Rows.Add(transfarDataRow[0], transfarDataRow[1], transfarDataRow[3], transfarDataRow[4]);
return CreditorsAndDebitorsAccount(commonDataSet.ThisCommonUse, TransactionType.Credit, new DatabaseRead(DataReader), new DBQueres(DataWriter), new MysqlRowCounter(TableRowCounter));
}
else
{
return false;
}
}
catch
{
return false;
}
}
示例9: InitialBalanceInsert
//Initial Balance Insert
public bool InitialBalanceInsert(string amount ,TransactionType transactionType, DBQueres DataWriter, DatabaseRead DataReader, MysqlRowCounter TableRowCounter)
{
try
{
if (transactionType.Equals(TransactionType.Cash))
{
DataWriter(string.Format("INSERT INFO {0} VALUES('{1}','0',{2},0,{3}+{2},0)",thisDataSet.ThisTables[2][0],AccountingVariables.PETUNIA_DATE,amount,LastRowVaue(thisDataSet.ThisColumn[8][0].ToString(),thisDataSet.ThisTables[2][0].ToString(),new DatabaseRead(DataReader),new MysqlRowCounter(TableRowCounter))));
return true;
}
else if (transactionType.Equals(TransactionType.bank))
{
DataWriter(string.Format("INSERT INFO {0} VALUES('{1}','{2}',0,{3}+{2},0,0)", thisDataSet.ThisTables[1][0], AccountingVariables.PETUNIA_DATE, amount, LastRowVaue(thisDataSet.ThisColumn[8][0].ToString(), thisDataSet.ThisTables[1][0].ToString(), new DatabaseRead(DataReader), new MysqlRowCounter(TableRowCounter))));
return true;
}
else
{
return false;
}
}
catch
{
return false;
}
}
示例10: CreditorsAndDebitorsAccount
//Insert Creditors Account
public bool CreditorsAndDebitorsAccount(DataTable transfarData,TransactionType transactionType,DatabaseRead DataReder,DBQueres DataWriter,MysqlRowCounter TableRowCounter)
{
try
{
DataRow transfarDataRow = transfarData.Rows[0]; // column :0 PETUNIA_DATE
if (transactionType.Equals(TransactionType.Credit)) // column :1 DESCRIPTION
{ // column :2 CREDIT_TK or DEBIT_TK
DataWriter(string.Format("INSERT INTO {0} VALUES ('{1}','{2}','{3}','{4}',0,{5},0,{6}+{5})", thisDataSet.ThisTables[5][0], transfarDataRow[0], transfarDataRow[3], transfarDataRow[4], transfarDataRow[1], transfarDataRow[2], LastRowVaue(thisDataSet.ThisColumn[9][0].ToString(), thisDataSet.ThisTables[5][0].ToString(), new DatabaseRead(DataReder), new MysqlRowCounter(TableRowCounter))));
DataWriter(string.Format("UPDATE {0} SET {1}={1}+{2} WHERE {3}='{4}'",thisDataSet.ThisTables[3][0],thisDataSet.ThisColumn[6][0],transfarDataRow[2],thisDataSet.ThisColumn[12][0],transfarDataRow[3])); // column :3 User_ID
return DataWriter(string.Format("INSERT INTO {0} VALUES ('{1}','{2}','{3}','{4}',0,{5},0,0)",thisDataSet.ThisTables[24][0],transfarDataRow[0],transfarDataRow[3],transfarDataRow[4],transfarDataRow[1],transfarDataRow[2]));//need update Credit_Balance_Tk //Column : 4 Product ID
}
else if (transactionType.Equals(TransactionType.debt))
{
DataWriter(string.Format("INSERT INTO {0} VALUES ('{1}','{2}','{3}','{4}',{5},0,{6}-{5},0)", thisDataSet.ThisTables[7][0], transfarDataRow[0], transfarDataRow[3], transfarDataRow[4], transfarDataRow[1], transfarDataRow[2], LastRowVaue(thisDataSet.ThisColumn[9][0].ToString(), thisDataSet.ThisTables[7][0].ToString(), new DatabaseRead(DataReder), new MysqlRowCounter(TableRowCounter))));
DataWriter(string.Format("UPDATE {0} SET {1}={1}-{2} WHERE {3}='{4}'", thisDataSet.ThisTables[3][0], thisDataSet.ThisColumn[7][0], transfarDataRow[2], thisDataSet.ThisColumn[12][0], transfarDataRow[3]));
return DataWriter(string.Format("INSERT INTO {0} VALUES ('{1}','{2}','{3}','{4}',{5},0,0,0)", thisDataSet.ThisTables[24][0], transfarDataRow[0],transfarDataRow[3], transfarDataRow[4], transfarDataRow[1], transfarDataRow[2]));//need update Credit_Balance_Tk
}
else
{
return false;
}
}
catch (Exception)
{
return false;
}
}