//从数据行中读取数据到RoomSign public static void RoomSignFromDB(RoomSign Sign, DataRow dr, int SignType) { Sign.strInRoomGUID = dr["strInRoomGUID"].ToString(); Sign.strTrainPlanGUID = dr["strTrainPlanGUID"].ToString(); Sign.strTrainmanGUID = dr["strTrainmanGUID"].ToString(); Sign.strDutyUserGUID = dr["strDutyUserGUID"].ToString(); Sign.strTrainmanNumber = dr["strTrainmanNumber"].ToString(); Sign.strTrainmanName = dr["strTrainmanName"].ToString(); Sign.dtInRoomTime = TFParse.DBToDateTime(dr["dtInRoomTime"], DateTime.Parse("1899-01-01")); Sign.SignType = SignType; }
public static void Main(string[] args) { string filename; /* * Console.WriteLine("Enter filename with teacher info: "); * string tp = Console.ReadLine(); * Console.WriteLine("Enter filename with course names: "); * string cc = Console.ReadLine(); */ string tp = args[0]; string cc = args[1]; rs = new RoomSign(tp, cc); pe = new PeriodEntries(tp, cc); schoolsigns.Append(@"<style> @media print{.mysign {page-break-after:always;}} .rn{font-size:36pt;font-family:calibri;text-align:center;} td{border:1px solid black;font-size:14pt;height:50px; } table{width:100%;table-layout: fixed;padding-top:0px; padding-bottom:0px;} table.spaceUnder{border-collapse:separate; border-spacing: 0px 10px;}</style>" ); //Console.WriteLine("Enter a room number. Type in -1 to print all."); //string roomNumber = Console.ReadLine(); string roomNumber = args[2]; filename = roomNumber; if (roomNumber == "-1") { for (int index = 0; index < getDistinctRooms().Count; index++) { schoolsigns.Append(createPage(getDistinctRooms()[index])); } filename = "All_Room_Schedules"; } else { schoolsigns.Append(createPage(roomNumber)); schoolsigns.Append(createPage("206")); schoolsigns.Append(createPage("208")); } File.WriteAllText("test.html", schoolsigns.ToString()); File.WriteAllText("Room 307.doc", schoolsigns.ToString()); File.WriteAllText("rooms.txt", string.Join("\n", getDistinctRooms().ToArray())); //File.WriteAllText(filename + " " + DateTime.Today + ".html", schoolsigns.ToString()); //File.WriteAllText(filename + " " + DateTime.Today + ".doc", schoolsigns.ToString()); //getDistinctRooms().ForEach(i => Console.WriteLine(i)); //foreach(Entry e in entryList) // Console.WriteLine(e.ToString()); }
/// <summary> /// 查询本段入寓记录 /// </summary> public InterfaceOutPut QueryInRoomRecord(String Data) { InterfaceOutPut output = new InterfaceOutPut(); output.result = 1; try { JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer(); InQueryInRoomRecord InParams = javaScriptSerializer.Deserialize <InQueryInRoomRecord>(Data); OutQueryInRoomRecord OutParams = new OutQueryInRoomRecord(); string strSql = @"Select TAB_Plan_InRoom.*,TAB_Org_Trainman.strTrainmanName,TAB_Org_Trainman.strWorkShopGUID from TAB_Plan_InRoom Left Join TAB_Org_Trainman On TAB_Plan_InRoom.strTrainmanGUID = TAB_Org_Trainman.strTrainmanGUID where dtInRoomTime >= @BeginTime and dtInRoomTime <= @EndTime and strWorkShopGUID = @strWorkShopGUID order by dtInRoomTime Desc"; SqlParameter[] sqlParams = new SqlParameter[] { new SqlParameter("BeginTime", InParams.BeginTime), new SqlParameter("EndTime", InParams.EndTime), new SqlParameter("strWorkShopGUID", InParams.WorkShopGUID) }; DataTable dt = SqlHelper.ExecuteDataset(SqlHelper.ConnString, CommandType.Text, strSql, sqlParams).Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { RoomSign sign = new RoomSign(); PS.PSPlan.RoomSignFromDB(sign, dt.Rows[i], 0); OutParams.Signs.Add(sign); } output.data = OutParams; output.result = 0; } catch (Exception ex) { output.resultStr = ex.Message; LogClass.log("Interface.QueryInRoomRecord:" + ex.Message); throw ex; } return(output); }
public static void Main(string[] args) { string filename; /* Console.WriteLine("Enter filename with teacher info: "); string tp = Console.ReadLine(); Console.WriteLine("Enter filename with course names: "); string cc = Console.ReadLine(); */ string tp = args[0]; string cc = args[1]; rs = new RoomSign(tp, cc); pe = new PeriodEntries(tp, cc); schoolsigns.Append(@"<style> @media print{.mysign {page-break-after:always;}} .rn{font-size:36pt;font-family:calibri;text-align:center;} td{border:1px solid black;font-size:14pt;height:50px; } table{width:100%;table-layout: fixed;padding-top:0px; padding-bottom:0px;} table.spaceUnder{border-collapse:separate; border-spacing: 0px 10px;}</style>"); //Console.WriteLine("Enter a room number. Type in -1 to print all."); //string roomNumber = Console.ReadLine(); string roomNumber = args[2]; filename = roomNumber; if(roomNumber == "-1"){ for(int index = 0; index < getDistinctRooms().Count; index++){ schoolsigns.Append(createPage(getDistinctRooms()[index])); } filename = "All_Room_Schedules"; }else{ schoolsigns.Append(createPage(roomNumber)); schoolsigns.Append(createPage("206")); schoolsigns.Append(createPage("208")); } File.WriteAllText("test.html", schoolsigns.ToString()); File.WriteAllText("Room 307.doc", schoolsigns.ToString()); File.WriteAllText("rooms.txt", string.Join("\n",getDistinctRooms().ToArray())); //File.WriteAllText(filename + " " + DateTime.Today + ".html", schoolsigns.ToString()); //File.WriteAllText(filename + " " + DateTime.Today + ".doc", schoolsigns.ToString()); //getDistinctRooms().ForEach(i => Console.WriteLine(i)); //foreach(Entry e in entryList) // Console.WriteLine(e.ToString()); }