コード例 #1
0
        public bool Create(ContactDto contactDto)
        {
            bool isCreate = false;

            if (contactDto != null)
            {
                using (InDesignContext context = new InDesignContext())
                {
                    context.Contact.Add(contactDto.contact);
                    int save = context.SaveChanges();
                    if (save > 0)
                    {
                        isCreate = true;
                    }
                    else
                    {
                        isCreate = false;
                    }
                }
            }
            return(isCreate);
        }
コード例 #2
0
        public bool Update(ClientDto clientDto)
        {
            bool isUpdate = false;

            if (clientDto != null)
            {
                using (InDesignContext context = new InDesignContext())
                {
                    context.Client.Update(clientDto.client);
                    int save = context.SaveChanges();
                    if (save > 0)
                    {
                        isUpdate = true;
                    }
                    else
                    {
                        isUpdate = false;
                    }
                }
            }
            return(isUpdate);
        }