示例#1
0
        public IHttpActionResult CreateAgent(CreateAgentBindingModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState.FirstError()));
            }

            var entity = AutoMapper.Mapper.Map <Agent>(model);

            _agentLogic.Add(entity);

            return(Ok());
        }
示例#2
0
        private void btn_Add_Click(object sender, EventArgs e)
        {
            Agent temp = new Agent(textBoxFio.Text, textBoxPhoneNumber.Text);

            agentLogic.Add(temp);
        }