//process stock transfer from agent to agent //ChungNN 03/2009 private EPaySoap.OutputInfo VinaStockTransfer(string MerchantID, string targetMsIsdn, Int32 amount) { EPaySoap.OutputInfo retObj = new EPaySoap.OutputInfo(); EPaySoap.Security secObj = new Security(); Random random = new Random(); int nCounter = random.Next(9000000); //stock transfer from agent to agent try { Vinaphone vinaObj = new Vinaphone(); EnquiryOutput stocktransferObj = new EnquiryOutput(); stocktransferObj = vinaObj.stock_transfer(targetMsIsdn, amount, nCounter); //If transfer seccessfull if (stocktransferObj.status == "0") { retObj.status = stocktransferObj.status; retObj.message = stocktransferObj.message; WriteLog("stock transfer on VinaPhone successfull. ( MerchantID=" + MerchantID + ", targetMsIsdn=" + targetMsIsdn + ", amount=" + amount.ToString() + " )"); } else { //VinaPhone fix status = "1" retObj.status = "1"; retObj.message = stocktransferObj.message; WriteLog("stock transfer on VinaPhone failure. ( MerchantID=" + MerchantID + ", targetMsIsdn=" + targetMsIsdn + ", amount=" + amount.ToString() + " ) "); } } catch (Exception ex) { WriteLog("stock transfer on VinaPhone failure, Exception=" + ex.ToString()); throw (ex); } return(retObj); }
//process load for VinaPhone e-load system //ChungNN 08/2008 private EPaySoap.OutputInfo VinaLoad(string MerchantID, string targetMsIsdn, Int32 amount) { EPaySoap.OutputInfo retObj = new EPaySoap.OutputInfo(); EPaySoap.Security secObj = new Security(); Random random = new Random(); int nCounter = random.Next(9000000); //load to Vinaphone mobie user try { Vinaphone vinaObj = new Vinaphone(); EnquiryOutput loadObj = new EnquiryOutput(); loadObj = vinaObj.load(targetMsIsdn, amount, nCounter); //If load seccessfull if (loadObj.status == "0") { retObj.status = loadObj.status; retObj.message = loadObj.message; WriteLog("load on VinaPhone successfull. ( MerchantID=" + MerchantID + ", targetMsIsdn=" + targetMsIsdn + ", amount=" + amount.ToString() + " )"); } else { //VinaPhone fix status = "1" retObj.status = "1"; retObj.message = loadObj.message; WriteLog("load on VinaPhone failure. ( MerchantID=" + MerchantID + ", targetMsIsdn=" + targetMsIsdn + ", amount=" + amount.ToString() + " ) "); } } catch (Exception ex) { WriteLog("load on VinaPhone failure, Exception=" + ex.ToString()); throw (ex); } return(retObj); }