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_OutOverride GetTMJLByTrainJL(string data) { Get_OutOverride json = new Get_OutOverride(); try { Get_In input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_In>(data); DBTrainManJiaoLu db = new DBTrainManJiaoLu(); json.data = db.GetTrainmanJiaolusOfTrainJiaolu(input.SiteGUID, input.TrainJiaoluGUID); json.result = "0"; json.resultStr = "返回成功"; } catch (Exception ex) { json.result = "1"; json.resultStr = "提交失败:" + ex.Message; } return(json); }
public object GetSynchronization(string data) { try { Get_In input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_In>(data); if (input.DBName == "TABBaseSite") { Get_OutBase_Site json = new Get_OutBase_Site(); DBGetBase_Site db = new DBGetBase_Site(); json.data = db.GetBase_SiteList(); json.result = "0"; json.resultStr = "返回成功"; return(json); } else if (input.DBName == "TABBaseSiteLimit") { Get_OutBase_Site_Limit json = new Get_OutBase_Site_Limit(); DBGetBase_Site_Limit db = new DBGetBase_Site_Limit(); json.data = db.GetBase_Site_LimitList(); json.result = "0"; json.resultStr = "返回成功"; return(json); } else if (input.DBName == "TABBaseStation") { Get_OutBase_Station json = new Get_OutBase_Station(); DBGetBase_Station db = new DBGetBase_Station(); json.data = db.GetBase_StationList(); json.result = "0"; json.resultStr = "返回成功"; return(json); } else if (input.DBName == "TABBaseTrainJiaolu") { Get_OutBase_TrainJiaolu json = new Get_OutBase_TrainJiaolu(); DBGetBase_TrainJiaolu db = new DBGetBase_TrainJiaolu(); json.data = db.GetTrainJiaoLuList(); json.result = "0"; json.resultStr = "返回成功"; return(json); } else if (input.DBName == "TABBaseTrainJiaoluInSite") { Get_OutBase_TrainJiaoluInSite json = new Get_OutBase_TrainJiaoluInSite(); DBGetBase_TrainJiaoluInSite db = new DBGetBase_TrainJiaoluInSite(); json.data = db.GetTrainJiaoluInSite(); json.result = "0"; json.resultStr = "返回成功"; return(json); } else if (input.DBName == "TABBaseZFQJ") { Get_OutBase_ZFQJ json = new Get_OutBase_ZFQJ(); DBGetBase_ZFQJ db = new DBGetBase_ZFQJ(); json.data = db.GetZFQJ(); json.result = "0"; json.resultStr = "返回成功"; return(json); } else if (input.DBName == "TABOrgArea") { Get_OutOrg_Area json = new Get_OutOrg_Area(); DBGetOrg_Area db = new DBGetOrg_Area(); json.data = db.GetOrg_Area(); json.result = "0"; json.resultStr = "返回成功"; return(json); } else if (input.DBName == "TABOrgDutyUser") { Get_OutOrg_DutyUser json = new Get_OutOrg_DutyUser(); DBGetOrg_DutyUser db = new DBGetOrg_DutyUser(); json.data = db.GetOrg_DutyUser(); json.result = "0"; json.resultStr = "返回成功"; return(json); } else if (input.DBName == "TABOrgWorkShop") { Get_OutOrg_WorkShop json = new Get_OutOrg_WorkShop(); DBGetOrg_WorkShop db = new DBGetOrg_WorkShop(); json.data = db.GetOrg_WorkShop(); json.result = "0"; json.resultStr = "返回成功"; return(json); } else if (input.DBName == "TABBaseTrainNo") { Get_OutBase_TrainNo json = new Get_OutBase_TrainNo(); DBGetBase_TrainNo db = new DBGetBase_TrainNo(); json.data = db.GetBase_TrainNo(); json.result = "0"; json.resultStr = "返回成功"; return(json); } else { Get_OutError json = new Get_OutError(); json.result = "1"; json.resultStr = "未找到当前接口,从新输入key值"; return(json); } } catch (Exception ex) { Get_OutError json = new Get_OutError(); json.result = "1"; json.resultStr = "提交失败:" + ex.Message; return(Newtonsoft.Json.JsonConvert.SerializeObject(json)); } }