private void HandleModify(USAGE_INFO_REGISTRATION oUSAGE_INFO_REG, DataRow row) { string strMsg = ""; //Get EDI_ACCOUNT object BOL_EDI_ACCOUNT oEDI_ACCOUNT = GetEDI_ACCOUNT(oUSAGE_INFO_REG); EDI_ACCOUNT DAL_EDI_ACCOUNT = new EDI_ACCOUNT(con); if (!DAL_EDI_ACCOUNT.IsAlreadyUpdated(oEDI_ACCOUNT, out strMsg)) // If updated_at is not already modified { //insert the record DAL_EDI_ACCOUNT.Update(oEDI_ACCOUNT, CURRENT_DATETIME, CURRENT_USER, out strMsg); } else { //already use in another process ResponseUtility.ReturnFailMessage(row); return; } //return message and MK value if (String.IsNullOrEmpty(strMsg)) //success { ResponseUtility.ReturnSuccessMessage(row, UPDATED_AT_DATETIME, CURRENT_DATETIME, CURRENT_USER); } else //failed { ResponseUtility.ReturnFailMessage(row); } }
private void HandleDelete(USAGE_INFO_REGISTRATION oUSAGE_INFO_REG, DataRow row) { string strMsg = ""; using (TransactionScope dbTxn = new TransactionScope()) { //GET EDI ACCOUNT OBJECT BOL_EDI_ACCOUNT oEDI_ACCOUNT = GetEDI_ACCOUNT(oUSAGE_INFO_REG); EDI_ACCOUNT DAL_EDI_ACCOUNT = new EDI_ACCOUNT(con); if (!DAL_EDI_ACCOUNT.IsAlreadyUpdated(oEDI_ACCOUNT, out strMsg)) // IF updated_at is not already modified { //delete the record DAL_EDI_ACCOUNT.Delete(oEDI_ACCOUNT, out strMsg); } else { dbTxn.Dispose(); ResponseUtility.ReturnFailMessage(row); return; } //return message and MK value if (String.IsNullOrEmpty(strMsg)) //success { dbTxn.Complete(); ResponseUtility.ReturnDeleteSuccessMessage(row); } else //failed { ResponseUtility.ReturnFailMessage(row); } } }