Exemple #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 }));
        }
        public IActionResult Addlocation(int VendorID)
        {
            var otherLocaction             = new OtherLocationVM();
            var getOtherLocationByVendorID = _listOfAll.GetOtherLocationByVendorID(VendorID).ToList();

            otherLocaction.VendorID = VendorID;
            List <OtherLocationList> filllist = new List <OtherLocationList>();

            if (getOtherLocationByVendorID.Count == 0)
            {
                filllist.Add(new OtherLocationList {
                    LocationAddress = "", LocationName = " "
                });
            }

            foreach (var item in getOtherLocationByVendorID)
            {
                filllist.Add(new OtherLocationList()
                {
                    LocationAddress = item.LocationAddress,
                    LocationName    = item.LocationName
                });
            }
            otherLocaction.Lista = filllist;
            return(View("ListofLocation", otherLocaction));
        }
Exemple #3
0
        public IActionResult Addlocation(int VendorId)
        {
            var otherLocaction             = new OtherLocationVM();
            var getOtherLocationByVendorID = _listOfAll.GetOtherLocationByVendorID(VendorId).ToList();

            if (getOtherLocationByVendorID != null)
            {
                otherLocaction.VendorID = VendorId;
            }
            return(View(otherLocaction));
        }
        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 }));
        }
 public async Task <BaseResponse> AddVendorlocation([FromBody] OtherLocationVM model)
 {
     return(constructResponse(_businessWrapper.UserBL.Addlocation(model)));
 }