Esempio n. 1
0
        public JsonEntity CreateNewUser(IMitraisEntity mitraisEntity, UserDTO model)
        {
            JsonEntity _json = new JsonEntity();

            try
            {
                MD_User new_user = new MD_User()
                {
                    phone      = model.Phone,
                    dob        = (model.Dob == null) ? String.Empty : model.Dob,
                    first_name = model.First_Name,
                    last_name  = model.Last_Name,
                    gender     = model.Gender,
                    email      = model.Email
                };

                user_repo.Insert(mitraisEntity, "ID", new_user);

                _json.AddSuccessData("Successfully added new user");
            }
            catch (Exception ex)
            {
                _json.AddExceptionAlert(ex);
            }
            return(_json);
        }
Esempio n. 2
0
        public JsonEntity AddUser(UserDTO user)
        {
            JsonEntity _json = new JsonEntity();

            try
            {
                using (IMitraisEntity mitraisEntity = dBEntityProvider.GetMitraisEntity())
                {
                    _json = user_service.CreateNewUser(mitraisEntity, user);
                    mitraisEntity.IsRollback |= _json.error;
                }
            }
            catch (Exception ex)
            {
                _json.AddExceptionAlert(ex);
            }
            return(_json);
        }