sir one more issue how i will show a selected list of employees from database. in following code
(function () {
var controllerId = 'app.views.listofemployees';
angular.module('app').controller(controllerId, [
'$scope', '$location', 'abp.services.ameba.employee', function ($scope, $location, employeeService) {
var vm = this;
var id;
var persondetail
vm.employees = [];
var localize = abp.localization.getSource('Ameba');
$scope.detail = JSON.parse(sessionStorage.getItem("detail"));
var details = $scope.detail
for (var i = 0; i < details.length; i++)
{
persondetail = details[i];
console.log(persondetail.companyId);
}
vm.info = {
CompanyId: persondetail.companyId,
DesignationId:2
};
vm.refreshMember = function () {
employeeService.getEmployees(
vm.info
).success(function (data) {
debugger;
vm.employees = data.employees;
})
};
}]);
})();
i am getting error
please help
sir i want to show some information in somepages
i have a .js file with following coding
(function () {
var controllerId = 'app.views.listofemployees';
angular.module('app').controller(controllerId, [
'$scope', '$location', 'abp.services.ameba.employee', function ($scope, $location, employeeService) {
var vm = this;
var localize = abp.localization.getSource('Ameba');
$scope.detail = JSON.parse(sessionStorage.getItem("detail"));
employeeService.getEmployees(
$scope. detail
).success(function (data) {
vm.employees = data.employees;
In above coding i want to pass a $scope. detail to pass when employeeService.getEmployee method called.
sir please help me. waiting for a reply.
Above problem resolved. i want to know one thing i have a. loginpage with login.js in login folder in views folder.
through login.js i fetched the data by using following code
(function () {
var controllerId = 'logincontroller';
angular.module('app').controller(controllerId, [
'$scope', '$location', 'abp.services.practise.employee', function ($scope, $location, employeeService) {
var vm = this;
var localize = abp.localization.getSource('Practise');
vm.logininfo = {};
vm.employees = [];
vm.logincheck = function () {
employeeService.getEmployee(
vm.logininfo
).success(function (data) {
// debugger;
alert("success");
vm.employees = data.employees
$location.path('/dashboard');
})
};
}]);
})();
now by using $location.path to dashboard page now i want the collected information shown in dashboard cshtml page how i will do this...????
please help
this is my .js file
(function () {
var controllerId = 'logincontroller';
angular.module('app').controller(controllerId, [
'$scope', '$location', 'abp.services.practise.employee', function ($scope, $location, employeeService) {
var vm = this;
var localize = abp.localization.getSource('Practise');
vm.logininfo = {};
vm.employee = [];
vm.logincheck = function () {
employeeService.getEmployee(vm.logininfo).success(function (data) {
debugger;
alert("success");
vm.employee = data.employee
// $location.path('/dashboard');
})
};
}]);
})();
this is my class file coding.
public GetEmployeesOutput GetEmployee(GetEmployeesInput input)
{
var userinfo = _userRepository.GetAll().Where(m => m.EmailID == input.Email && m.Password == input.Password).FirstOrDefault();
var employee = _employeeRepository.GetAll().Where(p => p.UserId == userinfo.Id).FirstOrDefault();
var employeedetail = _employeeRepository.Get(employee.Id);
return new GetEmployeesOutput
{
Employee = Mapper.Map<EmployeeDto>(employeedetail)
};
}
this is my html page coding
<div ng-controller="logincontroller as vm">
<div class="logobox">
<table style="border-width:thick">
<tr>
<th>firstname</th>
<th>lastname</th>
</tr>
<tr ng-repeat="emp in vm.employee">
<td><input id="Text1" type="text" ng-model="emp.firstName" /></td>
<td><input id="Text2" type="text" ng-model="emp.lastName" /></td>
</tr>
</table>
</div>
</div>
no errors data is fetching on employee object visible in firefox debugger.
please reply sir.
sir this problem is resolved because there is such fields in the table which is not null and i am not inserting data.. thank you sir for your reply
yes sir i define mapping in all dtos this problem is resolve because i am fetching a single record and mapping is done with list<employee> . i removed the return type of the employee it works. thank you sir for your kind attention
please reply ...
Getting an error on following code:
public GetEmployeesOutput GetEmployee(GetEmployeesInput input)
{
var userinfo = _userRepository.GetAll().Where(m => m.EmailID == input.Email&&m.Password==input.Password).FirstOrDefault();
var user = _employeeRepository.GetAll().Where(m => m.UserId == userinfo.Id).ToList();
return new GetEmployeesOutput
{
Employee = Mapper.Map<List<EmployeeDto>>(user)
};
}
error is:
An exception of type 'AutoMapper.AutoMapperMappingException' occurred in AutoMapper.dll but was not handled in user code
this exception take place in
**return new GetEmployeesOutput
{
Employee = Mapper.Map<List<EmployeeDto>>(user)
};**
how we store data in two different table with one table primary key set as foreign key on second table with one method call.
public void CreateUser(CreateUserInput input)
{
var userinfo = new User
{
EmailID = input.EmailID,
Password = input.Password,
DateTimeLastUpdated = DateTime.Now,
DateTimeLastLogin = DateTime.Now,
IsActive = 0,
IsVerified = 0
};
userinfo.Id = _userRepository.InsertOrUpdateAndGetId(userinfo);
uid = userinfo.Id;
try
{
if (uid!= 0)
{
var companyinfo = new CompanyProfile
{
UserId = uid,
CompanyName = input.CompanyName
};
_companyprofileRepository.Insert(companyinfo);
}
}
catch (Exception ex)
{
throw ex;
}
getting internal error in this part