public Responseobj InternalReversestr(string str, string reversal_ref, string naration, bool cheque) { Responseobj output = new Responseobj(); string createdby = HttpContext.Current.Session["Username"].ToString(); int recordid = int.Parse(str); datatable = datapay.Get_TransactionByTranID(recordid); if (datatable.Rows.Count > 0) { Transaction t = new Transaction(); t = GetTransObject(datatable); t.VendorTranId = reversal_ref; t.Teller = createdby; if (!bll.IsduplicateVendorRef(t)) { double amt = double.Parse(t.TranAmount); if (amt > 0) { output.Errorcode = "201"; output.Message = "ARITHMATIC FAILURE"; } else { string recieptNo = datapay.PostUmemeTransaction(t); if (!recieptNo.Equals("")) { string res_log = datapay.LogInternaltran(recieptNo, t.Teller); if (res_log.Equals("LOGGED")) { string res_reconcile = bll.Reconcile_InternalTrans(recieptNo, t.Teller); output.Errorcode = "0"; if (res_reconcile.Equals("RECONCILED")) { output.Message = "Transaction Posted Successfully [" + recieptNo + "]"; } else { output.Message = "Transaction Posted Successfully [" + t.VendorTranId + "] but Reconciled failed, Please reconciled it"; } bll.SendSms(t, recieptNo, true); } } } } else { output.Errorcode = "20"; output.Message = datapay.GetStatusDescr(output.Errorcode); } } else { output.Errorcode = "2500"; output.Message = "FAILED TO LOCATE MAIN TRANSACTION DETAILS"; } return(output); }