示例#1
0
 public UserModel Get(int id, CurrentUserModel currentUser)
 {
     try
     {
         CustomDynamicParameters parameters = new CustomDynamicParameters(currentUser);
         parameters.Add("@i_UserRecId", id);
         UserModel result = ExecuteQuery <UserModel>("Get_UserById", parameters).FirstOrDefault();
         return(result);
     }
     catch (Exception e)
     {
         throw;
     }
 }
示例#2
0
        public bool Delete(int id, CurrentUserModel currentUser)
        {
            try
            {
                CustomDynamicParameters parameters = new CustomDynamicParameters(currentUser);
                parameters.Add("@i_UserRecId", id);
                ExecuteNoneQuery("Delete_User", parameters);
                return(true);
            }
            catch (Exception ex)
            {
                LogManager.LogError("User delete by id", ex);
                return(false);

                throw;
            }
        }
示例#3
0
        public bool Add(UserModel entity, CurrentUserModel currentUser)
        {
            try
            {
                CustomDynamicParameters parameters = new CustomDynamicParameters(currentUser);
                parameters.Add("@i_UserId", entity.UserId);
                parameters.Add("@i_UserName", entity.UserName);
                parameters.Add("@i_UserMobile", entity.UserMobile);
                parameters.Add("@i_UserEmail", entity.UserEmail);
                parameters.Add("@i_FaceBookUrl", entity.FaceBookUrl);
                parameters.Add("@i_LinkedInUrl", entity.LinkedInUrl);
                parameters.Add("@i_TwitterUrl", entity.TwitterUrl);
                parameters.Add("@i_PersonalWebUrl", entity.PersonalWebUrl);

                ExecuteNoneQuery("Add_User", parameters);
                return(true);
            }
            catch (Exception ex)
            {
                LogManager.LogError("Add User: ", ex);
                throw ex;
            }
        }
示例#4
0
        public IEnumerable <UserModel> Get(CurrentUserModel currentUser)
        {
            CustomDynamicParameters parameters = new CustomDynamicParameters(currentUser);

            return(ExecuteQuery <UserModel>("Get_User", parameters).ToList());
        }