public List <cstDashBoardStion> GetStationByReport(DateTime DateReport) { List <cstDashBoardStion> _lsStationPacked = new List <cstDashBoardStion>(); try { var vStationPacked = Service.Get.GetStationByReport(DateReport); foreach (var item in vStationPacked) { cstDashBoardStion _spacked = new cstDashBoardStion(); _spacked.ErrorCaught = item.ErrorCaught; _spacked.StationName = item.StationName; _spacked.TotalPacked = item.TotalPacked; _spacked.packagePerhr = item.packagePerhr; _spacked.ShipmentNumber = item.ShipmentNumber; _spacked.PackerName = item.PackerName; _lsStationPacked.Add(_spacked); } } catch (Exception) { } return(_lsStationPacked); }
public void StaionInfo() { List <cstUserCurrentStationAndDeviceID> lsCurrent = new List <cstUserCurrentStationAndDeviceID>(); List <cstUserCurrentStationAndDeviceID> lsStation = Obj.call.GetlastLoginStationAllUsers(); foreach (var Stationitem in lsStation) { DateTime Dt = Convert.ToDateTime(Stationitem.Datetime); if (Dt.Date == DateTime.UtcNow.Date) { lsCurrent.Add(Stationitem); } } try { var StaionDetails = from st in lsCurrent select new { stationName = st.StationName, TotalPacked = Obj.Rcall.TotalPackedTodayByStationID(st.StationName), UserName = st.UserName, userid = st.UserID, shippingnum = Obj.Rcall.GetShippingNumByStation(st.StationName) }; List <cstDashBoardStion> lsDashBoard = new List <cstDashBoardStion>(); foreach (var infoItem in StaionDetails) { cstDashBoardStion _Dstation = new cstDashBoardStion(); _Dstation.StationName = infoItem.stationName; _Dstation.TotalPacked = infoItem.TotalPacked; _Dstation.PackerName = infoItem.UserName; _Dstation.ErrorCaught = _getUserLogErrors(infoItem.UserName); _Dstation.ShipmentNumber = infoItem.shippingnum; _Dstation.packagePerhr = AvgPackingTimerPerUser(infoItem.userid); lsDashBoard.Add(_Dstation); } foreach (cstDashBoardStion Dab in lsDashBoard) { MainDiv.Controls.Add(SetTable(Dab)); } } catch (Exception) { } }
public HtmlTable SetTable(cstDashBoardStion cStation) { HtmlTable StationTable = new HtmlTable(); StationTable.BgColor = "White"; StationTable.Border = 2; StationTable.BorderColor = "Gray"; StationTable.Style.Add("float", "left"); StationTable.Style.Add("margin-right", "10px"); StationTable.Style.Add("margin", "5px"); StationTable.Style.Add("width", "47%"); HtmlTableRow row = new HtmlTableRow(); HtmlTableRow trow = new HtmlTableRow(); HtmlTableCell tcell = new HtmlTableCell(); tcell.ColSpan = 2; tcell.InnerHtml = " <table style=\"width: 100%;\"><tr><td style=\"text-align: center; font-size: 40px; color: #ff6a00; background-color:#1e1d1d\">" + cStation.StationName + "</td></tr></table>"; trow.Cells.Add(tcell); HtmlTableCell cell; for (int i = 0; i < 2; i++) { cell = new HtmlTableCell(); if (i == 0) { cell.InnerHtml = "<table style=\"width:100%\"><tr><td style=\"text-align:center; font-size:60px; color:darkgreen;\">" + cStation.TotalPacked + "</td></tr><tr><td style=\"text-align:center; font-size:40px; color:black\"> Packed</td></tr></table>"; } if (i == 1) { cell.InnerHtml = "<table style=\"width: 100%;\"><tr><td style=\"font-size:20px; color:black; text-align:right\">Packer :</td><td style=\"font-size:20px; color:darkblue; text-align:left\">" + cStation.PackerName + "</td></tr><tr><td style=\"font-size:20px; color:black; text-align:right\">Error Caught :</td><td style=\"font-size:20px; color:darkblue; text-align:left\">" + cStation.ErrorCaught + "</td></tr><tr><td style=\"font-size:20px; color:black; text-align:right\">Avg Shipment Packing Time :</td><td style=\"font-size:20px; color:darkblue; text-align:left\">" + cStation.packagePerhr + "</td></tr><tr><td style=\"font-size:20px; color:black; text-align:right\">Active Shipment :</td><td style=\"font-size:20px; color:darkblue; text-align:left\">" + cStation.ShipmentNumber + "</td></tr></table>"; } row.Cells.Add(cell); } StationTable.Rows.Add(trow); StationTable.Rows.Add(row); return(StationTable); }
public List <cstDashBoardStion> GetStationByReport(DateTime DateReport) { List <cstDashBoardStion> _lsStationPacked = new List <cstDashBoardStion>(); try { cmdUser user = new cmdUser(); var vStationPacked = from station in lent.Stations join pack in lent.Packages on station.StationID equals pack.StationID where EntityFunctions.TruncateTime(pack.StartTime) == EntityFunctions.TruncateTime(DateReport) group pack by station.StationID into GStationPack select new { StationID = GStationPack.Key, StaionName = GStationPack.FirstOrDefault(i => i.Station.StationName != null).Station.StationName, PackedCount = GStationPack.Count(i => i.PackingStatus == 0), }; cstDashBoardStion dash = new cstDashBoardStion(); } catch (Exception) { } return(_lsStationPacked); }