Esempio n. 1
0
        public ActionResult New(TrademarkViewModel model)
        {
            try
            {
                var command = new TrademarkCommand()
                {
                    ParentId         = model.ParentId,
                    Name             = model.Name,
                    Code             = model.Code,
                    ERPCode          = model.ERPCode,
                    ShortDescription = model.ShortDescription,
                    LongDescription  = model.LongDescription,
                    Status           = model.Status,
                    Environment      = this.Environment,
                    UserToken        = this.UserToken,
                    SessionId        = this.SessionId
                };

                var response = _metadataServiceClient.CreateTrademark(command);

                model.TrademarkId = response.TrademarkId;
            }
            catch (Exception e)
            {
                Log(LogMode.Error, "There is an error while creating a trademark!", e);
                throw;
            }

            return(RedirectToAction("Details", new { id = model.TrademarkId }));
        }