From 2c476c7562af59c64cec40772039291f728aa32f Mon Sep 17 00:00:00 2001 From: anchit Date: Sun, 21 May 2017 16:22:47 +0530 Subject: [PATCH] added new code --- app/partials/ContactView/ContactView.controller.js | 46 ++- app/partials/ContactView/ContactView.html | 335 ++++++++++++--------- app/partials/ContactView/ContactView.service.js | 35 ++- app/partials/customers/customers.html | 165 +--------- 4 files changed, 269 insertions(+), 312 deletions(-) diff --git a/app/partials/ContactView/ContactView.controller.js b/app/partials/ContactView/ContactView.controller.js index e4154c5..0b37c27 100644 --- a/app/partials/ContactView/ContactView.controller.js +++ b/app/partials/ContactView/ContactView.controller.js @@ -3,13 +3,45 @@ //Load controller angular.module('acufuel') - .controller('ContactViewController', ['$scope',function($scope) { - - $scope.test = "Testing..."; - - $(function() { - $('#toggle-one12').bootstrapToggle(); - $('#toggle-two21').bootstrapToggle(); + .controller('ContactViewController', ['$scope', '$uibModal', 'ContactViewService', 'ViewCompanyService', function($scope, $uibModal, ContactViewService, ViewCompanyService) { + $(function() { + $('#toggle-one12').bootstrapToggle(); + $('#toggle-two21').bootstrapToggle(); }) + + $(document).ready(function() { + $('#contacts').DataTable(); + }); + + ContactViewService.getContacts().then(function(result) { + console.log('==========',result); + $scope.contactList = result; + + }) + + ContactViewService.getCompanies().then(function(result) { + console.log('==========',result); + $scope.companies = result; + + }) + + $scope.contactData = {}; + $scope.contactData.contactList = []; + $scope.addContact = function(){ + console.log('==== $scope.data======', $scope.data); + $scope.contactData.contactList.push($scope.data); + ViewCompanyService.addContact($scope.contactData).then(function(result) { + if(result.success){ + toastr.success(''+result.success+'', { + closeButton: true + }) + $('#contact-modal-3').modal('hide'); + }else{ + toastr.error(''+result.statusText+'', { + closeButton: true + }) + } + }) + } }]); \ No newline at end of file diff --git a/app/partials/ContactView/ContactView.html b/app/partials/ContactView/ContactView.html index 6df3d20..07a0c91 100644 --- a/app/partials/ContactView/ContactView.html +++ b/app/partials/ContactView/ContactView.html @@ -28,7 +28,7 @@
  • -
  • +

  • @@ -38,75 +38,47 @@ - - - - - - - - + - + - + + - - + - + - - + + - + - - - colony - Gerry - Est LLC - (310) 555-1212 - (310) 555-1212 - Acufuel - Usel 1 - - - Password 123 - - - - colony - Gerry - Est LLC - (310) 555-1212 - (310) 555-1212 - Acufuel - Usel 1 - - - - Password 123 - - - + + {{contact.lastName}} + {{contact.firstName}} + {{contact.owner.companyName}} + {{contact.workPhone}} + {{contact.mobilePhone}} + {{contact.title}} + {{contact.username}} + {{contact.priceEmail}} + +
    @@ -138,95 +110,6 @@
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Last Name First Name Company Name Work Phone Mobile Phone Title Pricing Email Username Password
    Name and inc.303423233JemmyKIAD $123
    Name and inc.303423233JemmyKIAD$123
    -
    -
    - - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - -
    EngineBrowser
    -
    @@ -240,4 +123,178 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/app/partials/ContactView/ContactView.service.js b/app/partials/ContactView/ContactView.service.js index ad322b2..3d4db00 100644 --- a/app/partials/ContactView/ContactView.service.js +++ b/app/partials/ContactView/ContactView.service.js @@ -1,13 +1,42 @@ (function(){ 'use strict'; angular.module('acufuel') - .service('ContactViewService', ['$q', '$http', 'BE', ContactViewService]); + .service('ContactViewService', ['$q', '$http', 'BASE_URL', ContactViewService]); - function ContactViewService($q, $http, BE) { + function ContactViewService($q, $http, BASE_URL) { var temp = {}; + this.getContacts = function() { + + var deferred = $q.defer(); + $http({ + method : 'GET', + url : BASE_URL.url +'/user/allContacts', + headers : {'Content-Type': 'application/json'}, + }) + .then(function (result){ + deferred.resolve(result.data); + },function (result){ + deferred.resolve(result.data); + }) + return deferred.promise; + } - + this.getCompanies = function() { + + var deferred = $q.defer(); + $http({ + method : 'GET', + url : BASE_URL.url +'/user/allCompanies', + headers : {'Content-Type': 'application/json'}, + }) + .then(function (result){ + deferred.resolve(result.data); + },function (result){ + deferred.resolve(result.data); + }) + return deferred.promise; + } } })(); \ No newline at end of file diff --git a/app/partials/customers/customers.html b/app/partials/customers/customers.html index f89c2c8..34c45c0 100644 --- a/app/partials/customers/customers.html +++ b/app/partials/customers/customers.html @@ -2,73 +2,6 @@ .subnavbar .mainnav > li:nth-child(3) > a{ color: #ff9900; } - - .button1 { - display: inline-block; - height: 35px; - line-height: 35px; - padding-right: 15px; - padding-left: 50px; - position: relative; - background-color:rgb(41,127,184); - color:rgb(255,255,255); - text-decoration: none; - text-transform: uppercase; - letter-spacing: 1px; - margin-bottom: 15px; - border: 0; - - - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - text-shadow:0px 1px 0px rgba(0,0,0,0.5); - -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true)";zoom:1; - filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true); - - -moz-box-shadow:0px 2px 2px rgba(0,0,0,0.2); - -webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.2); - box-shadow:0px 2px 2px rgba(0,0,0,0.2); - -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true)"; - filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true); - } - - .button1 span { - position: absolute; - left: 0; - top: 0; - width: 35px; - background-color:rgba(0,0,0,0.5); - - -webkit-border-top-left-radius: 5px; - -webkit-border-bottom-left-radius: 5px; - -moz-border-radius-topleft: 5px; - -moz-border-radius-bottomleft: 5px; - border-top-left-radius: 5px; - border-bottom-left-radius: 5px; - border-right: 1px solid rgba(0,0,0,0.15); - } - - .button1:hover span, .button1.active span { - background-color:rgb(0,102,26); - border-right: 1px solid rgba(0,0,0,0.3); - } - - .button1:active { - margin-top: 2px; - margin-bottom: 13px; - - -moz-box-shadow:0px 1px 0px rgba(255,255,255,0.5); - -webkit-box-shadow:0px 1px 0px rgba(255,255,255,0.5); - box-shadow:0px 1px 0px rgba(255,255,255,0.5); - -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true)"; - filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true); - } - - .button1.turquoise { - background: #449d44; - } -
    @@ -100,7 +33,7 @@
    - +
    @@ -198,95 +131,6 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Last Name First Name Company Name Work Phone Mobile Phone Title Pricing Email Username Password
    Name and inc.303423233JemmyKIAD$123
    Name and inc.303423233JemmyKIAD$123
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - -
    EngineBrowser
    -
    @@ -301,7 +145,6 @@ -