public ActionResult EditMerchData(EditMerchDataModel WebMerchant)
        {
            String MerchantID = GetFromMerchantIDCookie();

            if (ModelState.IsValid)
            {
                // Attempt to update the merchant
                try
                {
                    bool updateStatus = MerchantServiceInstance.UpdateMerchant(MerchantID, WebMerchant);

                    if (updateStatus == true)
                    {
                        ModelState.AddModelError("", "Updated!");
                    }
                    else
                    {
                        ModelState.AddModelError("", "Failed to update the merchant");
                    }
                }
                catch (Exception ex)
                {
                    ModelState.AddModelError("", "Error happened in update :" + ex.Message);
                }
            }

            return(View(WebMerchant));
        }
Example #2
0
        public ActionResult EditMerchData(EditMerchDataModel WebMerchant)
        {
            String MerchantID = GetFromMerchantIDCookie();

            if (ModelState.IsValid)
            {
                // Attempt to update the merchant
                try
                {
                    IMerchantService MerchantServiceInstance = new MerchantService();
                    bool             updateStatus            = MerchantServiceInstance.UpdateMerchant(MerchantID, WebMerchant);

                    if (updateStatus == true)
                    {
                        ModelState.AddModelError("", "Updated!");
                    }
                    else
                    {
                        ModelState.AddModelError("", "Failed to update the merchant");
                    }
                }
                catch (Exception Ex)
                {
                    ModelState.AddModelError("", Common.StandardExceptionHandler(Ex, "Edit Merchant Data", Request.Form));
                    Log.BadData(Request.UserHostAddress, Request.Url.ToString(), Request.Form);
                }
            }

            return(View(WebMerchant));
        }
        public ActionResult EditMerchData()
        {
            String MerchantID = GetFromMerchantIDCookie();

            if (MerchantID == null)
            {
                return(RedirectToAction("MerchantLogOn", "Account"));
            }
            EditMerchDataModel WebMerchant = MerchantServiceInstance.GetMerchant(MerchantID);

            return(View(WebMerchant));
        }