예제 #1
0
        public ActionResult update(string username, string password, string name, DateTime date, bool active, string description,
                                   string detail, string district, string email, string phone, double posX, double posY, string postalCode, string province, string ward,
                                   string logoImg, int roleID)
        {
            try
            {
                Stores stores = _storesService.Get(_ => _.Username == username);
                if (stores == null)
                {
                    throw new Exception();
                }

                stores.Username    = username;
                stores.Password    = password;
                stores.Name        = name;
                stores.Date        = date;
                stores.Active      = active;
                stores.Description = description;
                stores.Detail      = detail;
                stores.District    = district;
                stores.Email       = email;
                stores.Phone       = phone;
                stores.PositionX   = posX;
                stores.PositionY   = posY;
                stores.Username    = username;
                stores.PostalCode  = postalCode;

                stores.Province = province;

                stores.Ward    = ward;
                stores.LogoImg = logoImg;
                stores.RoleId  = roleID;



                _storesService.Update(stores);
                _storesService.SaveChanges();
                return(StatusCode(204));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }