public Get_OutSetIsNecessary SetToIsNecessary(string data) { Get_OutSetIsNecessary json = new Get_OutSetIsNecessary(); try { Get_InSetIsNecessary input = Newtonsoft.Json.JsonConvert.DeserializeObject<Get_InSetIsNecessary>(data); DBStepDef db = new DBStepDef(); bool i = db.SetIsNecessary(input.nID, input.nIsNecessary); if (i) { json.result = 0; json.resultStr = "返回成功"; } else { json.result = 0; json.resultStr = "更新0条数据"; } } catch (Exception ex) { json.result = 1; json.resultStr = "提交失败:" + ex.Message; } return json; }
public Get_OutStepDefList GetStepDefList(string data) { Get_OutStepDefList json = new Get_OutStepDefList(); try { Get_InStepDefList input = Newtonsoft.Json.JsonConvert.DeserializeObject<Get_InStepDefList>(data); DBStepDef db = new DBStepDef(); List<MDstepDef> StepDefList = db.GetStepDefList(input.strWorkShopGUID, input.nWorkTypeID); if (StepDefList != null && StepDefList.Count > 0) { json.data = StepDefList; json.result = 0; json.resultStr = "获取成功"; } } catch (Exception ex) { json.result = 1; json.resultStr = "获取成功:" + ex.Message; } return json; }