本文整理汇总了C#中iTextSharp.text.List.OrderBy方法的典型用法代码示例。如果您正苦于以下问题:C# List.OrderBy方法的具体用法?C# List.OrderBy怎么用?C# List.OrderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iTextSharp.text.List
的用法示例。
在下文中一共展示了List.OrderBy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadEmployees
void LoadEmployees()
{
EmployeeService employeeService = new EmployeeService();
employees = employeeService.GetEmployees();
Employee e = new Employee
{
Id = 0,
FullName = "Tất cả"
};
employees.Add(e);
employees = employees.OrderBy(el => el.Id).ToList();
if (employees != null)
{
cbmEmployees.DataSource = employees;
cbmEmployees.DisplayMember = "FullName";
cbmEmployees.ValueMember = "Id";
}
}
示例2: LoadDataCombobox
void LoadDataCombobox()
{
ProductTypeService productTypeService = new ProductTypeService();
ProductType pt = new ProductType
{
Id = 0,
TypeName = "Tất cả"
};
productTypes = productTypeService.GetProductTypes();
productTypes.Add(pt);
productTypes = productTypes.OrderBy(pts => pts.Id).ToList();
if (productTypes != null)
{
cbmProductTypes.DataSource = productTypes;
cbmProductTypes.DisplayMember = "TypeName";
cbmProductTypes.ValueMember = "Id";
}
LoadProducts(0);
}
示例3: GeneratePDF
public static MemoryStream GeneratePDF(Teacher teacher, SchoolClass schoolClass, List<Pupil> pupils, string schoolYear)
{
Document document = new Document();
MemoryStream stream = new MemoryStream();
PdfWriter writer = PdfWriter.GetInstance(document, stream);
writer.CloseStream = false;
document.Open();
document.AddCreationDate();
document.AddAuthor("VaKEGrade");
document.AddTitle("Certificate");
pupils = pupils.OrderBy(x => x.LastName).ToList();
foreach (Pupil pupil in pupils)
{
CertificateGenerator.GenerateCertificate(pupil, schoolClass, schoolYear, ref document);
}
document.Close();
stream.Seek(0, SeekOrigin.Begin);
return stream;
}
示例4: CreatePdfReport
public IPdfReportData CreatePdfReport()
{
return new PdfReport().DocumentPreferences(doc =>
{
doc.RunDirection(PdfRunDirection.LeftToRight);
doc.Orientation(PageOrientation.Portrait);
doc.PageSize(PdfPageSize.A4);
doc.DocumentMetadata(new DocumentMetadata { Author = "Vahid", Application = "PdfRpt", Keywords = "Test", Subject = "Test Rpt", Title = "Test" });
doc.Compression(new CompressionSettings
{
EnableCompression = true,
EnableFullCompression = true
});
})
.DefaultFonts(fonts =>
{
fonts.Path(System.IO.Path.Combine(Environment.GetEnvironmentVariable("SystemRoot"), "fonts\\arial.ttf"),
System.IO.Path.Combine(Environment.GetEnvironmentVariable("SystemRoot"), "fonts\\verdana.ttf"));
fonts.Size(9);
fonts.Color(System.Drawing.Color.Black);
})
.PagesFooter(footer =>
{
footer.DefaultFooter(DateTime.Now.ToString("MM/dd/yyyy"));
})
.PagesHeader(header =>
{
header.CacheHeader(cache: true); // It's a default setting to improve the performance.
header.CustomHeader(new GroupingHeaders { PdfRptFont = header.PdfFont });
})
.MainTableTemplate(template =>
{
template.BasicTemplate(BasicTemplate.SilverTemplate);
})
.MainTablePreferences(table =>
{
table.ColumnsWidthsType(TableColumnWidthType.Relative);
table.GroupsPreferences(new GroupsPreferences
{
GroupType = GroupType.HideGroupingColumns,
RepeatHeaderRowPerGroup = true,
ShowOneGroupPerPage = false,
SpacingBeforeAllGroupsSummary = 5f,
NewGroupAvailableSpacingThreshold = 150,
SpacingAfterAllGroupsSummary = 5f
});
table.SpacingAfter(4f);
})
.MainTableDataSource(dataSource =>
{
var listOfRows = new List<Employee>();
var rnd = new Random();
for (int i = 0; i < 170; i++)
{
listOfRows.Add(
new Employee
{
Age = rnd.Next(25, 35),
Id = i + 1000,
Salary = rnd.Next(1000, 4000),
Name = "Employee " + i,
Department = "Department " + rnd.Next(1, 3)
});
}
listOfRows = listOfRows.OrderBy(x => x.Department).ThenBy(x => x.Age).ToList();
dataSource.StronglyTypedList(listOfRows);
})
.MainTableSummarySettings(summarySettings =>
{
summarySettings.PreviousPageSummarySettings("Cont.");
summarySettings.OverallSummarySettings("Sum");
summarySettings.AllGroupsSummarySettings("Groups Sum");
})
.MainTableColumns(columns =>
{
columns.AddColumn(column =>
{
column.PropertyName("rowNo");
column.IsRowNumber(true);
column.CellsHorizontalAlignment(HorizontalAlignment.Center);
column.IsVisible(true);
column.Order(0);
column.Width(20);
column.HeaderCell("#");
});
columns.AddColumn(column =>
{
column.PropertyName<Employee>(x => x.Department);
column.CellsHorizontalAlignment(HorizontalAlignment.Center);
column.Order(1);
column.Width(20);
column.HeaderCell("Department");
column.Group(
(val1, val2) =>
{
return val1.ToString() == val2.ToString();
});
});
//.........这里部分代码省略.........
示例5: Tablero
// GET: Tablero
public ActionResult Tablero(string lvl, int? areaId)
{
ApplicationUser usuario = (ApplicationUser)db.Users.FirstOrDefault(item => item.UserName == User.Identity.Name);
int periodId = (int)Session["SelectedPeriod"];
Periodo period = db.Periodos.Find(periodId);
int nivel;
Area area;
if (lvl == null)
{
nivel = usuario.UsuarioArea.Nivel.ID;
}
else
{
nivel = int.Parse(lvl);
}
// Area
if (areaId == null)
{
if (usuario.TienePermiso(1)) // Administrador
{
area = db.Areas.First();
}
else
{
area = usuario.UsuarioArea;
}
areaId = area.ID;
}
else
{
area = db.Areas.FirstOrDefault(item => item.ID == areaId);
}
ViewBag.CurrentArea = area;
// Areas
if (usuario.TieneNivel(1) || usuario.TienePermiso(1))
{
ViewBag.Areas = db.Areas.Where(item => item.Nivel.ID == nivel).ToList();
}
else if (usuario.TieneNivel(2))
{
if (nivel == 2)
{
ViewBag.Areas = db.Areas.Where(item => item.ID == usuario.UsuarioArea.ID).ToList();
}
else if (nivel == 3)
{
List<Area> Areas = new List<Area>();
List<int> areasId = new List<int>();
Areas = db.Areas.Where(item => item.Nivel.ID == nivel && item.AreaPadre.ID == usuario.UsuarioArea.ID).ToList();
areasId = (from a in Areas
select a.ID).ToList();
Areas.AddRange(db.Areas.Where(item => item.Nivel.ID == nivel && areasId.Any(p => item.AreaPadre.ID == p)).ToList());
areasId = (from a in Areas
select a.ID).ToList();
Areas.AddRange(db.Areas.Where(item => item.Nivel.ID == nivel && areasId.Any(p => item.AreaPadre.ID == p)).ToList());
ViewBag.Areas = Areas.Distinct().OrderBy(item => item.ID);
}
}
else if (usuario.TienePermiso(6))
{
List<Area> Areas = new List<Area>();
Areas.Add(usuario.UsuarioArea);
Areas.AddRange(usuario.UsuarioArea.AreasHijas.ToList());
ViewBag.Areas = Areas.OrderBy(item => item.AreaPadre.ID);
}
lvl = nivel.ToString();
ViewBag.usuario = usuario;
ViewBag.Nivel = lvl;
ViewBag.PeriodoSeleccionado = period;
/* int _nivel = 3;
if (usuario.TieneNivel(1))
{
_nivel = 1;
}
if (usuario.TieneNivel(2))
{
_nivel = 2;
}
if (usuario.TieneNivel(3))
{
_nivel = 3;
}*/
List<NivelOrganizacional> Niveles = new List<NivelOrganizacional>();
NivelOrganizacional Nivel_01 = db.NivelesOrganizacionales.Find(1);
Niveles.Add(Nivel_01);
NivelOrganizacional Nivel_02 = db.NivelesOrganizacionales.Find(2);
Niveles.Add(Nivel_02);
NivelOrganizacional Nivel_03 = db.NivelesOrganizacionales.Find(3);
Niveles.Add(Nivel_03);
ViewBag.Niveles = Niveles;
//.........这里部分代码省略.........
示例6: Proyectos
// GET: Proyectos
public ActionResult Proyectos(int? areaId, int? tipoId)
{
ApplicationUser usuario = (ApplicationUser)db.Users.FirstOrDefault(item => item.UserName == User.Identity.Name);
int periodId = (int)Session["SelectedPeriod"];
Periodo period = db.Periodos.Find(periodId);
Area area;
TipoProyecto tipo;
if (areaId == null)
{
if (usuario.TienePermiso(26) && usuario.TieneNivel(2))
{
area = db.Areas.Where(item => item.Nivel.ID == 3 && item.AreaPadre.ID == usuario.UsuarioArea.ID).First();
}
if (usuario.TienePermiso(1) || (usuario.TienePermiso(26) && (usuario.TieneNivel(1)))) // Administrador y Presidente
{
area = db.Areas.Where(item => item.Nivel.ID == 3).First();
}
else if (usuario.TieneNivel(3) && usuario.TienePermiso(6))
{
area = usuario.UsuarioArea;
}
else
{
area = usuario.UsuarioArea;
}
areaId = area.ID;
}
else
{
area = db.Areas.Where(item => item.Nivel.ID == 3).FirstOrDefault(item => item.ID == areaId);
}
if (tipoId == null)
{
tipo = db.TipoProyecto.FirstOrDefault();
tipoId = tipo.ID;
}
else
{
tipo = db.TipoProyecto.Find(tipoId);
}
ViewBag.CurrentTipo = tipo;
ViewBag.CurrentArea = area;
if (usuario.TienePermiso(26) && usuario.TieneNivel(2))
{
List<Area> Areas = new List<Area>();
List<int> areasId = new List<int>();
Areas = db.Areas.Where(item => item.Nivel.ID == 3 && item.AreaPadre.ID == usuario.UsuarioArea.ID).ToList();
areasId = (from a in Areas
select a.ID).ToList();
Areas.AddRange(db.Areas.Where(item => item.Nivel.ID == 3 && areasId.Any(p => item.AreaPadre.ID == p)).ToList());
areasId = (from a in Areas
select a.ID).ToList();
Areas.AddRange(db.Areas.Where(item => item.Nivel.ID == 3 && areasId.Any(p => item.AreaPadre.ID == p)).ToList());
ViewBag.Areas = Areas.Distinct().OrderBy(item => item.ID);
}
if (usuario.TienePermiso(1) || (usuario.TienePermiso(26) && (usuario.TieneNivel(1)))) // Administrador y Presidente
{
ViewBag.Areas = db.Areas.Where(item => item.Nivel.ID == 3).ToList();
}
if (usuario.TienePermiso(6) && usuario.TieneNivel(3))
{
List<Area> Areas = new List<Area>();
Areas.Add(usuario.UsuarioArea);
Areas.AddRange(usuario.UsuarioArea.AreasHijas.ToList());
ViewBag.Areas = Areas.OrderBy(item => item.AreaPadre.ID);
}
ViewBag.Tipos = db.TipoProyecto.ToList();
ViewBag.usuario = usuario;
ViewBag.PeriodoSeleccionado = period;
return View(db.Proyectos.Where(item => item.Tipo.ID == tipoId && item.Area.ID == areaId && item.Periodos.Any(p => p.ID == periodId)).ToList());
}
示例7: FillViewBagProyecto
public void FillViewBagProyecto(Proyecto proyecto, int? areaId, int? tipoId)
{
ApplicationUser usuario = (ApplicationUser)db.Users.FirstOrDefault(item => item.UserName == User.Identity.Name);
int periodId = (int)Session["SelectedPeriod"];
Periodo period = db.Periodos.Find(periodId);
JavaScriptSerializer serializer = new JavaScriptSerializer();
TipoProyecto tipo;
ViewBag.usuario = usuario;
ViewBag.PeriodoSeleccionado = period;
ViewBag.TipoProyecto = db.TipoProyecto.ToList();
ViewBag.Fases = db.FasesProyecto.ToList();
ViewBag.areaId = areaId;
// Areas
if (areaId != null)
{
ViewBag.Areas = db.Areas.Where(item => item.ID == areaId).ToList();
}
else if (usuario.TienePermiso(1)) // Administrador
{
ViewBag.Areas = db.Areas.Where(item => item.Nivel.ID == 3).OrderBy(item => item.AreaPadre.ID).ToList();
}
else if (usuario.TienePermiso(6) && usuario.TieneNivel(3)) // Lider Unidad Operativa y Nivel Unidad Operativa
{
List<Area> Areas = new List<Area>();
Areas.Add(usuario.UsuarioArea);
Areas.AddRange(usuario.UsuarioArea.AreasHijas.ToList());
ViewBag.Areas = Areas.OrderBy(item => item.AreaPadre.ID);
}
else
{
List<Area> Areas = new List<Area>();
Areas.Add(usuario.UsuarioArea);
ViewBag.Areas = Areas;
}
// Tipos
if (tipoId == null)
{
tipo = db.TipoProyecto.FirstOrDefault();
tipoId = tipo.ID;
}
else
{
tipo = db.TipoProyecto.Find(tipoId);
}
ViewBag.CurrentTipo = tipo;
// Proyecto
List<ResumenEjecutivo> resumen = new List<ResumenEjecutivo>();
for (var i = 1; i <= 12; i++)
{
resumen.Add(new ResumenEjecutivo()
{
Mes = i,
Resumen = "",
Cerrado = DateTime.Now.Month == i ? false : true
});
}
var resumen_json = from a in resumen
select new
{
id = a.ID,
mesId = a.Mes,
mes = getMonthName(a.Mes),
resumen = a.Resumen,
mesCerrado = a.Cerrado,
mesActual = DateTime.Now.Month
};
ViewBag.Equipo = serializer.Serialize(new object[] { });
ViewBag.Hitos = serializer.Serialize(new object[] { });
ViewBag.Presupuesto = serializer.Serialize(new object[] { });
ViewBag.Resumen = serializer.Serialize(resumen_json);
if (proyecto != null)
{
if (proyecto.Equipo != null)
{
var json_equipo = from a in proyecto.Equipo
select new
{
id = a.ID,
nombre = a.Nombre,
rol = a.Rol,
Eliminar = "<a href=\"javascript: $.noop();\" style=\"color:red\" class=\"fa fa-minus\"></a>"
};
ViewBag.Equipo = serializer.Serialize(json_equipo);
}
if (proyecto.Hitos != null)
{
var json_hitos = from a in proyecto.Hitos
select new
{
id = a.ID,
nombre = a.Nombre,
faseId = a.Fase.ID.ToString(),
fase = a.Fase.Nombre,
fechacompromiso = a.FechaCompromiso.ToString("dd/MM/yyyy"),
fechareal = a.FechaReal != null ? ((DateTime)a.FechaReal).ToString("dd/MM/yyyy") : "",
ponderacion = a.Ponderacion,
//.........这里部分代码省略.........
示例8: WritePdf
//.........这里部分代码省略.........
Colspan = 1
};
ldKenTable.AddCell(ldcell2);
var ldcell3 = new PdfPCell(new Phrase("Maturity Date", boldFont))
{
BackgroundColor = BaseColor.LIGHT_GRAY,
Colspan = 1
};
ldKenTable.AddCell(ldcell3);
var ldcell4 = new PdfPCell(new Phrase("CCY", boldFont))
{
BackgroundColor = BaseColor.LIGHT_GRAY,
Colspan = 1
};
ldKenTable.AddCell(ldcell4);
var ldcell5 = new PdfPCell(new Phrase("Amount", boldFont))
{
BackgroundColor = BaseColor.LIGHT_GRAY,
Colspan = 1
};
ldcell5.HorizontalAlignment = Element.ALIGN_RIGHT;
ldKenTable.AddCell(ldcell5);
var ldcell6 = new PdfPCell(new Phrase("Rate", boldFont))
{
BackgroundColor = BaseColor.LIGHT_GRAY,
Colspan = 1
};
ldKenTable.AddCell(ldcell6);
foreach (var l in ldKens.OrderBy(p => p.CONTRACT_REF_NO))
{
var ldcell7 = new PdfPCell(new Phrase(l.CONTRACT_REF_NO, normalFont))
{
Colspan = 1
};
ldKenTable.AddCell(ldcell7);
var ldcell8 = new PdfPCell(new Phrase(l.VALUE_DATE, normalFont))
{
Colspan = 1
};
ldKenTable.AddCell(ldcell8);
var ldcell9 = new PdfPCell(new Phrase(string.IsNullOrEmpty(l.MATURITY_DATE) ? " ON CALL " : l.MATURITY_DATE, normalFont))
{
Colspan = 1
};
ldKenTable.AddCell(ldcell9);
var ldcell10 = new PdfPCell(new Phrase(l.CURRENCY, normalFont))
{
Colspan = 1
};
ldKenTable.AddCell(ldcell10);
var ldcell11 = new PdfPCell(new Phrase(l.PRINCIPAL_OUTSTANDING, normalFont))
{
Colspan = 1
};
ldcell11.HorizontalAlignment = Element.ALIGN_RIGHT;
ldKenTable.AddCell(ldcell11);
var ldcell12 = new PdfPCell(new Phrase(l.RATE, normalFont))
示例9: JobFormJsonConvert
private JobFormNew JobFormJsonConvert(string jobfomJson, string urlname, string jobguid)
{
try
{
JobFormNew pJobFormView = (!string.IsNullOrEmpty(jobfomJson)) ? new JavaScriptSerializer().Deserialize<JobFormNew>(jobfomJson) : null;
if (pJobFormView != null)
{
if (pJobFormView.Values != null)
{
pJobFormView.FormValues = new List<JobFormValueDetails>();
//for (int i = 0; i < pJobFormView.Values.Count; i++)
foreach (JobFormValues pFormValues in pJobFormView.Values)
{
//JobFormValues pFormValues = pJobFormView.Values[i];
JobFormValueDetails pFormDetails = new JobFormValueDetails();
string[] Controls = pFormValues.ControlID.Split('_');
if (Controls.Length > 2)
{
int controlid, controltype;
pFormDetails.FormID = Controls[0];
if (int.TryParse(Controls[1], out controlid))
{
pFormDetails.ControlID = controlid;
}
else
{
pFormDetails.ControlID = 0;
}
if (int.TryParse(Controls[2], out controltype))
{
pFormDetails.ControlType = (ControlType)controltype;
}
else
{
pFormDetails.ControlType = 0;
}
}
int parentid;
pFormDetails.Value = pFormValues.Value;
pFormDetails.ControlLabel = pFormValues.ControlLabel;
if (int.TryParse(pFormValues.parentID, out parentid))
{
pFormDetails.parentID = parentid;
}
else
{
pFormDetails.parentID = 0;
}
pFormDetails.controlParentLabel = pFormValues.controlParentLabel;
pFormDetails.ValueID = pFormValues.ValueID;
pFormDetails.currentValueID = pFormValues.currentValueID;
pFormDetails.ImagePath = System.Configuration.ConfigurationManager.AppSettings.Get(urlname).ToString() + Session["OrganizationGUID"].ToString() + "/Jobs/" + pJobFormView.JobGUID;
pFormDetails.OrganizationGUID = Session["OrganizationGUID"].ToString();
pFormDetails.JobGUID = pJobFormView.JobGUID;
pJobFormView.FormValues.Add(pFormDetails);
}
pJobFormView.JobGUID = jobguid;
}
}
if (pJobFormView != null && pJobFormView.FormValues != null && pJobFormView.FormValues.Count > 0)
{
pJobFormView.FormValues.OrderBy(x => x.ControlID);
}
if (!string.IsNullOrEmpty(jobguid))
{
Job pjob = _IJobRepository.GetJobByID(new Guid(jobguid));
if (pjob != null)
{
List<JobProgress> jobProgressList = new List<JobProgress>();
jobProgressList = _IJobRepository.GetJobProgress(pjob.JobGUID);
List<string> coordinate = new List<string>();
int i = 0;
Market pMarket = pjob.CustomerStopGUID != null ? _IMarketRepository.GetMarketByID(new Guid(pjob.CustomerStopGUID.ToString())) : null;
if (pMarket != null)
{
pJobFormView.CoordinateList = new List<CoOrdinates>();
if (pMarket.Latitude != null && pMarket.Longitude != null)
{
CoOrdinates pCoOrdinates = new CoOrdinates();
pCoOrdinates.Latitude = Convert.ToDouble(pMarket.Latitude);
pCoOrdinates.Longitude = Convert.ToDouble(pMarket.Longitude);
pCoOrdinates.Address = pMarket.AddressLine1 + "<br><br/>" + pMarket.AddressLine2;
pCoOrdinates.City = pMarket.City;
pCoOrdinates.State = pMarket.State;
pCoOrdinates.Country = pMarket.Country;
pCoOrdinates.JobName = pjob.JobName;
pCoOrdinates.StoreName = pMarket.MarketName.ToString();
pCoOrdinates.Count = i;
i++;
pJobFormView.CoordinateList.Add(pCoOrdinates);
coordinate.Add(pMarket.Latitude.ToString() + "~" + pMarket.Longitude.ToString() + "~store~" + pCoOrdinates.StoreName.ToString());
}
//.........这里部分代码省略.........
示例10: Index
//.........这里部分代码省略.........
if (Session["UserType"] != null && !string.IsNullOrEmpty(Session["UserType"].ToString()) && Session["UserType"].ToString() == "ENT_U" && Session["UserGUID"] != null)
{
GlobalUser globalUser = _IGlobalUserRepository.GetGlobalUserByID(new Guid(Session["UserGUID"].ToString()));
if (globalUser != null)
{
ljob.AssignedUserGUID = globalUser.UserGUID;
_market.FMUserID = globalUser.USERID;
}
}
List<Job> lstorevisit = _IJobRepository.GetStoreVisitJobs(ljob);
List<Market> lstorenonvisit = new List<Market>();
lstorenonvisit = _IMarketRepository.GetStoreNonVisit(_market);
if (lstorevisit != null && lstorevisit.Count > 0)
{
ViewBag.Visit_Search = Visit_Search;
if (!string.IsNullOrEmpty(Visit_Search))
{
Visit_Search = Visit_Search.ToLower();
lstorevisit = lstorevisit.Where(
p => (!String.IsNullOrEmpty(_IRegionRepository.GetRegionNameByRegionGUID(new Guid(p.RegionGUID.ToString()))) && _IRegionRepository.GetRegionNameByRegionGUID(new Guid(p.RegionGUID.ToString())).ToLower().Contains(Visit_Search))
|| (!String.IsNullOrEmpty(p.CustomerStopGUID.ToString()) && _IMarketRepository.GetMarketByID(new Guid(p.CustomerStopGUID.ToString())).MarketID.ToLower().Contains(Visit_Search))
|| (!String.IsNullOrEmpty(p.PONumber) && _IMarketRepository.GetMarketByCustomerID(p.OrganizationGUID, _IPORepository.GetPObyPoNumber(p.PONumber).PlaceID, _IPORepository.GetPObyPoNumber(p.PONumber).MarketID).MarketID.ToLower().Contains(Visit_Search))
|| (!String.IsNullOrEmpty(p.CustomerStopGUID.ToString()) && _IMarketRepository.GetMarketByID(new Guid(p.CustomerStopGUID.ToString())).MarketName.ToLower().Contains(Visit_Search))
|| (!String.IsNullOrEmpty(p.PONumber) && _IMarketRepository.GetMarketByCustomerID(p.OrganizationGUID, _IPORepository.GetPObyPoNumber(p.PONumber).PlaceID, _IPORepository.GetPObyPoNumber(p.PONumber).MarketID).MarketName.ToLower().Contains(Visit_Search))
|| (!String.IsNullOrEmpty(_IJobRepository.GetStatusName((int)p.StatusCode)) && _IJobRepository.GetStatusName((int)p.StatusCode).ToLower().Contains(Visit_Search))
|| (!String.IsNullOrEmpty(_IUserProfileRepository.GetUserProfileByUserID(_IGlobalUserRepository.GetGlobalUserByID(new Guid(p.ManagerUserGUID.ToString())).UserGUID, p.OrganizationGUID).ToString()) && _IUserProfileRepository.GetUserProfileByUserID(_IGlobalUserRepository.GetGlobalUserByID(new Guid(p.ManagerUserGUID.ToString())).UserGUID, p.OrganizationGUID).ToString().ToLower().Contains(Visit_Search))).ToList();
}
visit_TotalRecord = lstorevisit.ToList().Count;
visit_TotalPage = (visit_TotalRecord / (int)ViewBag.pageVisitCountValue) + ((visit_TotalRecord % (int)ViewBag.pageVisitCountValue) > 0 ? 1 : 0);
ViewBag.Visit_TotalRows = visit_TotalRecord;
lstorevisit = lstorevisit.OrderBy(a => a.OrganizationGUID).Skip(((page - 1) * (int)ViewBag.pageVisitCountValue)).Take((int)ViewBag.pageVisitCountValue).ToList();
foreach (Job job in lstorevisit)
{
StoreVisit storevisit = ConvertToStoreVisit(job);
if (storevisit != null)
{
pStoreVisitReports.StoreVisitList.Add(storevisit);
}
}
}
// Logger.Debug("Store Non Visit Count : " + lstorenonvisit.Count);
if (lstorenonvisit != null && lstorenonvisit.Count > 0)
{
ViewBag.NonVisit_Search = NonVisit_Search;
if (!string.IsNullOrEmpty(NonVisit_Search))
{
NonVisit_Search = NonVisit_Search.ToLower();
lstorenonvisit = lstorenonvisit.Where(
p => (!String.IsNullOrEmpty(p.RegionName) && p.RegionName.ToLower().Contains(NonVisit_Search))
|| (!String.IsNullOrEmpty(p.MarketID) && p.MarketID.ToLower().Contains(NonVisit_Search))
|| (!String.IsNullOrEmpty(p.MarketName) && p.MarketName.ToLower().Contains(NonVisit_Search))).ToList();
}
nonvisit_TotalRecord = lstorenonvisit.ToList().Count;
nonvisit_TotalPage = (nonvisit_TotalRecord / (int)ViewBag.pageNonCountValue) + ((nonvisit_TotalRecord % (int)ViewBag.pageNonCountValue) > 0 ? 1 : 0);
ViewBag.NonVisit_TotalRows = nonvisit_TotalRecord;
lstorenonvisit = lstorenonvisit.OrderBy(a => a.OrganizationGUID).Skip(((page - 1) * (int)ViewBag.pageNonCountValue)).Take((int)ViewBag.pageNonCountValue).ToList();
foreach (Market market in lstorenonvisit)
{
示例11: Details
public JsonResult Details(Int16 indicatorID, Int16 fiscalYear)
{
var viewModelItems = new List<Indicators>();
viewModelItems = db.Indicators.Where(x => x.Indicator_ID == indicatorID).ToList();
var viewModel = viewModelItems.OrderBy(x => x.Indicator_ID).Select(x => new GraphViewModel
{
Indicator_ID = x.Indicator_ID,
Area_ID = x.Area_ID,
//CoE = x.Indicator_CoE_Map.Count != 0 ? x.Indicator_CoE_Map.Where(y => y.Fiscal_Year == fiscalYear).FirstOrDefault().CoE.CoE : "",
Indicator = x.Indicator,
FY_3_YTD = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 3) + "_YTD").GetValue(x, null),
FY_3_YTD_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 3) + "_YTD_Sup").GetValue(x, null),
//FY_3_Target = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 3) + "_Target").GetValue(x, null),
//FY_3_Target_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 3) + "_Target_Sup").GetValue(x, null),
//FY_3_Comparator = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 3) + "_Comparator").GetValue(x, null),
//FY_3_Comparator_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 3) + "_Comparator_Sup").GetValue(x, null),
//FY_3_Performance_Threshold = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 3) + "_Performance_Threshold").GetValue(x, null),
//FY_3_Performance_Threshold_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 3) + "_Performance_Threshold_Sup").GetValue(x, null),
FY_2_YTD = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 2) + "_YTD").GetValue(x, null),
FY_2_YTD_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 2) + "_YTD_Sup").GetValue(x, null),
//FY_2_Target = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 2) + "_Target").GetValue(x, null),
//FY_2_Target_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 2) + "_Target_Sup").GetValue(x, null),
//FY_2_Comparator = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 2) + "_Comparator").GetValue(x, null),
//FY_2_Comparator_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 2) + "_Comparator_Sup").GetValue(x, null),
//FY_2_Performance_Threshold = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 2) + "_Performance_Threshold").GetValue(x, null),
//FY_2_Performance_Threshold_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 2) + "_Performance_Threshold_Sup").GetValue(x, null),
FY_1_YTD = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 1) + "_YTD").GetValue(x, null),
FY_1_YTD_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 1) + "_YTD_Sup").GetValue(x, null),
//FY_1_Target = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 1) + "_Target").GetValue(x, null),
//FY_1_Target_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 1) + "_Target_Sup").GetValue(x, null),
//FY_1_Comparator = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 1) + "_Comparator").GetValue(x, null),
//FY_1_Comparator_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 1) + "_Comparator_Sup").GetValue(x, null),
//FY_1_Performance_Threshold = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 1) + "_Performance_Threshold").GetValue(x, null),
//FY_1_Performance_Threshold_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 1) + "_Performance_Threshold_Sup").GetValue(x, null),
FY_Q1 = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Q1").GetValue(x, null),
FY_Q1_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Q1_Sup").GetValue(x, null),
FY_Q2 = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Q2").GetValue(x, null),
FY_Q2_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Q2_Sup").GetValue(x, null),
FY_Q3 = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Q3").GetValue(x, null),
FY_Q3_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Q3_Sup").GetValue(x, null),
FY_Q4 = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Q4").GetValue(x, null),
FY_Q4_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Q4_Sup").GetValue(x, null),
FY_YTD = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_YTD").GetValue(x, null),
FY_YTD_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_YTD_Sup").GetValue(x, null),
Target = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Target").GetValue(x, null),
TargetNum = Helpers.Color.getNum((string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Target").GetValue(x, null)),
Target_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Target_Sup").GetValue(x, null),
Comparator = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Comparator").GetValue(x, null),
Comparator_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Comparator_Sup").GetValue(x, null),
Performance_Threshold = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Performance_Threshold").GetValue(x, null),
Performance_Threshold_Sup = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Performance_Threshold_Sup").GetValue(x, null),
Color_ID = (Int16)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Color_ID").GetValue(x, null),
Custom_YTD = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_YTD_Custom_Color").GetValue(x, null),
Custom_Q1 = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Q1_Custom_Color").GetValue(x, null),
Custom_Q2 = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Q2_Custom_Color").GetValue(x, null),
Custom_Q3 = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Q3_Custom_Color").GetValue(x, null),
Custom_Q4 = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Q4_Custom_Color").GetValue(x, null),
Definition_Calculation = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Definition_Calculation").GetValue(x, null),
Target_Rationale = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Target_Rationale").GetValue(x, null),
Comparator_Source = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Comparator_Source").GetValue(x, null),
Data_Source_MSH = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Data_Source_MSH").GetValue(x, null),
Data_Source_Benchmark = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Data_Source_Benchmark").GetValue(x, null),
OPEO_Lead = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_OPEO_Lead").GetValue(x, null),
Q1_Color = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Q1_Color").GetValue(x, null),
Q2_Color = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Q2_Color").GetValue(x, null),
Q3_Color = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Q3_Color").GetValue(x, null),
Q4_Color = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_Q4_Color").GetValue(x, null),
YTD_Color = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 0) + "_YTD_Color").GetValue(x, null),
//FY_1_YTD_Color = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 1) + "_YTD_Color").GetValue(x, null),
//FY_2_YTD_Color = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 2) + "_YTD_Color").GetValue(x, null),
//FY_3_YTD_Color = (string)x.GetType().GetProperty(FiscalYear.FYStr(fiscalYear, 3) + "_YTD_Color").GetValue(x, null),
Fiscal_Year = fiscalYear,
}).FirstOrDefault();
return Json(viewModel);
}
示例12: viewPRExcel
//.........这里部分代码省略.........
ModelMetadataProviders.Current.GetMetadataForProperty(null, typeof(Indicator_CoE_Maps), columnField).DisplayName;
ws.Cell(currentRow, currentCol).Value = cellValue;
ws.Range(ws.Cell(currentRow, currentCol), ws.Cell(currentRow + 1, currentCol)).Merge();
currentCol++;
}
else
{
var columnField = columnHeaders[i, 1];
var columnFieldTop = columnHeaders[i, 0];
ws.Cell(currentRow + 1, currentCol).Value = columnField;
ws.Cell(currentRow, currentCol).Value = columnFieldTop;
if (currentCol < prHeader2ColStart) { prHeader2ColStart = currentCol; }
if (currentCol > prHeader2ColEnd) { prHeader2ColEnd = currentCol; }
currentCol++;
}
}
currentCol--;
ws.Range(ws.Cell(currentRow, prHeader2ColStart).Address, ws.Cell(currentRow, prHeader2ColEnd).Address).Merge();
var prHeader1 = ws.Range(ws.Cell(currentRow, 1).Address, ws.Cell(currentRow + 1, currentCol).Address);
var prHeader2 = ws.Range(ws.Cell(currentRow + 1, prHeader2ColStart).Address, ws.Cell(currentRow + 1, prHeader2ColEnd).Address);
prHeader1.Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
prHeader1.Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
prHeader1.Style.Fill.BackgroundColor = prHeader1Fill;
prHeader1.Style.Font.FontColor = prHeader1Font;
prHeader2.Style.Fill.BackgroundColor = prHeader2Fill;
prHeader2.Style.Font.FontColor = prHeader2Font;
currentRow += 2;
List<Footnotes> footnotes = new List<Footnotes>();
foreach (var areaMap in coe.Area_CoE_Map.Where(x => x.Fiscal_Year == fiscalYear).OrderBy(x => x.Area.Sort))
{
var cellLengthObjective = 0;
var prArea = ws.Range(ws.Cell(currentRow, 1), ws.Cell(currentRow, maxCol));
//fitAdjustableRows.Add(currentRow);
prArea.Merge();
prArea.Style.Fill.BackgroundColor = prAreaFill;
prArea.Style.Font.FontColor = prAreaFont;
prArea.FirstCell().RichText.AddText(areaMap.Area.Area).Bold = true;
cellLengthObjective += areaMap.Area.Area.Length;
if (ws == wsPR)
{
var indent = new string('_', indentLength);
var stringSeperators = new string[] { "•" };
if (areaMap.Objective != null)
{
var objectives = Regex.Matches(areaMap.Objective, @"\[.*?\]").Cast<Match>().Select(m => m.Value.Substring(1, m.Value.Length - 2)).ToList();
//for (var i = 1; i < objectives.Length; i++)
var i = 1;
foreach (var objective in objectives)
{
prArea.FirstCell().RichText.AddNewLine();
ws.Row(currentRow).Height += newLineHeight;
prArea.FirstCell().RichText.AddText(indent).SetFontColor(prAreaFill).SetFontSize(prAreaObjectiveFontsize);
prArea.FirstCell().RichText.AddText(" " + i +". " + objective).FontSize = prAreaObjectiveFontsize;
i++;
}
}
}
currentRow++;
示例13: Index
//
// GET: /JobStatus/
public ActionResult Index(string FromDate = "", string ToDate = "", string assigneduserguid = "", string jobindexguid = "", string Date = "", string selection = "", string ponumber = "", string RowCount = "", int page = 1, string search = "")
{
Logger.Debug("Inside AssignJob Controller- Index");
try
{
ViewBag.AssignedUserID = assigneduserguid;
ViewBag.FromDate = FromDate;
ViewBag.ToDate = ToDate;
ViewBag.Date = Date;
int totalPage = 0;
int totalRecord = 0;
int pCount = 0;
if (Session["OrganizationGUID"] != null)
{
if (!string.IsNullOrEmpty(RowCount))
{
int.TryParse(RowCount, out pCount);
pageCountList(pCount);
}
else
{
pageCountList(pCount);
}
if (!string.IsNullOrEmpty(Date))
{
ViewBag.DateValue = HttpUtility.HtmlDecode(Date);
}
var jobStatus = new JobStatusViewModel();
jobStatus.JobStatusModel = new List<JobStatusModel>();
var jobGroup = new List<Job>();
//Job ljob = new Job();
DateTime pFrom = new DateTime(), pTo = new DateTime();
OrganizationUsersMap pOrganizationUsersMap = _IUserRepository.GetUserByID(new Guid(Session["UserGUID"].ToString()));
Logger.Debug("UserGUID:" + Session["UserGUID"].ToString());
if (pOrganizationUsersMap != null)
{
StringBuilder sb = new StringBuilder();
sb.Append("<div class='actions'>");
sb.Append("<div class='btn-group'>");
if (!string.IsNullOrEmpty(assigneduserguid))
{
ViewBag.AssignedUserID = assigneduserguid;
Logger.Debug("Inside AssignedUSerGUID" + assigneduserguid.ToString());
UserProfile _userprofile = _IUserProfileRepository.GetUserProfileByUserID(new Guid(assigneduserguid), pOrganizationUsersMap.OrganizationGUID);
if (_userprofile != null)
{
sb.Append("<a href='#' id='ulaworkergroup' class='btn green' data-toggle='dropdown'><i class='icon-map-marker'></i> " + _userprofile.FirstName + " " + _userprofile.LastName + " <i class='icon-angle-down'></i></a>");
}
}
else
{
if (!string.IsNullOrEmpty(selection) && selection == "All")
{
sb.Append("<a href='#' id='ulaworkergroup' class='btn green' data-toggle='dropdown'><i class='icon-map-marker'></i> All <i class='icon-angle-down'></i></a>");
}
else
{
sb.Append("<a href='#' id='ulaworkergroup' class='btn green' data-toggle='dropdown'><i class='icon-map-marker'></i> Select User <i class='icon-angle-down'></i></a>");
}
}
sb.Append("<ul id='ulworkgroup' style='height:200px;overflow-y:scroll' class='dropdown-menu pull-right'>");
if (Session["UserType"] != null && Session["UserType"].ToString() != "ENT_U" && pOrganizationUsersMap != null)
{
if (string.IsNullOrEmpty(selection) || selection != "All")
{
//sb.Append("<li><a href=" + Url.Action("Index", "UserActivities", new { selection = "All" }) + ">All</a></li>");
sb.Append("<li><a onclick=\"RedirectAction('');\">All</a></li>");
}
List<UserProfile> pUserProfile = _IUserProfileRepository.GetUserProfilesbyOrganizationGUID(new Guid(Session["OrganizationGUID"].ToString())).ToList();
if (pUserProfile != null && pUserProfile.Count > 0)
{
pUserProfile = pUserProfile.OrderBy(x => x.FirstName).ToList();
foreach (UserProfile item in pUserProfile)
{
//sb.Append("<li><a href=" + Url.Action("Index", "UserActivities", new { assigneduserguid = item.UserGUID.ToString() }) + " data-groupguid=" + item.UserGUID + ">" + item.FirstName + " " + item.LastName + "</a></li>");
sb.Append("<li><a onclick=\"RedirectAction('" + item.UserGUID.ToString() + "');\" data-groupguid=" + item.UserGUID + ">" + item.FirstName + " " + item.LastName + "</a></li>");
Logger.Debug("Inside User foreach");
}
}
}
sb.Append("</ul>");
sb.Append("</div>");
sb.Append("</div>");
ViewBag.UserList = sb.ToString();
Job mjob = new Job();
if (!string.IsNullOrEmpty(ponumber))
{
mjob.PONumber = ponumber;
TempData["PoNumber"] = ponumber;
}
//FOr Regional Manager
if (Session["UserType"] != null && !string.IsNullOrEmpty(Session["UserType"].ToString()) && Session["UserType"].ToString() == "ENT_U_RM" && Session["UserGUID"] != null)
{
//.........这里部分代码省略.........
示例14: LoadUnits
private void LoadUnits(int productId, int attrId)
{
if (attrId == 0)
{
cbmUnits.Enabled = false;
cbmUnits.SelectedValue = 0;
}
else
{
cbmUnits.Enabled = true;
MeasurementUnitService unitService = new MeasurementUnitService();
MeasurementUnit u = new MeasurementUnit
{
Name = "Tất cả",
Id = 0
};
units = productLogService.GetUnitsOfProductAttribute(productId, attrId);
units.Add(u);
units = units.OrderBy(a => a.Id).ToList();
if (units != null)
{
cbmUnits.DataSource = units;
cbmUnits.DisplayMember = "Name";
cbmUnits.ValueMember = "Id";
}
}
}
示例15: LoadAttributes
private void LoadAttributes(int productId)
{
if (productId == 0)
{
cbmAttrs.Enabled = false;
cbmAttrs.SelectedValue = 0;
cbmUnits.Enabled = false;
cbmUnits.SelectedValue = 0;
}
else
{
cbmAttrs.Enabled = true;
BaseAttributeService attrService = new BaseAttributeService();
BaseAttribute ba = new BaseAttribute
{
AttributeName = "Tất cả",
Id = 0
};
ProductService productService = new ProductService();
Product p = productService.GetProduct(productId);
List<ProductAttribute> pas = p.ProductAttributes.ToList();
attrs = new List<BaseAttribute>();
attrs.Add(ba);
foreach (ProductAttribute pa in pas)
{
attrs.Add(pa.BaseAttribute);
}
attrs = attrs.OrderBy(a => a.Id).ToList();
if (attrs != null)
{
cbmAttrs.DataSource = attrs;
cbmAttrs.DisplayMember = "AttributeName";
cbmAttrs.ValueMember = "Id";
}
LoadUnits(productId, 0);
}
}