Ejemplo n.º 1
0
        public ActionResult Delete(String ID)
        {
            int      id       = Convert.ToInt32(Helpers.CommonMethods.Decrypt(HttpUtility.UrlDecode(ID)));
            Customer customer = new Customer();

            try
            {
                if (ModelState.IsValid)
                {
                    Services.CustomerServiceClient customerServiceClient = new Services.CustomerServiceClient();

                    customer        = customerServiceClient.GetCustomer(id);
                    ViewBag.Country = new SelectList(db.MCountries, "iCountry", "strCountryName", customer.iCountry);
                    var countryList = db.MCities.Where(x => x.iCountry == customer.iCountry).ToList();

                    ViewBag.City        = new SelectList(countryList, "iCity", "strCityName", customer.iCity);
                    ViewBag.CutomerType = new SelectList(db.MCutomerTypes, "iCutomerTypeID", "strCutomerTypeName", customer.iCutomerTypeID);

                    ViewBag.CreditCategory = new SelectList(db.CreditCategories, "iCreditCategoryID", "strCategory", customer.iCreditCategoryID);
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError("error", "Something Went Wrong");
                customer = null;
                throw e;
            }
            //return View("Save", customer);
            return(View(customer));
        }
Ejemplo n.º 2
0
        public ActionResult GenerateIDProof(String ID)
        {
            int id = 0;

            if (ID != "0")
            {
                id = Convert.ToInt32(Helpers.CommonMethods.Decrypt(HttpUtility.UrlDecode(ID)));
            }
            Customer customer = new Customer();

            try
            {
                if (ModelState.IsValid)
                {
                    Services.CustomerServiceClient customerServiceClient = new Services.CustomerServiceClient();
                    customer = customerServiceClient.GetCustomer(id);
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError("error", "something went wrong");
                customer = null;
                throw e;
            }
            //return View(customer);
            return(Json(customer, JsonRequestBehavior.AllowGet));
        }