manual entry
This commit is contained in:
parent
5e569492ba
commit
dc1309640f
|
@ -441,20 +441,21 @@ namespace HRM.BO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool OnlyManualInTime
|
//public bool OnlyManualInTime
|
||||||
{
|
//{
|
||||||
get {
|
// get {
|
||||||
return (this.IsManualEntry == true && this.ActualInTime != null) ? true : false;}
|
// return (this.IsManualEntry == true && this.ActualInTime != null) ? true : false;}
|
||||||
|
|
||||||
}
|
|
||||||
public bool OnlyManualOutTime
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return (this.IsManualEntry == true && this.ActualOutTime != null) ? true : false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//}
|
||||||
|
//public bool OnlyManualOutTime
|
||||||
|
//{
|
||||||
|
// get
|
||||||
|
// {
|
||||||
|
// return (this.IsManualEntry == true && this.ActualOutTime != null) ? true : false;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
public bool OnlyManualInTime { get; set; }
|
||||||
|
public bool OnlyManualOutTime { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -3382,6 +3383,7 @@ namespace HRM.BO
|
||||||
DataTable getTopEmpAbsentData(Employee oEmp, EnumAttendanceType type);
|
DataTable getTopEmpAbsentData(Employee oEmp, EnumAttendanceType type);
|
||||||
DataTable getcorehrAbsentData(Employee oEmp, EnumAttendanceType type);
|
DataTable getcorehrAbsentData(Employee oEmp, EnumAttendanceType type);
|
||||||
DataSet AttnDaysSummaryForSalaryProcess(DateTime FromDate, DateTime ToDate);
|
DataSet AttnDaysSummaryForSalaryProcess(DateTime FromDate, DateTime ToDate);
|
||||||
|
List<DailyAttnProcess> GetByEmployees(DateTime attnDate, string employeeIDs);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -4092,6 +4092,11 @@ namespace HRM.DA
|
||||||
|
|
||||||
return ds.Tables[0];
|
return ds.Tables[0];
|
||||||
}
|
}
|
||||||
|
internal static IDataReader GetByEmployees(TransactionContext tc, DateTime attnDate, string employeeIDs)
|
||||||
|
{
|
||||||
|
return tc.ExecuteReader("SELECT * FROM DailyAttnProcess WHERE AttnDate=%d And employeeid in (%q)", attnDate, employeeIDs);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,9 @@ namespace HRM.DA
|
||||||
oDailyAttnProcess.AttenType = (EnumAttendanceType)oReader.GetInt32("AttenType").Value;
|
oDailyAttnProcess.AttenType = (EnumAttendanceType)oReader.GetInt32("AttenType").Value;
|
||||||
oDailyAttnProcess.Comments = oReader.GetString("Comments") == null ? "" : oReader.GetString("Comments");
|
oDailyAttnProcess.Comments = oReader.GetString("Comments") == null ? "" : oReader.GetString("Comments");
|
||||||
oDailyAttnProcess.Reason = oReader.GetString("Reason") == null ? "" : oReader.GetString("Reason");
|
oDailyAttnProcess.Reason = oReader.GetString("Reason") == null ? "" : oReader.GetString("Reason");
|
||||||
oDailyAttnProcess.IsManualEntry = oReader.GetBoolean("IsManualEntry").Value;
|
oDailyAttnProcess.IsManualEntry = oReader.GetBoolean("IsManualEntry", false);
|
||||||
|
oDailyAttnProcess.OnlyManualInTime = oReader.GetBoolean("OnlyManualInTime", false);
|
||||||
|
oDailyAttnProcess.OnlyManualOutTime = oReader.GetBoolean("OnlyManualOutTime").Value;
|
||||||
oDailyAttnProcess.IsFromMobile = (EnumIsFromMobile)oReader.GetInt32("IsFromMobile").Value;
|
oDailyAttnProcess.IsFromMobile = (EnumIsFromMobile)oReader.GetInt32("IsFromMobile").Value;
|
||||||
oDailyAttnProcess.InTimeLatitude = oReader.GetString("InTimeLatitude") == null ? 0.0m : Convert.ToDecimal(oReader.GetString("InTimeLatitude"));
|
oDailyAttnProcess.InTimeLatitude = oReader.GetString("InTimeLatitude") == null ? 0.0m : Convert.ToDecimal(oReader.GetString("InTimeLatitude"));
|
||||||
oDailyAttnProcess.OutTimeLatitude = oReader.GetString("OutTimeLatitude") == null ? 0.0m : Convert.ToDecimal(oReader.GetString("OutTimeLatitude"));
|
oDailyAttnProcess.OutTimeLatitude = oReader.GetString("OutTimeLatitude") == null ? 0.0m : Convert.ToDecimal(oReader.GetString("OutTimeLatitude"));
|
||||||
|
@ -4807,6 +4809,29 @@ namespace HRM.DA
|
||||||
return dt;
|
return dt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<DailyAttnProcess> GetByEmployees(DateTime attnDate, string employeeIDs)
|
||||||
|
{
|
||||||
|
List<DailyAttnProcess> dailyAttnProcesses = new List<DailyAttnProcess>();
|
||||||
|
TransactionContext tc = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
tc = TransactionContext.Begin();
|
||||||
|
DataReader dr = new DataReader(DailyAttnProcessDA.GetByEmployees(tc, attnDate, employeeIDs));
|
||||||
|
dailyAttnProcesses = this.CreateObjects<DailyAttnProcess>(dr);
|
||||||
|
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 dailyAttnProcesses;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1331,6 +1331,93 @@ namespace HRM.UI.Controllers.Attendance
|
||||||
|
|
||||||
return Ok(attnProcesses);
|
return Ok(attnProcesses);
|
||||||
}
|
}
|
||||||
|
[HttpPost("getDailyAttnProcessByEmpForManualEntry")]
|
||||||
|
public ActionResult getDailyAttnProcessByEmpForManualEntry(dynamic data)
|
||||||
|
{
|
||||||
|
List<DailyAttnProcess> _dAttnProcessess = new List<DailyAttnProcess>();
|
||||||
|
DailyAttnProcess _dAttnProcess = new DailyAttnProcess();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
||||||
|
string empids = "";
|
||||||
|
DateTime attnDate = DateTime.Today;
|
||||||
|
List<int> empIdList = new List<int>();
|
||||||
|
foreach (var item in items)
|
||||||
|
{
|
||||||
|
int empID = (int)item["employeeid"].ToObject<int>();
|
||||||
|
empids = empids + empID.ToString() + ",";
|
||||||
|
attnDate = (DateTime)item["attnDate"].ToObject<DateTime>();
|
||||||
|
empIdList.Add(empID);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empids.Length > 0)
|
||||||
|
{
|
||||||
|
empids = empids.Substring(0, empids.Length - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
attnDate = new DateTime(attnDate.Year, attnDate.Month, attnDate.Day);
|
||||||
|
List<DailyAttnProcess> dAttnProcessess = this._dailyAttnProcessService.GetByEmployees(attnDate, empids);
|
||||||
|
|
||||||
|
|
||||||
|
//List<DailyAttnProcess> DailyAttnProcesses = new List<DailyAttnProcess>();
|
||||||
|
|
||||||
|
foreach (var empid in empIdList)
|
||||||
|
{
|
||||||
|
bool existInList = false;
|
||||||
|
foreach (DailyAttnProcess dattnPs in _dAttnProcessess)
|
||||||
|
{
|
||||||
|
if (dattnPs.EmployeeID == empid)
|
||||||
|
{
|
||||||
|
existInList = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!existInList)
|
||||||
|
{
|
||||||
|
bool ExistInSavedData = false;
|
||||||
|
if (dAttnProcessess != null && dAttnProcessess.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (DailyAttnProcess dAttnProcess in dAttnProcessess)
|
||||||
|
{
|
||||||
|
if (dAttnProcess.EmployeeID == empid)
|
||||||
|
{
|
||||||
|
ExistInSavedData = true;
|
||||||
|
_dAttnProcessess.Add(dAttnProcess);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ExistInSavedData)
|
||||||
|
{
|
||||||
|
_dAttnProcess = new DailyAttnProcess();
|
||||||
|
|
||||||
|
_dAttnProcess.EmployeeID = empid;
|
||||||
|
//_dAttnProcess.Employee.EmployeeNo = sEmp.Employee.EmployeeNo;
|
||||||
|
//_dAttnProcess.Employee.Name = sEmp.Employee.Name;
|
||||||
|
_dAttnProcessess.Add(_dAttnProcess);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (_dAttnProcessess != null && _dAttnProcessess.Count > 0)
|
||||||
|
{
|
||||||
|
int serial = 1;
|
||||||
|
foreach (DailyAttnProcess dAttnProcess in _dAttnProcessess)
|
||||||
|
{
|
||||||
|
if (dAttnProcess.IsNew)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Ok(_dAttnProcessess);
|
||||||
|
}
|
||||||
|
|
||||||
// DailyAttnProcess
|
// DailyAttnProcess
|
||||||
[HttpGet("getDailyAttnProcessByEmployeeId/{employeeId}")]
|
[HttpGet("getDailyAttnProcessByEmployeeId/{employeeId}")]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user