public void deleteOrderByPurchaseOrder(int purchaseorder, int userNo, string message) { string fromemail = StoreSupplierDAO.findEmployeeByCode(userNo).employeeemail; SOrder po = StoreSupplierDAO.findUnapprovedOrderByPurchaseOrder(purchaseorder); string toemail = po.Employee.employeeemail; try { StoreSupplierDAO.deleteOrderByPurchaseOrder(purchaseorder); } catch (Exception e) { throw new SSexception("delete order failed because order not found :" + e.Message); } sendMailToEmployee(String.Format("Order no. {0} has been rejected. Reason given: {1}", purchaseorder, message), fromemail, toemail); }
public void deleteAdjustmentByVoucherNumber(int vouchernumber, int userNo, string message) { string fromemail = StoreSupplierDAO.findEmployeeByCode(userNo).employeeemail; AdjustmentVoucher av = StoreSupplierDAO.findUnapprovedAdjByVoucherNumber(vouchernumber); string toemail = av.Employee.employeeemail; try { StoreSupplierDAO.deleteAdjustmentByVoucherNumber(vouchernumber); } catch (Exception e) { throw new SSexception("delete adjustment voucher failed because adjustment voucher not found :" + e.Message); } sendMailToEmployee(String.Format("Order no. {0} has been rejected. Reason given: {1}", vouchernumber, message), fromemail, toemail); }