public IEnumerable <ExcelJobViewModel> ReadExcelJobs(int company, string culture) { var Job = (from J in context.Jobs where (((J.IsLocal && J.CompanyId == company) || J.IsLocal == false) && (J.StartDate <= DateTime.Today && (J.EndDate == null || J.EndDate >= DateTime.Today))) select new ExcelJobViewModel { Id = J.Id, Code = J.Code, Name = J.Name, IsLocal = HrContext.TrlsMsg(J.IsLocal.ToString(), culture), LName = HrContext.TrlsName(J.Name, culture), DefaultGradeId = J.DefaultGradeId != null ? HrContext.TrlsName(J.PayrollGrade.Name, culture) : " ", StartDate = J.StartDate.ToString(), EndDate = J.EndDate != null ? J.EndDate.Value.ToString() : " ", NameInInsurance = J.NameInInsurance, PlanCount = J.PlanCount.ToString(), PlanTurnOverRate = J.PlanTurnOverRate != null? J.PlanTurnOverRate.Value.ToString():" ", ProbationPeriod = J.ProbationPeriod != null? J.ProbationPeriod.Value.ToString():" ", PrimaryRole = HrContext.TrlsMsg(J.PrimaryRole.ToString(), culture), StartTime = J.StartTime != null ? J.StartTime.Value.ToString() : " ", EndTime = J.EndTime != null ? J.EndTime.Value.ToString() : " ", Frequency = J.Frequency != null ? HrContext.GetLookUpCode("Frequency", J.Frequency.Value, culture) : " ", WorkHours = J.WorkHours != null? J.WorkHours.Value.ToString():" ", DescInRecruitment = J.DescInRecruitment, ReplacementRequired = HrContext.TrlsMsg(J.ReplacementRequired.Value.ToString(), culture), EnTime = J.EndTime, StarTime = J.StartTime }).ToList(); foreach (var item in Job) { item.StartTime = item.StarTime != null?item.StarTime.Value.ToString("HH:mm") : " "; item.EndTime = item.EnTime != null?item.EnTime.Value.ToString("HH:mm") : " "; } return(Job); }
public IQueryable <ExcelCustodyViewModel> ReadExcelCustody(int CompanyId, string Language) { return(from c in context.Custody where c.CompanyId == CompanyId && !c.CustodyCat.Disposal select new ExcelCustodyViewModel { Code = c.Code, CustodyCatId = HrContext.TrlsName(c.CustodyCat.Name, Language), Name = c.Name, Description = c.Description, Id = c.Id, SerialNo = c.SerialNo, Status = c.Status.ToString(), PurchaseAmount = c.PurchaseAmount.ToString(), Curr = HrContext.TrlsName(c.Currency.Name, Language), InUse = HrContext.TrlsMsg(c.InUse.ToString(), Language), ItemCode = c.ItemCode, JobId = HrContext.TrlsName(c.Job.Name, Language), BranchId = HrContext.TrlsName(c.Branch.Name, Language), PurchaseDate = c.PurchaseDate != null?c.PurchaseDate.Value.ToString() : " ", Freeze = HrContext.TrlsMsg(c.Freeze.ToString(), Language), }); }
public IEnumerable GetTablesHasCust(int companyId, string culture) { return(context.PageDiv.Where(w => w.CompanyId == companyId && w.HasCustCols == true).Select(s => new LabelViewModel { value = s.TableName, text = HrContext.TrlsMsg(s.Title, culture) }).ToList()); }