Example #1
0
        public ActionResult Index(Models.ZipDetails zp)
        {
            var ju = Models.Job.Session();

            if (ju.Paid)
            {
                return(View("Address", zp));
            }

            if (ModelState.IsValid)
            {
                ViewBag.zip = zp.ZipCode;

                ju.Zip       = zp;
                ju.CountryId = zp.AddressBillingSame ? zp.CountryId : zp.CountryIdBill;

                System.Data.DataTable dt = new System.Data.DataTable();
                int r = new Packages().Packages_get_byCountryId(ju.CountryId, ref dt);
                if (dt.Rows.Count > 0)
                {
                    decimal currencyValue = Utils.Str2Decimal(dt.Rows[0]["c_value"].ToString());
                    ju.CurrencyValue  = currencyValue;
                    ju.Currency       = dt.Rows[0]["c_name"].ToString();
                    ju.CurrencySymbol = dt.Rows[0]["c_symbol"].ToString();
                    ju.CurrencyId     = Utils.Str2Int(dt.Rows[0]["c_id"].ToString());
                }

                // just for testing
                //int re = new EmailServer().EmailSend("OptionalService", new MailType("*****@*****.**"), new List<EmailParameter> { }, null);

                Models.Job.Update(ju);

                return(RedirectToAction("Index", "Packages"));
            }
            else
            {
                return(View("Address", zp));
            }
        }
Example #2
0
        public JsonResult ZipDetails(string zipcode)
        {
            var ret = new Models.ZipDetails().GetAll(zipcode);

            return(Json(ret, JsonRequestBehavior.AllowGet));
        }