Ejemplo n.º 1
0
        public IActionResult AddBranch([FromBody] PostModel inUsers)
        {
            InBranchDetails obj = JsonConvert.DeserializeObject <InBranchDetails>(inUsers.Key);

            try
            {
                var result = _branch.AddBranch(obj);
                return(Ok(result));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Ejemplo n.º 2
0
        public IActionResult SaveBranch(AddBranchVM model)
        {
            var newone = new Branch
            {
                BranchName  = model.branchName,
                CityID      = model.cityID,
                PhoneNumber = model.phoneNumber,
                Adress      = model.adress,
                Open        = model.open,
                Close       = model.close
            };

            _branch.AddBranch(newone);

            return(Redirect("/Branch/ShowAllBranches"));
        }