Пример #1
0
        public async Task <IActionResult> Address(ViewModel.InformationViewModel viewmodel)
        {
            isAjax = HttpContext.Request.IsAjax("POST");
            if (isAjax)
            {
                if (ModelState.IsValid)
                {
                    WebEventoo_DomainClasses.Model.Address address = new WebEventoo_DomainClasses.Model.Address
                    {
                        AddressTwo     = viewmodel.Adress.AddressTwo,
                        CaptionAddress = viewmodel.Adress.CaptionAddress,
                        Name           = viewmodel.Adress.Name,
                        Lattiude       = lattiude,
                        Longtiude      = longtiude
                    };
                    await FAddressServices.AddAsync(address);

                    // Message = string.Format("Ok!");

                    return(new JsonResult("ادرس با موفقیت ذخیره شد"));
                }
            }

            return(new JsonResult(" خطا در ثبت عملیات"));
        }
Пример #2
0
        public async Task <IActionResult> EditAddress(ViewModel.InformationViewModel vmodel)
        {
            if (ModelState.IsValid)
            {
                WebEventoo_DomainClasses.Model.Address address = new WebEventoo_DomainClasses.Model.Address
                {
                    AddressTwo     = vmodel.Adress.AddressTwo,
                    CaptionAddress = vmodel.Adress.CaptionAddress,
                    Name           = vmodel.Adress.Name,
                    Lattiude       = lattiude,
                    Longtiude      = longtiude
                };
                await FAddressServices.AddAsync(address);

                Message = string.Format("Ok!");

                return(RedirectToAction("Index"));
            }
            return(View());
        }