コード例 #1
0
        //Autentikasi grosir
        private UserModel AuthenticateGrosir(Grosir login)
        {
            UserModel user = null;
            RepoUser  repo = new RepoUser();

            try
            {
                Grosir temp = repo.GetGrosir(login.Email, login.Password);
                user = new UserModel {
                    Name = temp.NamaGrosir, Time = DateTime.Now
                };
                return(user);
            }
            catch (Exception)
            {
                return(user);
            }
        }
コード例 #2
0
        //Autentikasi admin
        private UserModel Authenticate(Admin login)
        {
            UserModel user = null;
            RepoUser  repo = new RepoUser();

            try
            {
                Admin temp = repo.GetUser(login.Username, login.Password);
                user = new UserModel {
                    Name = temp.Username, Time = DateTime.Now
                };
                return(user);
            }
            catch (Exception)
            {
                return(user);
            }
        }
コード例 #3
0
ファイル: User.cs プロジェクト: massimomannoni/waUser
        internal static async Task <ResponseGetUsers> GetAll()
        {
            RepoUser      repoUser = new RepoUser();
            IBaseResponse response;

            try
            {
                response = await Task.FromResult(repoUser.GetAll()).Result;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                repoUser = null;
            }

            return(response as ResponseGetUsers);
        }
コード例 #4
0
ファイル: User.cs プロジェクト: massimomannoni/waUser
        internal static async Task <ResponseAddUser> Add(User user)
        {
            RepoUser      repoUser = new RepoUser();
            IBaseResponse response;

            try
            {
                response = await Task.FromResult(repoUser.Add(user)).Result;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                repoUser = null;
            }

            return(response as ResponseAddUser);
        }