public void ReturnBook(Model.Transaction oMTransaction) { try { osb.ConnectionString = sConnectionString; ddq = new DatabaseQuery.DBQuery(); ddq.ConnectionString = osb.ConnectionString; ddq.CommandText = "SP_RETURN_BOOK"; ddq.AddParamer("@BOOK_ID", SqlDbType.VarChar, oMTransaction.BOOK_ID); ddq.AddParamer("@BORROWER_ID", SqlDbType.VarChar, oMTransaction.PERSON_ID); ddq.AddParamer("@BOOK_NO", SqlDbType.VarChar, oMTransaction.BOOK_NO); ddq.AddParamer("@MODIFIED_DATE", SqlDbType.VarChar, oMTransaction.MODIFIED_DATE); ddq.AddParamer("@MODIFIED_BY", SqlDbType.VarChar, oMTransaction.MODIFIED_BY); ddq.AddParamer("@TOTAL_AMOUNT", SqlDbType.Decimal, oMTransaction.TOTAL_AMOUNT); ddq.AddParamer("@REMARKS", SqlDbType.VarChar, oMTransaction.REMARKS); ddq.AddParamer("@STATUS", SqlDbType.VarChar, oMTransaction.STATUS); ddq.ExecuteNonQuery(CommandType.StoredProcedure); } catch (Exception ex) { throw ex; } }
public DataTable getResultWinner(DateTime dStart, DateTime dEnd, string sElectionCode) { try { osb.ConnectionString = sConnectionString; ddq = new DatabaseQuery.DBQuery(); ddq.ConnectionString = osb.ConnectionString; ddq.AddParamer("@DATE_FROM", SqlDbType.NVarChar, dStart.ToString("yyyy-MM-dd")); ddq.AddParamer("@DATE_TO", SqlDbType.NVarChar, dEnd.ToString("yyyy-MM-dd")); ddq.AddParamer("@ELECTION_CODE", SqlDbType.NVarChar, sElectionCode); ddq.CommandText = "sp_getresult"; ds = ddq.GetDataset(CommandType.StoredProcedure); return(ds.Tables.Count > 0 ? ds.Tables[0] : null); } catch (Exception ex) { throw ex; } }
public void UpdateBorrower(Model.Borrower oData) { try { osb.ConnectionString = sConnectionString; ddq = new DatabaseQuery.DBQuery(); ddq.ConnectionString = osb.ConnectionString; ddq.CommandText = "SP_UPDATE_BORROWER"; ddq.AddParamer("@BORROWER_ID", SqlDbType.VarChar, oData.PERSON_ID); ddq.AddParamer("@FIRST_NAME", SqlDbType.VarChar, oData.FIRST_NAME); ddq.AddParamer("@MIDDLE_NAME", SqlDbType.VarChar, oData.MIDDLE_NAME); ddq.AddParamer("@LAST_NAME", SqlDbType.VarChar, oData.LAST_NAME); ddq.AddParamer("@DOB", SqlDbType.VarChar, oData.DOB); ddq.AddParamer("@AGE", SqlDbType.VarChar, oData.AGE); ddq.AddParamer("@CONTACT_NO", SqlDbType.VarChar, oData.CONTACT_NO); ddq.AddParamer("@ADDRESS", SqlDbType.VarChar, oData.ADDRESS); ddq.AddParamer("@MODIFIED_DATE", SqlDbType.VarChar, oData.MODIFIED_DATE); ddq.AddParamer("@MODIFIED_BY", SqlDbType.VarChar, oData.MODIFIED_BY); ddq.AddParamer("@STATUS", SqlDbType.VarChar, oData.STATUS); ddq.AddParamer("@PROFILE_PIC", SqlDbType.VarChar, oData.PROFILE_PIC); ddq.ExecuteNonQuery(CommandType.StoredProcedure); } catch (Exception ex) { throw ex; } }
public void UpdateBookDetails(Model.Transaction oMTransaction) { try { osb.ConnectionString = sConnectionString; ddq = new DatabaseQuery.DBQuery(); ddq.ConnectionString = osb.ConnectionString; ddq.CommandText = "SP_UPDATE_BOOK_DETAILS"; ddq.AddParamer("@ID", SqlDbType.VarChar, oMTransaction.BOOK_ID); ddq.AddParamer("@BOOK_NO", SqlDbType.VarChar, oMTransaction.BOOK_NO); ddq.AddParamer("@TITLE", SqlDbType.VarChar, oMTransaction.TITLE); ddq.AddParamer("@SUBJECT", SqlDbType.VarChar, oMTransaction.SUBJECT); ddq.AddParamer("@CATEGORY", SqlDbType.VarChar, oMTransaction.CATEGORY); ddq.AddParamer("@AUTHOR", SqlDbType.VarChar, oMTransaction.AUTHOR); ddq.AddParamer("@PUBLISH_DATE", SqlDbType.VarChar, oMTransaction.PUBLISH_DATE); ddq.AddParamer("@LOCATION", SqlDbType.VarChar, oMTransaction.LOCATION); ddq.AddParamer("@BOOK_PRICE", SqlDbType.VarChar, oMTransaction.BOOK_PRICE); ddq.AddParamer("@RENT_PRICE", SqlDbType.VarChar, oMTransaction.RENT_PRICE); ddq.AddParamer("@ISBN_NUMBER", SqlDbType.VarChar, oMTransaction.ISBN_NUMBER); ddq.AddParamer("@MODIFIED_DATE", SqlDbType.VarChar, oMTransaction.MODIFIED_DATE); ddq.AddParamer("@MODIFIED_BY", SqlDbType.VarChar, oMTransaction.MODIFIED_BY); ddq.AddParamer("@REMARKS", SqlDbType.VarChar, oMTransaction.REMARKS); ddq.AddParamer("@STATUS", SqlDbType.VarChar, oMTransaction.STATUS); ddq.ExecuteNonQuery(CommandType.StoredProcedure); } catch (Exception ex) { throw ex; } }
public void RequestBook(Model.Transaction oMTransaction) { try { osb.ConnectionString = sConnectionString; ddq = new DatabaseQuery.DBQuery(); ddq.ConnectionString = osb.ConnectionString; ddq.CommandText = "SP_REQUEST_BOOK"; ddq.AddParamer("@ID", SqlDbType.VarChar, oMTransaction.BOOK_ID); ddq.AddParamer("@BORROWER_ID", SqlDbType.VarChar, oMTransaction.PERSON_ID); ddq.AddParamer("@BOOK_NO", SqlDbType.VarChar, oMTransaction.BOOK_NO); ddq.AddParamer("@TITLE", SqlDbType.VarChar, oMTransaction.TITLE); ddq.AddParamer("@SUBJECT", SqlDbType.VarChar, oMTransaction.SUBJECT); ddq.AddParamer("@CATEGORY", SqlDbType.VarChar, oMTransaction.CATEGORY); ddq.AddParamer("@AUTHOR", SqlDbType.VarChar, oMTransaction.AUTHOR); ddq.AddParamer("@PUBLISH_DATE", SqlDbType.VarChar, oMTransaction.PUBLISH_DATE); ddq.AddParamer("@ISBN_NUMBER", SqlDbType.VarChar, oMTransaction.ISBN_NUMBER); ddq.AddParamer("@LOCATION", SqlDbType.VarChar, oMTransaction.LOCATION); ddq.AddParamer("@BOOK_PRICE", SqlDbType.VarChar, oMTransaction.BOOK_PRICE); ddq.AddParamer("@RENT_PRICE", SqlDbType.VarChar, oMTransaction.RENT_PRICE); ddq.AddParamer("@DAYS_BORROWED", SqlDbType.VarChar, oMTransaction.TOTAL_DAYS); ddq.AddParamer("@ADDED_DATE", SqlDbType.VarChar, oMTransaction.ADDED_DATE); ddq.AddParamer("@ADDED_BY", SqlDbType.VarChar, oMTransaction.ADDED_BY); ddq.AddParamer("@STATUS", SqlDbType.VarChar, oMTransaction.STATUS); ddq.ExecuteNonQuery(CommandType.StoredProcedure); } catch (Exception ex) { throw ex; } }