internal JsonResult RetrieveMerchantInfo(string mid) { v_Merchant m = new v_Merchant(); using (MerchantService.Models.MerchantService db = new Models.MerchantService()) { m = db.v_Merchant.Where(x => x.MPU_Merchant_ID == mid && x.MStatusID == 100).SingleOrDefault(); } return(Json(new { success = true, merchant = m }, JsonRequestBehavior.AllowGet)); }
public ActionResult ViewDetails(string merchantid) { if (HttpContext.Session["UID"] == null) { return(RedirectToAction("Index", "Portal", null)); } mUser u = new mUser(); if (!u.check_user_right(Session["UID"].ToString(), 1)) { return(RedirectToAction("Denied", "Portal", null)); } mMerchant merchant = new mMerchant(); if (merchantid != null) { try { using (Models.MerchantService db = new Models.MerchantService()) { v_Merchant merchant_info = new v_Merchant(); merchant_info = db.v_Merchant.Where(x => x.MPU_Merchant_ID == merchantid).SingleOrDefault(); merchant.MPU_Merchant_ID = merchant_info.MPU_Merchant_ID; merchant.Merchant_Name = merchant_info.Merchant_Name; merchant.Merchant_Address = merchant_info.Merchant_Address; merchant.Merchant_Email = merchant_info.Merchant_Email; merchant.Merchant_Phone = merchant_info.Merchant_Phone; merchant.OMPURate = merchant_info.OMPURate; merchant.OJCBRate = merchant_info.OJCBRate; merchant.OUPIRate = merchant_info.OUPIRate; merchant.MPURate = merchant_info.MPURate; merchant.JCBRate = merchant_info.JCBRate; merchant.UPIRate = merchant_info.UPIRate; merchant.Settlement_Acc = merchant_info.Settlement_Acc; merchant.SettAccountName = merchant_info.SettAccountName; merchant.BusinessCategoryID = merchant_info.BusinessCategoryID; merchant.BusinessCategory = merchant_info.BusinessCategory; } } catch (Exception ex) { TempData["Message"] = ex.Message; TempData.Keep(); } } return(View(merchant)); }