Ejemplo n.º 1
0
        public IActionResult Addlocation(OtherLocationVM Model)
        {
            string Message = string.Empty;
            bool   Status  = false;

            if (ModelState.IsValid)
            {
                OtherLocation obj = new OtherLocation();
                obj.VendorID        = Model.VendorID;
                obj.LocationAddress = Model.LocationAddress;
                obj.LocationName    = Model.LocationName;
                _efRepository.Add(obj);
                var result = _efRepository.SaveChanges();
                if (result)
                {
                    Status  = true;
                    Message = "Record Successfully Created.";
                }
                else
                {
                    Status  = false;
                    Message = "Error While Creating Record.";
                }
            }
            return(Json(new { status = Status, message = Message }));
        }
Ejemplo n.º 2
0
        public IActionResult Addlocation(OtherLocationVM Model)
        {
            OtherLocation obj = new OtherLocation();


            //var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
            //var Vendori = _listOfAll.GetVendorById(userId);
            obj.VendorID        = Model.VendorID;
            obj.LocationAddress = Model.LocationAddress;
            obj.LocationName    = Model.LocationName;
            _efRepository.Add(obj);
            _efRepository.SaveChanges();
            return(RedirectToAction("Addlocation", new { VendorID = Model.VendorID }));
        }