本文整理汇总了C#中HRM.Business.Hr.Domain.Hre_ProfileServices.GetData方法的典型用法代码示例。如果您正苦于以下问题:C# Hre_ProfileServices.GetData方法的具体用法?C# Hre_ProfileServices.GetData怎么用?C# Hre_ProfileServices.GetData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HRM.Business.Hr.Domain.Hre_ProfileServices
的用法示例。
在下文中一共展示了Hre_ProfileServices.GetData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ActionApproved
public string ActionApproved(string selectedIds, string userLogin)
{
using (var context = new VnrHrmDataContext())
{
string message = string.Empty;
var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
var repo = new Hre_StopWorkingRepository(unitOfWork);
var profileServices = new Hre_ProfileServices();
string status = string.Empty;
List<Guid> lstIds = selectedIds.Split(',').Select(x => Guid.Parse(x)).ToList();
var lstStopWorkings = repo.FindBy(m => m.ID != null && lstIds.Contains(m.ID)).ToList();
foreach (var StopWorking in lstStopWorkings)
{
if (StopWorking.StopWorkType == HRM.Infrastructure.Utilities.EnumDropDown.StopWorkType.E_STOP.ToString())
{
var profile = profileServices.GetData<Hre_ProfileEntity>(Common.DotNetToOracle(StopWorking.ProfileID.ToString()), ConstantSql.hrm_hr_sp_get_ProfileById, userLogin, ref status).FirstOrDefault();
StopWorking.LastStatusSyn = profile.StatusSyn;
profile.StatusSyn = HRM.Infrastructure.Utilities.EnumDropDown.StopWorkType.E_STOP.ToString();
StopWorking.Status = HRM.Infrastructure.Utilities.EnumDropDown.StopWorkStatus.E_APPROVED.ToString();
profile.TypeSuspense = StopWorking.TypeSuspense;
profile.RequestDate = StopWorking.RequestDate;
profile.StopWorkType = StopWorking.StopWorkType;
profile.DateQuit = StopWorking.DateStop;
profile.ResReasonID = StopWorking.ResignReasonID;
profile.IsHoldSal = StopWorking.IsHoldSal;
profile.TypeOfStop = StopWorking.TypeOfStop;
profile.ResignNo = StopWorking.DecisionNo;
profileServices.Edit(profile);
}
else if (StopWorking.StopWorkType == HRM.Infrastructure.Utilities.EnumDropDown.StopWorkType.E_SUSPENSE.ToString())
{
var profile = profileServices.GetData<Hre_ProfileEntity>(Common.DotNetToOracle(StopWorking.ProfileID.ToString()), ConstantSql.hrm_hr_sp_get_ProfileById, userLogin, ref status).FirstOrDefault();
profile.StatusSyn = HRM.Infrastructure.Utilities.EnumDropDown.StopWorkType.E_SUSPENSE.ToString();
profile.TypeOfStop = HRM.Infrastructure.Utilities.EnumDropDown.StopWorkType.E_SUSPENSE.ToString();
StopWorking.LastStatusSyn = profile.StatusSyn;
StopWorking.Status = HRM.Infrastructure.Utilities.EnumDropDown.StopWorkStatus.E_APPROVED.ToString();
profile.TypeSuspense = StopWorking.TypeSuspense;
profile.RequestDate = StopWorking.RequestDate;
profile.StopWorkType = StopWorking.StopWorkType;
profile.DateQuit = StopWorking.DateStop;
profile.ResReasonID = StopWorking.ResignReasonID;
profile.ResignNo = StopWorking.DecisionNo;
profile.IsHoldSal = null;
profileServices.Edit(profile);
}
}
repo.SaveChanges();
message = NotificationType.Success.ToString();
return message;
}
}
示例2: Approved
/// <summary>
/// Lay DS luong hieu luc cua toan cong ty. Moi nhan vien chi co 1 muc luong trong danh sach.
/// </summary>
/// <param name="lstSalaryAll">get all Salary</param>
/// <param name="monthEffect"></param>
/// <returns></returns>
public void Approved(List<Guid> selectedIds, string status, string userLoginName)
{
using (var context = new VnrHrmDataContext())
{
string statusMessage = string.Empty;
var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
var repoProfile = new Hre_ProfileRepository(unitOfWork);
var repoHoldSalary = new Sal_HoldSalaryRepository(unitOfWork);
var lstHoldSalary = repoHoldSalary.FindBy(s => selectedIds.Contains(s.ID)).ToList();
var lstProfileIDs = lstHoldSalary.Select(s => s.ProfileID).ToList();
var profileServices = new Hre_ProfileServices();
var objProfile = new List<object>();
objProfile.AddRange(new object[17]);
objProfile[15] = 1;
objProfile[16] = int.MaxValue - 1;
var lstProfile = profileServices.GetData<Hre_ProfileEntity>(objProfile, ConstantSql.hrm_hr_sp_get_ProfileAll,userLoginName, ref statusMessage).ToList().Translate<Hre_Profile>();
//var lstProfiles = repoProfile.FindBy(m => m.ID != null && lstProfileIDs.Contains(m.ID)).ToList();
foreach (var holdSalary in lstHoldSalary)
{
holdSalary.Status = status;
var profileByID = lstProfile.Where(s => s.ID == holdSalary.ProfileID.Value).FirstOrDefault();
profileByID.MonthHoldSal = holdSalary.MonthSalary;
profileByID.IsHoldSal = true;
}
repoHoldSalary.SaveChanges();
repoProfile.SaveChanges();
}
}
示例3: Put
/// <summary>
/// [Tho.Bui] - Lấy dữ liệu Nhân Viên (Hre_ProfilePartyUnion) theo ProfileId
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public Hre_ProfilePartyUnionModel Put(Hre_ProfilePartyUnionModel model)
{
var service = new Hre_ProfileServices();
string status = string.Empty;
List<object> listObj = new List<object>() { model.ProfileID };
var entity = service.GetData<Hre_ProfilePartyUnionEntity>(listObj, ConstantSql.hrm_hr_sp_get_ProfilePartyUnionprofileId, UserLogin, ref status).FirstOrDefault();
var model1 = entity.CopyData<Hre_ProfilePartyUnionModel>();
model.ActionStatus = status;
return model1;
}
示例4: GetMultiProfileOrQuit
public JsonResult GetMultiProfileOrQuit(string text,bool isProfileQuit)
{
//hrm_hr_sp_get_ProfileQuit_multi
string status = string.Empty;
var service = new Hre_ProfileServices();
var get = service.GetData<Hre_ProfileMultiEntity>(text, ConstantSql.hrm_hr_sp_get_Profile_multi, UserLogin, ref status);
if (isProfileQuit)
{
get = service.GetData<Hre_ProfileMultiEntity>(text, ConstantSql.hrm_hr_sp_get_ProfileQuit_multi, UserLogin, ref status);
}
if (get != null)
{
var result = get.Select(item => new Hre_ProfileMultiModel()
{
ID = item.ID,
ProfileName = item.ProfileName,
});
return Json(result, JsonRequestBehavior.AllowGet);
}
return Json(null);
}
示例5: GetMultiProfileApprove
/// <summary> Load Profile la nguoi phê duyệt </summary>
/// <param name="text"></param>
/// <returns></returns>
public JsonResult GetMultiProfileApprove(string text)
{
string status = string.Empty;
var service = new Hre_ProfileServices();
var get = service.GetData<Hre_ProfileMultiEntity>(text, ConstantSql.hrm_hr_sp_get_ApproveProfile_multi, UserLogin, ref status);
var result = get.Select(item => new Hre_ProfileMultiModel()
{
ID = item.ID,
ProfileName = item.ProfileName,
});
return Json(result, JsonRequestBehavior.AllowGet);
}
示例6: Paysips
public ActionResult Paysips(string userLogin)
{
if (!CheckPermission()) return RedirectToAction("Denied", "Portal");
var id = Session[SessionObjects.ProfileID];
var service = new Hre_ProfileServices();
string status = string.Empty;
var listModel = service.GetData<Hre_ProfileModelPortal>(HRM.Infrastructure.Utilities.Common.DotNetToOracle(id.ToString()), ConstantSql.hrm_hr_sp_get_ProfileById, userLogin, ref status).FirstOrDefault();
if (listModel != null)
{
Session["ProfileName"] = listModel.ProfileName;
listModel.ActionStatus = status;
}
return GetOnlyView(listModel);
}
示例7: GetById
/// <summary>
/// [Chuc.Nguyen] - Lấy dữ liệu Nhân Viên (Hre_Profile) theo Id
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public Hre_ProfileModel GetById(Guid id)
{
var service = new Hre_ProfileServices();
string status = string.Empty;
var entity = service.GetData<Hre_ProfileEntity>(Common.DotNetToOracle(id.ToString()), ConstantSql.hrm_hr_sp_get_ProfileById, UserLogin, ref status).FirstOrDefault();
//xu ly tam de lay ten loai nghi viec vi hien tai left join nhiu qa trong store khong chay dc
if (entity.TypeOfStopID != null)
{
var catservice = new Cat_NameEntityServices();
var entityNameEntity = catservice.GetData<Cat_NameEntityEntity>(Common.DotNetToOracle(entity.TypeOfStopID.ToString()), ConstantSql.hrm_cat_sp_get_NameEntityById, UserLogin, ref status).FirstOrDefault();
if (entityNameEntity != null)
{
entity.TypeOfStopName = entityNameEntity.NameEntityName;
}
}
var model = entity.CopyData<Hre_ProfileModel>();
if (model != null && model.DateOfEffect != null)
{
model.DateOfEffectOld = model.DateOfEffect;
}
model.ActionStatus = status;
return model;
}
示例8: SaveLeaveData
public void SaveLeaveData(List<Att_WorkdayEntity> lstWorkDate, Guid LeaveDayCode, Guid? UserApproved,string userLogin, string Comment)
{
string status = string.Empty;
List<Att_LeaveDayEntity> lstLeaveDaySave = new List<Att_LeaveDayEntity>();
var workDate = new Att_WorkDayServices();
var hre_Profile = new Hre_ProfileServices();
#region getData
List<object> lstobject = new List<object>();
lstobject.AddRange(new object[18]);
lstobject[16] = 1;
lstobject[17] = int.MaxValue - 1;
List<Guid> lstProfileId = lstWorkDate.Select(m => m.ProfileID).ToList();
var lstProfile = hre_Profile.GetData<Hre_ProfileEntity>(lstobject, ConstantSql.hrm_hr_sp_get_Profile, userLogin, ref status).Where(m => lstProfileId.Contains(m.ID)).Select(m => new { m.ID, m.CodeEmp, m.ProfileName }).ToList();
#endregion
string Duplicate = string.Empty;
foreach (var item in lstWorkDate)
{
if (!string.IsNullOrEmpty(item.udLeavedayCode1))
{
var profile = lstProfile.Where(m => m.ID == item.ProfileID).FirstOrDefault();
if (profile != null)
{
bool isHaveValue = false;
if (profile.ProfileName != string.Empty)
{
Duplicate += profile.ProfileName;
isHaveValue = true;
}
if (profile.CodeEmp != string.Empty)
{
Duplicate += "[" + profile.CodeEmp + "]";
isHaveValue = true;
}
if (isHaveValue)
{
Duplicate += "; ";
}
}
continue;
}
//Att_WorkdayEntity WorkdayModify = SaveLeaveDataItem(item.ID, LeaveDayCode, UserApproved, Comment, false);
var message = SaveLeaveDataItem(item.ID, LeaveDayCode, UserApproved, Comment, false);
}
//DataErrorCode ErrorCode = EntityService.SubmitChanges(GuidContext, LoginUserID);
return;
}
示例9: UpdateWorkingPosition
public string UpdateWorkingPosition(string selectedIds, string userLogin)
{
string message = string.Empty;
string status = string.Empty;
var profileServices = new Hre_ProfileServices();
var workhistoryServices = new Hre_WorkHistoryServices();
List<Guid> lstIds = selectedIds.Split(',').Select(x => Guid.Parse(x)).ToList();
// var lstSuspenses = repo.FindBy(m => m.ID != null && lstIds.Contains(m.ID)).ToList();
var services = new BaseService();
var lstObj = new List<object>();
lstObj.AddRange(new object[14]);
lstObj[12] = 1;
lstObj[13] = int.MaxValue - 1;
var lstComback = services.GetData<Hre_StopWorkingEntity>(lstObj, ConstantSql.hrm_hr_sp_get_RegisterComback, userLogin, ref status).ToList().Translate<Hre_StopWorking>();
lstComback = lstComback.Where(s => lstIds.Contains(s.ID)).ToList();
Hre_WorkHistoryEntity workHistoryEntity;
foreach (var item in lstComback)
{
var profile = profileServices.GetData<Hre_ProfileEntity>(Common.DotNetToOracle(item.ProfileID.ToString()), ConstantSql.hrm_hr_sp_get_ProfileById, userLogin, ref status).FirstOrDefault();
profile.DateOfEffect = item.DateComeBack;
string supervisor = null;
if (profile.SupervisorID != null)
{
var supervisorbyProfile = profileServices.GetData<Hre_ProfileEntity>(Common.DotNetToOracle(profile.SupervisorID.ToString()), ConstantSql.hrm_hr_sp_get_ProfileById, userLogin, ref status).FirstOrDefault();
if (supervisorbyProfile != null)
{
supervisor = supervisorbyProfile.ProfileName;
}
}
workHistoryEntity = new Hre_WorkHistoryEntity();
workHistoryEntity.ProfileID = item.ProfileID.Value;
workHistoryEntity.DateEffective = item.DateComeBack != null ? item.DateComeBack.Value : DateTime.Now;
workHistoryEntity.OrganizationStructureID = profile.OrgStructureID;
workHistoryEntity.JobTitleID = profile.JobTitleID;
workHistoryEntity.PositionID = profile.PositionID;
workHistoryEntity.Supervisor = supervisor;
profileServices.Edit(profile);
workhistoryServices.Add(workHistoryEntity);
}
message = NotificationType.Success.ToString();
return message;
}
示例10: SalaryInfo
public ActionResult SalaryInfo(string userLogin)
{
if (!CheckPermission()) return RedirectToAction("Denied", "Portal");
var id = Session[SessionObjects.ProfileID];
var service = new Hre_ProfileServices();
string status = string.Empty;
Sal_SalaryInformationModel listModel1 = null;
var listModel = service.GetData<Sal_SalaryInformationModel>(HRM.Infrastructure.Utilities.Common.DotNetToOracle(id.ToString()), ConstantSql.hrm_sal_sp_get_Sal_SalaryInfomationByProfileId, userLogin,ref status);
if (listModel != null && listModel.Count > 0)
{
listModel1 = listModel.FirstOrDefault();
listModel1.ActionStatus = status;
}
return GetOnlyView(listModel1);
}
示例11: ActionApprovedComeBack
public string ActionApprovedComeBack(string selectedIds, string userLogin)
{
using (var context = new VnrHrmDataContext())
{
string message = string.Empty;
string status = string.Empty;
var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
var repo = new Hre_StopWorkingRepository(unitOfWork);
var profileServices = new Hre_ProfileServices();
var contractSevices = new Hre_ContractServices();
var ContractExtendServices = new Hre_ContractExtendServices();
var contractTypeSevices = new Cat_ContractTypeServices();
List<Guid> lstIds = selectedIds.Split(',').Select(x => Guid.Parse(x)).ToList();
// var lstSuspenses = repo.FindBy(m => m.ID != null && lstIds.Contains(m.ID)).ToList();
var services = new BaseService();
var lstObj = new List<object>();
lstObj.AddRange(new object[14]);
lstObj[12] = 1;
lstObj[13] = int.MaxValue - 1;
var lstSuspenses = services.GetData<Hre_StopWorkingEntity>(lstObj, ConstantSql.hrm_hr_sp_get_RegisterComback, userLogin, ref status).ToList().Translate<Hre_StopWorking>();
lstSuspenses = lstSuspenses.Where(s => lstIds.Contains(s.ID)).ToList();
var lstSuspense = new List<Hre_StopWorkingEntity>();
foreach (var Suspense in lstSuspenses)
{
var profile = profileServices.GetData<Hre_ProfileEntity>(Common.DotNetToOracle(Suspense.ProfileID.ToString()), ConstantSql.hrm_hr_sp_get_ProfileById, userLogin, ref status).FirstOrDefault();
Suspense.Status = HRM.Infrastructure.Utilities.EnumDropDown.StopWorkStatus.E_APPROVED.ToString();
Suspense.StatusComeBack = HRM.Infrastructure.Utilities.EnumDropDown.StopWorkStatus.E_APPROVED.ToString();
profile.StatusSyn = Suspense.LastStatusSyn;
profile.RequestDate = null;
profile.DateQuit = null;
profile.IsHoldSal = false;
profile.TypeSuspense = null;
profile.StopWorkType = null;
profile.ResReasonID = null;
profile.TypeOfStop = null;
profile.ResignNo = null;
profileServices.Edit(profile);
var contract = contractSevices.GetData<Hre_ContractEntity>(Common.DotNetToOracle(Suspense.ProfileID.ToString()), ConstantSql.hrm_hr_sp_get_ContractsByProfileId, userLogin, ref status).OrderByDescending(s => s.DateStart).FirstOrDefault();
if (contract != null)
{
var contractType = contractSevices.GetData<Cat_ContractTypeEntity>(Common.DotNetToOracle(contract.ContractTypeID.ToString()), ConstantSql.hrm_cat_sp_get_ContractTypeById, userLogin, ref status).FirstOrDefault();
if (Suspense.TypeSuspense == HRM.Infrastructure.Utilities.EnumDropDown.TypeSuspense.E_MILITARY.ToString())
{
int month = 0;
if (contractType == null)
{
continue;
}
if (contractType.ValueTime != null)
{
month = (int)contractType.ValueTime.Value;
if (contractType.UnitTime == HRM.Infrastructure.Utilities.EnumDropDown.UnitType.E_YEAR.ToString())
{
month = month * 12;
}
contract.DayContract = month;
if (contract.DateEnd != null)
{
if (Suspense.DateComeBack <= contract.DateEnd.Value)
{
if (Suspense.DateStop != null)
{
double daySus = ((Suspense.DateComeBack.Value.Subtract(Suspense.DateStop.Value)).TotalDays / 30);
contract.DayExtend = (int)Math.Floor(daySus);
if (contract.DateExtend == null)
{
contract.DateExtend = contract.DateEnd.Value.AddMonths(contract.DayExtend.Value);
}
else
{
contract.DateExtend = contract.DateExtend.Value.AddMonths(contract.DayExtend.Value);
}
}
}
else
{
if (Suspense.DateStop != null)
{
double daySus = (contract.DateEnd.Value.Subtract(Suspense.DateStop.Value)).TotalDays / 30;
contract.DayExtend = (int)Math.Floor(daySus);
if (contract.DateExtend == null)
{
contract.DateExtend = contract.DateEnd.Value.AddMonths(contract.DayExtend.Value);
}
else
{
contract.DateExtend = contract.DateExtend.Value.AddMonths(contract.DayExtend.Value);
}
Suspense.DateComeBack = Suspense.DateComeBack.Value.AddMonths(contract.DayExtend.Value);
}
}
}
}
contract.StatusEvaluation = HRM.Infrastructure.Utilities.EnumDropDown.Status.E_APPROVED.ToString();
Hre_ContractExtendEntity contractExtend = new Hre_ContractExtendEntity();
contractExtend.ContractID = contract.ID;
contractExtend.DateStart = Suspense.DateComeBack;
//.........这里部分代码省略.........
示例12: GetReportTraineeJoinCourse
public DataTable GetReportTraineeJoinCourse(Guid[] rankIds, string[] courseIds, string orderNumber, bool IsCreateTemplate, DateTime? dateSeniory, string UserLogin)
{
DataTable table = CreateReportTraineeJoinCourseSchema();
if (IsCreateTemplate)
{
return table;
}
using (var context = new VnrHrmDataContext())
{
string status = string.Empty;
var dateCheck = DateTime.Now;
//var dateSeniotyConfig = "31/03/N";
// var strDateSeniorty = dateSeniotyConfig.Split('/');
var dateCheckConfig = DateTime.Now;
//if (dateCheckConfig.Day <= int.Parse(strDateSeniorty[0]) && dateCheckConfig.Month <= int.Parse(strDateSeniorty[1]))
//{
// dateCheckConfig = new DateTime(dateCheckConfig.Year - 1, dateCheckConfig.Month, dateCheckConfig.Day);
//}
if (dateSeniory != null)
{
dateCheckConfig = dateSeniory.Value;
}
var profileServices = new Hre_ProfileServices();
var objProfile = new List<object>();
objProfile.AddRange(new object[17]);
objProfile[2] = orderNumber;
objProfile[15] = 1;
objProfile[16] = int.MaxValue - 1;
//objProfile.Add(orderNumber);
//objProfile.Add(null);
//objProfile.Add(null);
var lstProfile = profileServices.GetData<Hre_ProfileEntity>(objProfile, ConstantSql.hrm_hr_sp_get_ProfileAll, UserLogin, ref status).Where(s => s.DateQuit == null).ToList();
//var lstProfile = profileServices.GetData<Hre_ProfileEntity>(objProfile, ConstantSql.hrm_hr_sp_get_ProfileIdsByOrg, ref status).ToList();
var lstProfileID = lstProfile.Select(s => s.ID).ToList();
var orgsService = new Cat_OrgStructureServices();
var objOrg = new List<object>();
objOrg.AddRange(new object[5]);
objOrg[3] = 1;
objOrg[4] = int.MaxValue - 1;
var lstallorgs = orgsService.GetData<Cat_OrgStructureEntity>(objOrg, ConstantSql.hrm_cat_sp_get_OrgStructure, UserLogin, ref status).ToList();
var courseServices = new Tra_CourseServices();
var objCourse = new List<object>();
objCourse.AddRange(new object[11]);
objCourse[9] = 1;
objCourse[10] = int.MaxValue - 1;
var lstCourse = courseServices.GetData<Tra_CourseEntity>(objCourse, ConstantSql.hrm_tra_sp_get_Course, UserLogin, ref status).ToList();
if (courseIds != null)
{
lstCourse = lstCourse.Where(s => courseIds.Contains(s.Code)).ToList();
}
var jobTitleServices = new Cat_JobTitleServices();
var objJobtitle = new List<object>();
objJobtitle.Add(null);
objJobtitle.Add(null);
objJobtitle.Add(null);
objJobtitle.Add(1);
objJobtitle.Add(int.MaxValue - 1);
var lstJobtitle = jobTitleServices.GetData<Cat_JobTitleEntity>(objJobtitle, ConstantSql.hrm_cat_sp_get_JobTitle, UserLogin, ref status).ToList();
var classServices = new Tra_ClassServices();
var objClass = new List<object>();
objClass.Add(null);
objClass.Add(null);
objClass.Add(null);
objClass.Add(null);
objClass.Add(null);
objClass.Add(null);
objClass.Add(null);
objClass.Add(null);
objClass.Add(1);
objClass.Add(int.MaxValue - 1);
var lstClass = classServices.GetData<Tra_ClassEntity>(objClass, ConstantSql.hrm_tra_sp_get_Class, UserLogin, ref status).ToList();
var salaryClassServices = new Cat_SalaryClassServices();
var objSalaryClass = new List<object>();
objSalaryClass.Add(null);
objSalaryClass.Add(1);
objSalaryClass.Add(int.MaxValue - 1);
var lstSalaryClass = salaryClassServices.GetData<Cat_SalaryClassEntity>(objSalaryClass, ConstantSql.hrm_cat_sp_get_SalaryClass, UserLogin, ref status).ToList();
if (rankIds != null)
{
lstSalaryClass = lstSalaryClass.Where(s => rankIds.Contains(s.ID)).ToList();
}
var rankServices = new Cat_SalaryRankServices();
var objRank = new List<object>();
objRank.Add(null);
objRank.Add(null);
objRank.Add(1);
objRank.Add(int.MaxValue - 1);
var lstRank = rankServices.GetData<Cat_SalaryRankEntity>(objRank, ConstantSql.hrm_cat_sp_get_SalaryRank, UserLogin, ref status).ToList();
var traineeServices = new Tra_TraineeServices();
//.........这里部分代码省略.........
示例13: SaleEvaluation
public ActionResult SaleEvaluation(string userLogin)
{
if (!CheckPermission()) return RedirectToAction("Denied", "Portal");
var id = Session[SessionObjects.ProfileID];
var service = new Hre_ProfileServices();
string status = string.Empty;
List<object> lstObjSaleEvaluation = new List<object>();
lstObjSaleEvaluation.Add(id);
// lstObjSaleEvaluation.Add(1);
// lstObjSaleEvaluation.Add(1000000000);
var listModel = service.GetData<Eva_SaleEvaluationModel>(lstObjSaleEvaluation, ConstantSql.hrm_eva_sp_get_SaleEvaluationByProId, userLogin,ref status);
if (listModel != null && listModel.Count > 0)
{
var model = listModel.FirstOrDefault();
model.ActionStatus = status;
return GetOnlyView(model);
}
return View();
}
示例14: GetEvalutionDataByTemplate
public DataTable GetEvalutionDataByTemplate(int year, int? time, string orgStructureID,string userLogin)
{
using (var context = new VnrHrmDataContext())
{
var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
DataTable table = CreateEvalutionDataSchema();
DateTime _daystart = new DateTime(year - 1, 04, 01);
int daysInFeb = System.DateTime.DaysInMonth(year, 2);
DateTime _dayend = new DateTime(year, 02, daysInFeb);
if (time == 2)
{
int daysInMar = System.DateTime.DaysInMonth(year, 3);
_dayend = new DateTime(year, 03, daysInMar);
}
string status = string.Empty;
List<Eva_EvalutionDataEntity> lstEvalutionDataEntity = new List<Eva_EvalutionDataEntity>();
// //ds nv
var hrService = new Hre_ProfileServices();
var service = new BaseService();
List<object> strOrgIDs = new List<object>();
strOrgIDs.AddRange(new object[3]);
strOrgIDs[0] = (object)orgStructureID;
var lstProfile = hrService.GetData<Hre_ProfileEntity>(strOrgIDs, ConstantSql.hrm_hr_sp_get_ProfileIdsByOrg, userLogin, ref status).ToList();
if (lstProfile == null)
return table;
DateTime _datetime = new DateTime(year, 01, 01);
List<object> paraEvalutionData = new List<object>();
paraEvalutionData.AddRange(new object[13]);
paraEvalutionData[0] = orgStructureID;
paraEvalutionData[1] = year;
paraEvalutionData[2] = _datetime;
paraEvalutionData[3] = time;
paraEvalutionData[11] = 1;
paraEvalutionData[12] = int.MaxValue - 1;
var evaServiceEvalutionData = new Eva_EvalutionDataServices();
var lstEvalutionData = evaServiceEvalutionData.GetData<Eva_EvalutionDataEntity>(paraEvalutionData, ConstantSql.hrm_eva_sp_get_EvalutionData, userLogin, ref status);
foreach (var item in lstEvalutionData)
{
var profile = lstProfile.Where(s => s.ID == item.ProfileID).FirstOrDefault();
if (profile != null)
{
DataRow row = table.NewRow();
row[Eva_ReportEvalutionDataEntity.FieldNames.CodeEmp] = profile.CodeEmp;
row[Eva_ReportEvalutionDataEntity.FieldNames.ProfileName] = profile.ProfileName;
if (item.C1 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C1] = item.C1;
if (item.C2 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C2] = item.C2;
if (item.C3 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C3] = item.C3;
if (item.C4 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C4] = item.C4;
if (item.C5 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C5] = item.C5;
if (item.C6 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C6] = item.C6;
if (item.C7 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C7] = item.C7;
if (item.C8 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C8] = item.C8;
if (item.C9 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C9] = item.C9;
if (item.C10 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C10] = item.C10;
if (item.C11 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C11] = item.C11;
if (item.C12 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C12] = item.C12;
if (item.C13 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C13] = item.C13;
if (item.C14 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C14] = item.C14;
if (item.C15 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C15] = item.C15;
if (item.C16 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C16] = item.C16;
if (item.C17 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C17] = item.C17;
if (item.C18 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C18] = item.C18;
if (item.C19 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C19] = item.C19;
if (item.C20 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C20] = item.C20;
if (item.C21 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C21] = item.C21;
if (item.C22 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C22] = item.C22;
if (item.C23 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C23] = item.C23;
if (item.C24 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C24] = item.C24;
if (item.C25 != null)
row[Eva_ReportEvalutionDataEntity.FieldNames.C25] = item.C25;
if (item.C26 != null)
//.........这里部分代码省略.........
示例15: GetReportProfileWorking
public List<Hre_ReportProfileWorkingEntity> GetReportProfileWorking(DateTime? DateFrom, DateTime? DateTo, string lstOrgOrderNumber, string codeEmp, string userLogin)
{
string status = string.Empty;
List<Hre_ReportProfileWorkingEntity> lstReportProfileWorkingEntity = new List<Hre_ReportProfileWorkingEntity>();
using (var context = new VnrHrmDataContext())
{
var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
var orgsService = new Cat_OrgStructureServices();
var orgs = orgsService.GetDataNotParam<Cat_OrgStructure>(ConstantSql.hrm_cat_sp_get_AllOrg, userLogin, ref status).ToList();
var empoyeeTypesServices = new Cat_EmployeeTypeServices();
var empoyeeTypes = empoyeeTypesServices.GetDataNotParam<Cat_EmployeeTypeEntity>(ConstantSql.hrm_cat_sp_get_AllEmpType, userLogin, ref status).ToList();
var postionsServices = new Cat_PositionServices();
var postions = postionsServices.GetDataNotParam<Cat_PositionEntity>(ConstantSql.hrm_cat_sp_get_AllPosition, userLogin, ref status).ToList();
var orgTypesServices = new Cat_OrgStructureTypeServices();
var orgTypes = orgTypesServices.GetDataNotParam<Cat_OrgStructureType>(ConstantSql.hrm_cat_sp_get_AllOrgType, userLogin, ref status).ToList();
var hrService = new Hre_ProfileServices();
List<object> listObjHr = new List<object>();
listObjHr.Add(lstOrgOrderNumber);
listObjHr.Add(DateFrom);
listObjHr.Add(DateTo);
listObjHr.Add(codeEmp);
var profiles = hrService.GetData<Hre_ProfileEntity>(listObjHr, ConstantSql.hrm_hr_sp_get_RptWorkingProfile, userLogin,ref status).ToList();
foreach (var profile in profiles)
{
Hre_ReportProfileWorkingEntity ReportProfileWorkingEntity = new Hre_ReportProfileWorkingEntity();
Guid? orgId = profile.OrgStructureID;
var org = orgs.FirstOrDefault(s => s.ID == profile.OrgStructureID);
var orgBranch = LibraryService.GetNearestParent(orgId, OrgUnit.E_BRANCH, orgs, orgTypes);
var orgOrg = LibraryService.GetNearestParent(orgId, OrgUnit.E_DEPARTMENT, orgs, orgTypes);
var orgTeam = LibraryService.GetNearestParent(orgId, OrgUnit.E_TEAM, orgs, orgTypes);
var orgSection = LibraryService.GetNearestParent(orgId, OrgUnit.E_SECTION, orgs, orgTypes);
ReportProfileWorkingEntity.CodeBranch = orgBranch != null ? orgBranch.Code : string.Empty;
ReportProfileWorkingEntity.CodeOrg = orgOrg != null ? orgOrg.Code : string.Empty;
ReportProfileWorkingEntity.CodeTeam = orgTeam != null ? orgTeam.Code : string.Empty;
ReportProfileWorkingEntity.CodeSection = orgSection != null ? orgSection.Code : string.Empty;
ReportProfileWorkingEntity.BranchName = orgBranch != null ? orgBranch.OrgStructureName : string.Empty;
ReportProfileWorkingEntity.OrgName = orgOrg != null ? orgOrg.OrgStructureName : string.Empty;
ReportProfileWorkingEntity.TeamName = orgTeam != null ? orgTeam.OrgStructureName : string.Empty;
ReportProfileWorkingEntity.SectionName = orgSection != null ? orgSection.OrgStructureName : string.Empty;
ReportProfileWorkingEntity.CodeEmp = profile.CodeEmp;
ReportProfileWorkingEntity.ProfileName = profile.ProfileName;
ReportProfileWorkingEntity.IDNo = profile.IDNo;
ReportProfileWorkingEntity.Gender = profile.Gender;
ReportProfileWorkingEntity.CodeAttendance = profile.CodeAttendance;
ReportProfileWorkingEntity.PAStreet = profile.PAddress;
ReportProfileWorkingEntity.DateHire = profile.DateHire;
var employeeType = empoyeeTypes.Where(s => profile.EmpTypeID == s.ID).FirstOrDefault();
if (employeeType != null)
{
ReportProfileWorkingEntity.EmployeeTypeName = employeeType.EmployeeTypeName;
}
var position = postions.Where(s => profile.PositionID == s.ID).FirstOrDefault();
if (position != null)
{
ReportProfileWorkingEntity.PositionName = position.PositionName;
}
lstReportProfileWorkingEntity.Add(ReportProfileWorkingEntity);
}
return lstReportProfileWorkingEntity;
}
}