public Get_Out SubmitSteps(string data) { Get_Out OutResult = new Get_Out(); Datas input = Newtonsoft.Json.JsonConvert.DeserializeObject<Datas>(data); Operate oper = OperationFactoty.createOperate(input.stepName,input.nWorkTypeID); try { if (oper != null) { oper.GetResult(input.stepEntity, input.nWorkTypeID); //检测是否是特殊步骤 oper.CheckIsSpecialStep(); OutResult.result = "0"; OutResult.resultStr = "执行成功!"; } else { OutResult.resultStr = "提交失败:无法找到该步骤,该步骤名称:" + input.stepName; } } catch (Exception ex) { OutResult.result = "1"; OutResult.resultStr = "提交失败:" + ex.Message; } return OutResult; }
public static Operate createOperate(string operate, int nWorkTypeID) { Operate oper = null; switch (operate) { case WorkType.WorkReading: oper = new WorkReading(); break; case WorkType.Gxhcq: oper = new Gxhcq(); break; case WorkType.CheckCard: oper = new CheckCard(); break; case WorkType.PubJiShiGouHua: oper = new PubJiShiGouHua(); break; case WorkType.PubJiShiRead: oper = new PubJiShiRead(); break; case WorkType.Drink: oper = new Drink(); break; case WorkType.TQZhuanChu: oper = new TQZhuanChu(); break; default: oper = new QiTa(); break; } return(oper); }