Add files via upload

This commit is contained in:
gopi17701 2018-09-29 21:21:20 -04:00 committed by GitHub
parent c02f0192eb
commit 5cf4f930bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 173 additions and 145 deletions

View File

@ -6,14 +6,18 @@ import {SalesOrderComponent} from './sales-order/sales-order.component';
import {InvoiceComponent} from './invoice/invoice.component';
import {HomepageComponent} from './homepage/homepage.component';
import {InvoiceGenComponent} from './invoice-gen/invoice-gen.component';
import {InvoicePaymentComponent} from './invoice-payment/invoice-payment.component';
import {LoginComponent} from './login/login.component';
const routes: Routes = [
{ path: '', redirectTo: 'homepage', pathMatch: 'full'},
{ path: '', redirectTo: 'login', pathMatch: 'full'},
{ path: 'homepage', component: HomepageComponent },
{ path: 'customer', component: CustomerComponent },
{ path: 'sales-order', component: SalesOrderComponent },
{ path: 'invoice', component: InvoiceComponent },
{ path: 'invoice-gen', component: InvoiceGenComponent }
{ path: 'invoice-gen', component: InvoiceGenComponent },
{ path: 'invoice-payment', component: InvoicePaymentComponent },
{ path: 'login', component: LoginComponent }
];
@NgModule({

View File

@ -16,6 +16,11 @@ import { HomepageComponent } from './homepage/homepage.component';
import { AppBoxComponent } from './app-box/app-box.component';
import { InvoiceGenComponent } from './invoice-gen/invoice-gen.component';
import { TextMaskModule } from 'angular2-text-mask';
import { LoginComponent } from './login/login.component';
import { InvoicePaymentComponent } from './invoice-payment/invoice-payment.component';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { ReactiveFormsModule } from '@angular/forms';
@NgModule({
declarations: [
@ -27,7 +32,9 @@ import { TextMaskModule } from 'angular2-text-mask';
InvoiceComponent,
HomepageComponent,
AppBoxComponent,
InvoiceGenComponent
InvoiceGenComponent,
LoginComponent,
InvoicePaymentComponent
],
imports: [
BrowserModule,
@ -35,7 +42,10 @@ import { TextMaskModule } from 'angular2-text-mask';
NgbModule.forRoot(),
HttpClientModule,
AppRoutingModule,
TextMaskModule
TextMaskModule,
CommonModule,
FormsModule,
ReactiveFormsModule
],
providers: [AstuteClientService],
bootstrap: [AppComponent]

View File

@ -8,16 +8,6 @@
Welcome to the Astute Internal System, {{currentUser}}!
</h1>
</div>
<div class="col-lg-4">
<div class="input-group mb-3 float-right">
<input type="text" class="form-control" placeholder="Search...">
<div class="input-group-prepend">
<button class="btn btn-sm btn-info btn-round">
<i class="material-icons">search</i>
</button>
</div>
</div>
</div>
</div>
<!--applications-->

View File

@ -73,7 +73,7 @@
<span class="input-group-text">Payment Date*</span>
</td>
<td colspan="7">
<input type="text" class="form-control" #inDateReceived>
<input type="date" class="form-control" #inDateReceived>
</td>
</tr>
@ -120,7 +120,7 @@
<span class="input-group-text">Date Received*</span>
</td>
<td colspan="7">
<input type="text" class="form-control" #inDateReceived [value]="selected.paymentDate">
<input type="date" class="form-control" #inDateReceived [value]="selected.paymentDate">
</td>
</tr>
</tbody>

View File

@ -1,6 +1,11 @@
<div class="page" style="width: 35%; margin: 20px auto auto;">
<form class="form-signin" (ngSubmit)="login(f)" #f="ngForm" style="margin-bottom: 10px">
<h2 class="form-signin-heading">Login</h2>
<div class="row">
<div class="col-12">
<img src="assets/img/AstuteLogo.gif" height="100" width="230">
<h1 class="form-signin-heading text-right">Login</h1>
</div>
</div>
<label for="username" class="sr-only">Username</label>
<input class="form-control" type="text" id="username" name="username" ngModel placeholder="Username">

View File

@ -25,7 +25,7 @@ export class LoginComponent implements OnInit {
this.astuteClientService.login(username, password).then((data) => {
if (data) {
this.router.navigate(['/home']);
this.router.navigate(['/homepage']);
} else {
alert('login failed, checked credentials');
}

View File

@ -59,7 +59,7 @@
<td style="width: 20%"><span class="input-group-text">Contract Number</span></td>
<td style="width: 30%"><input type="text" class="form-control" placeholder="External Contract Number" #contractnum></td>
<td style="width: 20%"><span class="input-group-text">Contract Amount</span></td>
<td style="width: 30%"><input type="number" class="form-control" placeholder="Derived From Details" [value]="newContractAmount" #contractamt disabled></td>
<td style="width: 30%"><input type="text" class="form-control" placeholder="Derived From Details" [value]="newContractAmount | currency" #contractamt disabled></td>
</tr>
</tbody>
</table>

View File

@ -15,7 +15,8 @@ export class AstuteClientService {
private invoiceDetailUrl = 'http://localhost:8080/astutesystem/invoice/detail';
private invoiceGenUrl = 'http://localhost:8080/astutesystem/invoice/generatedInvoice';
private invoicePaymentUrl = 'http://localhost:8080/astutesystem/invoicePayment';
private sessionId;
private sessionId=localStorage.getItem('');
private sessionString = `?sessionId=${this.sessionId}`;
constructor(private http: HttpClient) { }
@ -28,13 +29,15 @@ export class AstuteClientService {
};
return this.http
.post(this.authUrl, data, this.headers)
.post(this.authUrl, data)
.toPromise()
.then(response => {
console.log(response['entity']);
const sessionId = response['entity'];
const name = response['entity'].name;
const sessionId = response['entity'].sessionId;
if (sessionId != null) {
localStorage.setItem('SESSION_ID', sessionId);
localStorage.setItem('SESSION_USER', name);
return sessionId;
} else {
return null;
@ -42,21 +45,36 @@ export class AstuteClientService {
});
}
private getSessionId(): string {
public logout() {
localStorage.removeItem('SESSION_ID');
localStorage.removeItem('SESSION_USER');
console.log(localStorage.getItem('SESSION_ID'));
}
public getSessionId(): string {
console.log(localStorage.getItem('SESSION_ID'));
return localStorage.getItem('SESSION_ID');
}
public getSessionUser(): string {
console.log(localStorage.getItem('SESSION_USER'));
return localStorage.getItem('SESSION_USER');
}
// **************************************** Customer Service methods
public getCustomers(): Promise<any> {
console.log("*** In getCustomers()");
const url = `${this.customerUrl}`;
const url = `${this.customerUrl}${this.sessionString}`;
return this.http.get(url)
.toPromise()
.then(response => {
console.log(response['entity']);
return response['entity'];
})
.catch( error => {
alert(error);
});
}
@ -137,6 +155,7 @@ export class AstuteClientService {
// Date deliverBy;
public updatePODetail(ponum, lineItemNo, data) {
console.log("*** In updatePODetail()");
const sessionId = localStorage.getItem('sessionId');
const url = `${this.POUrl}/detail/${ponum}/${lineItemNo}`; //TODO send sessionId
return this.http.put(url, data)
.toPromise()