コード例 #1
0
        public string UpdateUser(Users_Receptionist_Advisior user)
        {
            try
            {
                var entity = dbcontext.Users_Receptionist_Advisior.Find(user.UserId);

                if (entity != null)
                {
                    entity.Name = user.Name;
                    //entity.IsActive = brand.IsActive;
                    dbcontext.SaveChanges();

                    return("Updated");
                }

                return("null");
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }
コード例 #2
0
        public string CreateUser(Users_Receptionist_Advisior user)
        {
            try
            {
                if (user != null)
                {
                    Database.Users_Receptionist_Advisior entity = new Database.Users_Receptionist_Advisior();

                    var config = new MapperConfiguration(cfg => cfg.CreateMap <Users_Receptionist_Advisior, Database.Users_Receptionist_Advisior>());
                    var mapper = new Mapper(config);

                    entity = mapper.Map <Database.Users_Receptionist_Advisior>(user);

                    dbcontext.SaveChanges();

                    return("created");
                }
                return("null");
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }
コード例 #3
0
 public string UpdateUser(Users_Receptionist_Advisior user)
 {
     return(_IUser.UpdateUser(user));
 }