public Get_Out GetDBConfigValues(string data) { Get_Out json = new Get_Out(); try { string strSql = "select * from TAB_System_Config"; DataTable table = SqlHelper.ExecuteDataset(SqlHelper.ConnString, CommandType.Text, strSql).Tables[0]; json.data = new List <SysConfig>(); SysConfig config = null; foreach (DataRow dataRow in table.Rows) { config = new SysConfig(); config.Ident = dataRow["strIdent"].ToString(); config.Section = dataRow["strSection"].ToString(); config.Value = dataRow["strValue"].ToString(); json.data.Add(config); } json.result = "0"; json.resultStr = "获取列表成功!"; } catch (Exception ex) { json.result = "1"; json.resultStr = "提交失败:" + ex.Message; } return(json); }
public Get_Out GetDutyUserList(string data) { Get_Out json = new Get_Out(); try { Get_In input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_In>(data); DataTable dt = this.GetDutyUserdt(input.strWorkShopGUID); List <trainMan> Ltm = new List <trainMan>(); for (int i = 0; i < dt.Rows.Count; i++) { string strTrainmanNumber = dt.Rows[i]["strNumber"].ToString(); string strTrainmanName = dt.Rows[i]["strName"].ToString(); string strTypeId = dt.Rows[i]["strTypeId"].ToString(); string strTypeName = ""; if (strTypeId == "1") { strTypeName = "甲"; } else if (strTypeId == "2") { strTypeName = "乙"; } else if (strTypeId == "3") { strTypeName = "丙"; } else if (strTypeId == "4") { strTypeName = "丁"; } else if (strTypeId == "5") { strTypeName = "备"; } else { strTypeName = ""; } string nPostID = ""; trainMan tm = new trainMan(); tm.tmName = strTrainmanName; tm.tmNumber = strTrainmanNumber; tm.typeName = strTypeName; tm.nPostID = nPostID; Ltm.Add(tm); } json.data = Ltm; json.result = "0"; json.resultStr = "返回成功"; } catch (Exception ex) { json.result = "1"; json.resultStr = "提交失败:" + ex.Message; } return(json); }
public Get_Out GetGroupOrder(string data) { Get_Out json = new Get_Out(); try { Get_In input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_In>(data); string strTrainmanJiaoLuGUID = input.TrainmanJiaoluGUID; string strWorkShopGUID = input.WorkShopGUID; TF.Api.BLL.BanXuBLL bllBanXu = new TF.Api.BLL.BanXuBLL(); json.Content = new List <GroupItem>(); DataTable table = bllBanXu.GetBanXuByJiaoLuGUID(strWorkShopGUID, strTrainmanJiaoLuGUID); SimpleTrainman man = null; if (table != null) { for (int i = 0; i < table.Rows.Count; i++) { DataRow row = table.Rows[i]; GroupItem record = new GroupItem(); DateTime endWorkTime; string strEndWorkTime = row["dtLastEndWorkTime1"] == null ? "" : row["dtLastEndWorkTime1"].ToString(); if (DateTime.TryParse(strEndWorkTime, out endWorkTime)) { record.EndWorkTime = endWorkTime.ToString("yyyy-MM-dd HH:mm:ss"); } else { record.EndWorkTime = ""; } record.Index = (i + 1).ToString(); record.TrainmanList = new SimpleTrainmanList(); json.Content.Add(record); for (int j = 1; j < 5; j++) { man = new SimpleTrainman(); man.TrainmanName = row["strTrainmanName" + j.ToString()].ToString(); man.TrainmanNo = row["strTrainmanNumber" + j.ToString()].ToString(); man.trianmanGUID = row["strTrainmanGUID" + j.ToString()].ToString(); record.TrainmanList.Add(man); } } } json.result = "0"; json.resultStr = "返回成功"; } catch (Exception ex) { json.result = "1"; json.resultStr = "提交失败:" + ex.Message; } return(json); }
public Get_Out ShowDringImage(string data) { Get_Out json = new Get_Out(); try { Get_In input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_In>(data); DBDrink db = new DBDrink(); json.Content = db.GetDrinkImageList(input.strTrainmanGUID, input.strTrainPlanGUID, input.WorkTypeID); json.result = "0"; json.resultStr = "返回成功"; } catch (Exception ex) { json.result = "1"; json.resultStr = "提交失败:" + ex.Message; } return(json); }
public Get_Out GetStations(string data) { Get_Out json = new Get_Out(); try { Get_In input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_In>(data); DBTestWeb db = new DBTestWeb(); json.data = db.GetStationList(); json.result = "0"; json.resultStr = "返回成功"; } catch (Exception ex) { json.result = "1"; json.resultStr = "提交失败:" + ex.Message; } return(json); }
public Get_Out GetAllJwdList(string data) { Get_Out json = new Get_Out(); try { Get_In input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_In>(data); DBJWDCoding db = new DBJWDCoding(); json.data = db.GetBase_JWDCodingLuList(); json.result = "0"; json.resultStr = "返回成功"; } catch (Exception ex) { json.result = "1"; json.resultStr = "提交失败:" + ex.Message; } return(json); }
public Get_Out GetTMJLByTrainJLWithSiteVirtual(string data) { Get_Out json = new Get_Out(); try { Get_In input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_In>(data); DBTrainManJiaoLu db = new DBTrainManJiaoLu(); json.data = db.GetTrainmanJiaolusOfTrainJiaoluEx(input.SiteGUID, input.TrainJiaoluGUID); json.result = "0"; json.resultStr = "返回成功"; } catch (Exception ex) { json.result = "1"; json.resultStr = "提交失败:" + ex.Message; } return(json); }