Merge pull request 'Employee Design-wise prod bonus report & employee long and short profile' (#18) from dev_mashfiq into devqc

Reviewed-on: http://103.197.204.162:3025/CelHRTeam/EchoTex_Payroll/pulls/18
This commit is contained in:
shamim 2024-12-11 17:13:32 +06:00
commit a95acdeaef
21 changed files with 1787 additions and 34 deletions

View File

@ -1128,7 +1128,16 @@ namespace HRM.BO
}
#endregion
#region Property NomineeMobileNo : string
private string _nomineeMobileNo;
public string NomineeMobileNo
{
get { return _nomineeMobileNo; }
set { _nomineeMobileNo = value; }
}
#endregion
public EnumProfileStatus ProfileStatus { get; set; }
public string NomineeStatus { get; set; }
public bool HasPicture { get; set; }

View File

@ -369,6 +369,7 @@ namespace HRM.BO
List<SearchEmployee> Find(SearchManager oManager);
List<SearchEmployee> FindCordinator(int? id, int? payrollTypeID);
List<SearchEmployee> FindEmpCodeName(int payrolltypeid, string code, string name);
List<SearchEmployee> FindEmpCodeNameForEmployeePicker(int payrolltypeid, string code, string name);
SearchEmployee get(int empid);
List<SearchEmployee> GetEmployeeNotYetUser(int payrollTypeID);
List<SearchEmployee> GetTeam(int employeeid);

View File

@ -676,16 +676,16 @@ namespace HRM.DA
tc.ExecuteNonQuery("INSERT INTO EmpNominee(" +
"EmployeeID, NomineeID, NominationPurposeID, NominationDate, Name, RelationID, " +
" Percentage, BirthDate, OccupationID, Address, TelePhone," +
" EmailAddress)" +
" EmailAddress, NomineeMobileNo)" +
" VALUES(" +
" %n, %n, %n, %d, %s, %n," +
" %n, %d, %n, %s, %s, %s)",
" %n, %d, %n, %s, %s, %s, %s)",
nominee.EmployeeID, nominee.ID, nominee.NominationPurposeID,
DataReader.GetNullValue(nominee.NominationDate), nominee.Name,
DataReader.GetNullValue(nominee.RelationID, 0),
nominee.Percentage, DataReader.GetNullValue(nominee.BirthDate),
DataReader.GetNullValue(nominee.OccupationID, 0), nominee.Address, nominee.TelePhone,
nominee.EmailAddress);
nominee.EmailAddress, nominee.NomineeMobileNo);
}
public static void Update(TransactionContext tc, EmpNominee nominee)
@ -700,8 +700,9 @@ namespace HRM.DA
,[ADDRESS] = %s
,[TELEPHONE] = %s
,[EMAILADDRESS] = %s
,[NomineeMobileNo] = %s
WHERE NOMINEEID = %n", nominee.ID, nominee.NominationPurposeID, nominee.Name, nominee.RelationID,
nominee.Percentage, nominee.OccupationID, nominee.Address, nominee.TelePhone, nominee.EmailAddress,
nominee.Percentage, nominee.OccupationID, nominee.Address, nominee.TelePhone, nominee.EmailAddress, nominee.NomineeMobileNo,
nominee.ID);
}
@ -943,6 +944,7 @@ namespace HRM.DA
,[PHOTOPATH]
,[TELEPHONE]
,[EMAILADDRESS]
,[NomineeMobileNo]
,[SIGNATURE]
,[EMPLOYEEID]
,[NOMINEENAME]

View File

@ -231,6 +231,7 @@ END;";
{
string orderby = "name";
string sqlClause = "";
string top = "";
sqlClause = SQLParser.TagSQL(sqlClause) + SQLParser.MakeSQL("PayrollTypeID =%n AND Status = %n", payrollTypeID, EnumStatus.Active);
if (code != string.Empty)
{
@ -242,8 +243,41 @@ END;";
sqlClause = SQLParser.TagSQL(sqlClause) + SQLParser.MakeSQL("Name LIKE %s", ("%" + name + "%"));
return tc.ExecuteReader(
"Select EmployeeID, EmployeeNo, Name, categoryID, GradeID, LocationID, designationid, DepartmentID From Employee %q Order by %s",
sqlClause, orderby);
"Select %q EmployeeID, EmployeeNo, Name, categoryID, GradeID, LocationID, designationid, DepartmentID From Employee %q Order by %s",
top, sqlClause, orderby);
}
internal static IDataReader SearchForEmployeePicker(TransactionContext tc, int payrollTypeID, string code, string name)
{
string orderby = "name";
string sqlClause = "";
string top = "";
//Previous Code For only Live Employee
//sqlClause = SQLParser.TagSQL(sqlClause) + SQLParser.MakeSQL("PayrollTypeID =%n AND Status = %n", payrollTypeID, EnumStatus.Active);
//New Code For live And Waitiong for join Employee
sqlClause = SQLParser.TagSQL(sqlClause) + SQLParser.MakeSQL("PayrollTypeID =%n AND (Status = %n OR Status = %n)", payrollTypeID, EnumEmployeeStatus.Live, EnumEmployeeStatus.Waitingforjoin);
if (code != string.Empty)
{
//Previous with suggestion
//sqlClause = SQLParser.TagSQL(sqlClause) + SQLParser.MakeSQL("EmployeeNo LIKE %s", ("%" + code + "%"));
//orderby = "EmployeeNo";
//Using TOP
sqlClause = SQLParser.TagSQL(sqlClause) + SQLParser.MakeSQL("EmployeeNo LIKE %s", ( code + "%"));
orderby = "EmployeeNo";
top = "TOP 50";
//Without suggestion
//sqlClause = SQLParser.TagSQL(sqlClause) + SQLParser.MakeSQL("EmployeeNo = %s", code );
//orderby = "EmployeeNo";
}
if (name != string.Empty)
sqlClause = SQLParser.TagSQL(sqlClause) + SQLParser.MakeSQL("Name LIKE %s", ("%" + name + "%"));
return tc.ExecuteReader(
"Select %q EmployeeID, EmployeeNo, Name, categoryID, GradeID, LocationID, designationid, DepartmentID From Employee %q Order by %s",
top, sqlClause, orderby);
}
#endregion

View File

@ -551,6 +551,7 @@ namespace HRM.DA
oEmpNominee.TelePhone = oReader.GetString("TelePhone");
oEmpNominee.EmailAddress = oReader.GetString("EmailAddress");
oEmpNominee.NomineeMobileNo = oReader.GetString("NomineeMobileNo", true, string.Empty);
oEmpNominee.ProfileStatus = (EnumProfileStatus)oReader.GetInt32("ProfileStatus", true, 0);
oEmpNominee.HasPicture = oReader.GetBoolean("HasPicture", true, false);
oEmpNominee.HasSignature = oReader.GetBoolean("HasSignature", true, false);

View File

@ -288,6 +288,43 @@ namespace HRM.DA
return searchEmployees;
}
public List<SearchEmployee> FindEmpCodeNameForEmployeePicker(int payrollTypeID, string code, string name)
{
List<SearchEmployee> searchEmployees = new List<SearchEmployee>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader dr = new DataReader(SearchEmployeeDA.SearchForEmployeePicker(tc, payrollTypeID, code, name));
searchEmployees = this.CreateObjects<SearchEmployee>(dr);
//while (dr.Read())
//{
// SearchEmployee item = new SearchEmployee();
// item.Name = dr.GetString("name");
// item.EmployeeNo = dr.GetString("employeeNo");
// searchEmployees.Add(item);
//}
dr.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return searchEmployees;
}
public List<SearchEmployee> GetEmployeeNotYetUser(int payrollTypeID)

View File

@ -276,7 +276,9 @@ namespace HRM.Report
dSet.Tables.Add(dTable);
//string RDLC = "Payroll.Report.RDLC.rptEmpDesignWiseProdBonus.rdlc";
string RDLC = "rptEmpDesignWiseProdBonus.rdlc";
//string RDLC = "rptEmpDesignWiseProdBonusOld.rdlc";
List<ReportParameter> _reportParameters = new List<ReportParameter>();
ReportParameter rParam = new ReportParameter("Month", dBonusMonth.ToString("MMM yyyy"));

View File

@ -235,6 +235,7 @@
<None Remove="RDLC\rptCurrentMonthDueLoan.rdlc" />
<None Remove="RDLC\rptEmpAcademicInfo.rdlc" />
<None Remove="RDLC\rptEmpDesignWiseProdBonus.rdlc" />
<None Remove="RDLC\rptEmpDesignWiseProdBonusOld.rdlc" />
<None Remove="RDLC\rptEmpGeneralInfo.rdlc" />
<None Remove="RDLC\rptEmployeeChildInfo.rdlc" />
<None Remove="RDLC\rptEmployeeContactInfo.rdlc" />
@ -519,7 +520,12 @@
<EmbeddedResource Include="RDLC\rptCCWiseSalarySummaryExpat.rdlc" />
<EmbeddedResource Include="RDLC\rptCurrentMonthDueLoan.rdlc" />
<EmbeddedResource Include="RDLC\rptEmpAcademicInfo.rdlc" />
<EmbeddedResource Include="RDLC\rptEmpDesignWiseProdBonus.rdlc" />
<EmbeddedResource Include="RDLC\rptEmpDesignWiseProdBonus.rdlc">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="RDLC\rptEmpDesignWiseProdBonusOld.rdlc">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="RDLC\rptEmpGeneralInfo.rdlc" />
<EmbeddedResource Include="RDLC\rptEmployeeChildInfo.rdlc" />
<EmbeddedResource Include="RDLC\rptEmployeeContactInfo.rdlc" />

View File

@ -162,7 +162,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>="Department: " &amp;Fields!Department.Value</Value>
<Value>="Design No: " &amp;Fields!DesignNo.Value</Value>
<Style />
</TextRun>
</TextRuns>
@ -1656,7 +1656,7 @@
<TablixMember>
<Group Name="table1_Group1">
<GroupExpressions>
<GroupExpression>=Fields!DepartmentID.Value</GroupExpression>
<GroupExpression>=Fields!DesignNo.Value</GroupExpression>
</GroupExpressions>
</Group>
<TablixMembers>

File diff suppressed because it is too large Load Diff

View File

@ -138,7 +138,7 @@ export class Employee {
this.taxCircle = EnumTaxCircle.CityCorporation;
this.isConfirmed = false;
this.endOfContractDate = null;
this.status = EnumEmployeeStatus.Live;
this.status = EnumEmployeeStatus.Waitingforjoin;
this.statusName = '';
this.isShownInTaxSheet = false;
this.pfMemberType = EnumPFMembershipType.NotYetLive;
@ -219,6 +219,9 @@ export class Employee {
case EnumEmployeeStatus.Discontinued:
str = "Discontinued";
break;
case EnumEmployeeStatus.Waitingforjoin:
str = "Waiting For Join";
break;
default:
}

View File

@ -19,6 +19,7 @@ export class EmpNominee extends BaseObject {
occupation: Occupation;
address: string;
telePhone: string;
nomineeMobileNo: string;
photograph: empFileuploads;
signature: empFileuploads;
emailAddress: string;
@ -40,6 +41,7 @@ export class EmpNominee extends BaseObject {
this.photograph = new empFileuploads();
this.signature = new empFileuploads();
this.emailAddress = '';
this.nomineeMobileNo = '';
this.hasSignature = false;
this.hasPicture = false;
}

View File

@ -99,6 +99,13 @@ export class EmployeeServices {
return this.apiService.httpGet<SearchEmployee[]>('/Employee/getEmpCodeName' + '/' + ncode + '/' + nname);
}
getEmpCodeNameForEmployeePickerInput(code?: string, name?: string) {
let nname = this.apiService.getApiDefaultData(name);
let ncode = this.apiService.getApiDefaultData(code);
return this.apiService.httpGet<SearchEmployee[]>('/Employee/getEmpCodeNameForEmployeePickerInput' + '/' + ncode + '/' + nname);
}
getEmployees() {
return this.apiService.httpGet(this.apiService.base_url + 'getemployees');
}

View File

@ -32,10 +32,10 @@
pInputText style="width:100%" />
</div>
<div class="p-col-12 p-md-6 p-lg-2" >
<div class="p-col-12 p-md-6 p-lg-2" style="margin: auto;">
<label>Relation</label>
</div>
<div class="p-col-12 p-md-6 p-lg-4" style="margin: auto;">
<div class="p-col-12 p-md-6 p-lg-4">
<kendo-dropdownlist [(ngModel)]="nominee.relationID" [data]="relations"
[defaultItem]="{ description: 'Select Relations..', value: null }" [textField]="'description'"
[valueField]="'id'" [valuePrimitive]="true" class="form-control form-control-sm input-sm"
@ -46,15 +46,15 @@
<div class="p-col-12 p-md-6 p-lg-2" style="margin: auto;">
<label for="txtPercentage">Percentage</label>
</div>
<div class="p-col-12 p-md-6 p-lg-4" >
<div class="p-col-12 p-md-6 p-lg-4">
<input id="txtPercentage" formControlName="percentage" [(ngModel)]="nominee.percentage"
type="number" pInputText style="width:100%" />
</div>
<div class="p-col-12 p-md-6 p-lg-2" >
<div class="p-col-12 p-md-6 p-lg-2" style="margin: auto;">
<label for="dtpDateOfBirth">Birth Date</label>
</div>
<div class="p-col-12 p-md-6 p-lg-4" style="margin: auto;">
<div class="p-col-12 p-md-6 p-lg-4">
<kendo-datepicker [(ngModel)]="nominee.birthDate" [format]="'dd-MMM-yyyy'"
formControlName="dateOfBirth" id="dtpDateOfBirth" style="width:100%"></kendo-datepicker>
</div>
@ -62,7 +62,7 @@
<div class="p-col-12 p-md-6 p-lg-2" style="margin: auto;">
<label>Occupation</label>
</div>
<div class="p-col-12 p-md-6 p-lg-4" >
<div class="p-col-12 p-md-6 p-lg-4">
<kendo-dropdownlist [(ngModel)]="nominee.occupationID" [data]="occupations"
[defaultItem]="{ description: 'Select Occupations..', value: null }" [textField]="'description'"
[valueField]="'id'" [valuePrimitive]="true" class="form-control form-control-sm input-sm"
@ -70,10 +70,10 @@
</kendo-dropdownlist>
</div>
<div class="p-col-12 p-md-6 p-lg-2" >
<div class="p-col-12 p-md-6 p-lg-2" style="margin: auto;">
<label for="txtAddress">Address</label>
</div>
<div class="p-col-12 p-md-6 p-lg-4" style="margin: auto;">
<div class="p-col-12 p-md-6 p-lg-4">
<input id="txtAddress" formControlName="address" [(ngModel)]="nominee.address" type="text"
pInputText style="width:100%" />
</div>
@ -86,10 +86,18 @@
pInputText style="width:100%" />
</div>
<div class="p-col-12 p-md-6 p-lg-2" >
<div class="p-col-12 p-md-6 p-lg-2" style="margin: auto;">
<label for="txtNomineeMobileNo">Mobile</label>
</div>
<div class="p-col-12 p-md-6 p-lg-4">
<input id="txtNnomineeMobileNo" formControlName="mobile" [(ngModel)]="nominee.nomineeMobileNo" type="text"
pInputText style="width:100%" />
</div>
<div class="p-col-12 p-md-6 p-lg-2" style="margin: auto;">
<label for="txtEmail">Email</label>
</div>
<div class="p-col-12 p-md-6 p-lg-4" style="margin: auto;">
<div class="p-col-12 p-md-6 p-lg-4">
<input id="txtEmail" formControlName="email" [(ngModel)]="nominee.emailAddress" type="text"
pInputText style="width:100%" />
</div>
@ -97,19 +105,21 @@
<div class="p-col-12 p-md-6 p-lg-2" style="margin: auto;">
<label for="fupPicture">Picture</label>
</div>
<div class="p-col-12 p-md-6 p-lg-4" >
<div class="p-col-12 p-md-6 p-lg-4">
<input formControlName="picturePath" pInputText style="width:100%" (change)="selectPicture($event)"
type="file">
</div>
<div class="p-col-12 p-md-6 p-lg-2" >
<div class="p-col-12 p-md-6 p-lg-2" style="margin: auto;">
<label for="fupSignature">Signature</label>
</div>
<div class="p-col-12 p-md-6 p-lg-4" style="margin: auto;">
<div class="p-col-12 p-md-6 p-lg-4">
<input formControlName="signaturePath" pInputText (change)="selectSignature($event)" type="file"
style="width:100%">
</div>
<div class="p-col-12 p-md-6 p-lg-6" ></div>
</div>
</div>
</fieldset>

View File

@ -90,6 +90,7 @@ export class NomineeEntryComponent implements OnInit {
email: [''],
picturePath: [''],
signaturePath: [''],
mobile: [''],
});
}

View File

@ -67,12 +67,12 @@
</ng-template>
</kendo-grid-command-column>
<kendo-grid-command-column title="Action" width="100">
<ng-template kendoGridCellTemplate let-dataItem>
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
<button
kendoGridEditCommand
icon="pencil"
[primary]="true"
(click)="editHandler(dataItem)"
(click)="editHandler(rowIndex)"
[style.width.%]="49"
></button>
<button

View File

@ -89,6 +89,7 @@ export class NomineeListComponent implements OnInit {
this.isDisplay = true;
}
public editHandler(rowIndex: any) {
debugger
this.editIndex = rowIndex;
this.nominee = this.nominees[this.editIndex];
this.isDisplay = true;

View File

@ -73,10 +73,26 @@
style="width:100%"></kendo-datepicker>
</div>
<div class="p-col-12 p-md-6 p-lg-4" style="margin:auto">
<label for="txtfatherName">Father's Name</label>
</div>
<div class="p-col-12 p-md-6 p-lg-8 form-control-lg">
<input id="txtfatherName" formControlName="fatherName" [(ngModel)]="employee.fatherName" type="text"
style="width:100%" pInputText>
</div>
<div class="p-col-12 p-md-6 p-lg-4" style="margin:auto">
<label for="txttinNo">TIN</label>
</div>
<div class="p-col-12 p-md-6 p-lg-8 form-control-lg">
<input id="txttinNo" formControlName="tinNo" [(ngModel)]="employee.tinNo" type="text"
style="width:100%" pInputText>
</div>
<div class="p-col-12 p-md-6 p-lg-4" style="height: 43px;">
<label for="chkIsOTEligible">Eligible for OT</label>
</div>
<div class="p-col-12 p-md-6 p-lg-8 form-control-lg">
<div class="p-col-12 p-md-6 p-lg-2 form-control-lg">
<input type="checkbox" formControlName="isOTEligible" [(ngModel)]="employee.isEligibleOT"
id="chkIsOTEligible" kendoCheckBox />
@ -85,7 +101,7 @@
<label for="chkIsFixedLocation">Fixed Location /
Nearby</label>
</div>
<div class="p-col-12 p-md-6 p-lg-8 form-control-lg">
<div class="p-col-12 p-md-6 p-lg-2 form-control-lg">
<input type="checkbox" formControlName="IsFixedLocation"
[(ngModel)]="employee.isFixedLocation" id="chkIsFixedLocation" kendoCheckBox />
</div>
@ -188,6 +204,15 @@
[(ngModel)]="employee.joiningDate" [format]="'dd-MMM-yyyy'"
style="width:100%"></kendo-datepicker>
</div>
<div class="p-col-12 p-md-6 p-lg-4" style="margin:auto">
<label for="dtpEndofContract">End of Contract</label>
</div>
<div class="p-col-12 p-md-6 p-lg-8 form-control-lg">
<kendo-datepicker id="dtpEndofContract" formControlName="endOfContractDate"
[(ngModel)]="employee.endOfContractDate" [format]="'dd-MMM-yyyy'"
style="width:100%"></kendo-datepicker>
</div>
</div>
</div>

View File

@ -250,6 +250,9 @@ export class EmployeePayrollProfileComponent implements OnInit {
isShownInTaxSheet: [''],
isConfirmed: [''],
foreignExpatriate: [''],
fatherName: [''],
tinNo: [''],
endOfContractDate: [''],
});
}

View File

@ -260,7 +260,8 @@ export class EmployeePickerComponent implements OnInit {
];
public loadData(): void {
this.gridView = {
data: orderBy(this.data.slice(this.skip, this.skip + this.pageSize), this.sort),
// data: orderBy(this.data.slice(this.skip, this.skip + this.pageSize), this.sort),
data: this.data.slice(this.skip, this.skip + this.pageSize),
total: this.data.length,
};
this.selectedItems = [];
@ -454,7 +455,8 @@ export class EmployeePickerComponent implements OnInit {
name = value;
}
this.loadingEmployee = true;
this.empSrvc.getEmpCodeName(code, name)
// this.empSrvc.getEmpCodeName(code, name)
this.empSrvc.getEmpCodeNameForEmployeePickerInput(code, name)
.subscribe(
(resp: any) => {
this.searchEmployees = resp;
@ -602,10 +604,18 @@ export class EmployeePickerComponent implements OnInit {
}
if (this.checkLive === true) {
//Previous Code For Only Live Employee
srcManager.Parameter.AddParam(EnumSearchParameter.Status, EnumSearchObjDataType.Number, 1, EnumSQLOperator.EqualTo);
//New Code For Live And Waiting For Join
// srcManager.Parameter.AddParam(EnumSearchParameter.Status, EnumSearchObjDataType.Number, '1,6', EnumSQLOperator.In);
}
if (this.checkLiveNo === true) {
srcManager.Parameter.AddParam(EnumSearchParameter.Status, EnumSearchObjDataType.Number, 2, EnumSQLOperator.EqualTo);
//Previous Code For Only Not Live
// srcManager.Parameter.AddParam(EnumSearchParameter.Status, EnumSearchObjDataType.Number, 2, EnumSQLOperator.EqualTo);
//New Code For Live And Waiting For Join
srcManager.Parameter.AddParam(EnumSearchParameter.Status, EnumSearchObjDataType.Number, '2,6', EnumSQLOperator.In);
}
if (this.checkIA === true)
srcManager.Parameter.AddParam(EnumSearchParameter.Status, EnumSearchObjDataType.Number, EnumEmployeeStatus.IA, EnumSQLOperator.EqualTo);

View File

@ -17,6 +17,7 @@ using Microsoft.Extensions.Options;
using static Azure.Core.HttpHeader;
using iTextSharp.text;
using static iTextSharp.text.pdf.AcroFields;
using Org.BouncyCastle.Utilities;
namespace HRM.UI.Controllers
{
@ -132,8 +133,11 @@ namespace HRM.UI.Controllers
omanager.checkDataPermission = currentUser.hasDataPermission;
omanager.userid = currentUser.UserID;
List<SearchEmployee> unOrderedList = _serachManager.Find(omanager);
olist = unOrderedList
.OrderBy(num => num.EmployeeNo.Length) // Order by length (smallest to largest)
.ThenBy(num => Convert.ToInt32(num.EmployeeNo)).ToList();
olist = _serachManager.Find(omanager);
//omanager.checkDataPermission = false;
#region data permission
//List<DataPermission> datapermissions = new DataPermissionService().Get(currentUser.UserID,
@ -733,7 +737,20 @@ namespace HRM.UI.Controllers
List<SearchEmployee> olist = new List<SearchEmployee>();
try
{
olist = _serachManager.FindEmpCodeName((int) currentUser.PayrollTypeID, code, name);
//olist = _serachManager.FindEmpCodeName((int) currentUser.PayrollTypeID, code, name);
if(code != "")
{
List<SearchEmployee> unorderedList = _serachManager.FindEmpCodeName((int)currentUser.PayrollTypeID, code, name);
olist = unorderedList
.OrderBy(item => item.EmployeeNo != code) // False (0) for priority value, True (1) for others
.ThenBy(item => item.EmployeeNo).ToList();
}
else
{
olist = _serachManager.FindEmpCodeName((int)currentUser.PayrollTypeID, code, name);
}
//List<Grade> grades = new GradeService().Get(EnumStatus.Regardless, (int)currentUser.PayrollTypeID);
//List<Designation> designations = new DesignationService().Get(EnumStatus.Regardless, (int)currentUser.PayrollTypeID);
//List<Department> departments = new DepartmentService().Get(EnumStatus.Regardless, (int)currentUser.PayrollTypeID);
@ -746,7 +763,55 @@ namespace HRM.UI.Controllers
// if (designation != null) x.designationName = designation.Name;
// var department = departments.FirstOrDefault(d => d.ID == x.DepartmentID);
// if (department != null) x.departmentName = department.Name;
//});
//}); // Secondary ordering (alphabetical)
}
catch (Exception ex)
{
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
}
return Ok(olist);
}
[HttpGet("getEmpCodeNameForEmployeePickerInput/{code}/{name}")]
public ActionResult getEmpCodeNameForEmployeePicker(string code, string name)
{
code = GlobalFunctions.GetApiDefaultData(code);
name = GlobalFunctions.GetApiDefaultData(name);
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
List<SearchEmployee> olist = new List<SearchEmployee>();
try
{
//olist = _serachManager.FindEmpCodeName((int) currentUser.PayrollTypeID, code, name);
if(code != "")
{
List<SearchEmployee> unorderedList = _serachManager.FindEmpCodeNameForEmployeePicker((int)currentUser.PayrollTypeID, code, name);
olist = unorderedList
.OrderBy(item => item.EmployeeNo != code) // False (0) for priority value, True (1) for others
.ThenBy(item => item.EmployeeNo).ToList();
}
else
{
olist = _serachManager.FindEmpCodeNameForEmployeePicker((int)currentUser.PayrollTypeID, code, name);
}
//List<Grade> grades = new GradeService().Get(EnumStatus.Regardless, (int)currentUser.PayrollTypeID);
//List<Designation> designations = new DesignationService().Get(EnumStatus.Regardless, (int)currentUser.PayrollTypeID);
//List<Department> departments = new DepartmentService().Get(EnumStatus.Regardless, (int)currentUser.PayrollTypeID);
//olist.ForEach(x=>
//{
// var grd = grades.FirstOrDefault(d => d.ID == x.GradeID);
// if(grd != null) x.gradeName = grd.Name;
// var designation = designations.FirstOrDefault(d => d.ID == x.designationID);
// if (designation != null) x.designationName = designation.Name;
// var department = departments.FirstOrDefault(d => d.ID == x.DepartmentID);
// if (department != null) x.departmentName = department.Name;
//}); // Secondary ordering (alphabetical)
}
catch (Exception ex)
{