Commit 0abd4531 authored by solho's avatar solho

修正新增流程

parent 08db1d4f
......@@ -188,7 +188,7 @@ namespace WebAPI.Controllers
etfs.* FROM esn_todos et
left join esn_todos_Flow etf on et.sn=etf.esn_todos_sn
left join esn_todos_Flow_StepType etfs on etfs.id=etf.StepType_id
where Esn_Todos_Sn in(@Esn_Todos_Sn)
where et.sn in(@Esn_Todos_Sn)
";
......@@ -212,9 +212,9 @@ namespace WebAPI.Controllers
int StepType_id_Previous, StepType_id;
foreach (DataRow dr in ds.Tables[0].Rows)
{
StepType_id_Previous = Convert.ToInt32(dr["StepType_id_Previous"]);
StepType_id_Previous = dr["StepType_id_Previous"] == DBNull.Value ? 0 : Convert.ToInt32(dr["StepType_id_Previous"]);
//StepType_id_next = Convert.ToInt32(dr["StepType_id_next"]);
StepType_id = Convert.ToInt32(dr["StepType_id"]);
StepType_id = dr["StepType_id"] == DBNull.Value ? 0 : Convert.ToInt32(dr["StepType_id"]);
Esn_Todos_Flow_StepTypeModel CStepTypeNext = new Esn_Todos_Flow_StepTypeModel(), CStepTypeCur = new Esn_Todos_Flow_StepTypeModel();
if (dr["esn_todos_sn"] == DBNull.Value) //insert
{
......@@ -224,7 +224,7 @@ namespace WebAPI.Controllers
Tsql = @"insert into esn_todos_Flow(esn_todos_sn,[StepType_id],[" + CStepTypeCur.Map_Class
+ @"_IsConfirm],StepType_id_Previous,Description,[create_user_id],[Create_time],update_user_id,update_time) "
+ " OUTPUT Inserted.id into @TempTable "
+ " values (" + dr["esn_todos_sn"] + ",'" + CStepTypeNext.id + "'," + IsConfirm + ",'" + 1
+ " values (" + dr["sn"] + ",'" + CStepTypeNext.id + "'," + IsConfirm + ",'" + 1
+ "','" + Reject_Description + "','" + Wade_User_ID + "'" + ",'" + date0 + "'" + ",'" + Wade_User_ID + "'" + ",'" + date0 + "'" + "); "
;
......@@ -258,8 +258,12 @@ namespace WebAPI.Controllers
{
CStepTypeNext = AllStepType.Where(p => p.id == StepType_id_Previous).FirstOrDefault();
CStepTypeCur.id = CStepTypeNext.id; //回復與下一步 同ID
Tsql = Tsql + CStepTypeCur.Map_Class + "_IsConfirm =" + IsConfirm + ",";
}
else
{
Tsql = Tsql + CStepTypeCur.Map_Class + "_IsConfirm =" + IsConfirm + ",";
}
Tsql = Tsql + CStepTypeCur.Map_Class + "_IsConfirm =" + IsConfirm + ",";
Tsql = Tsql + " StepType_id = '" + CStepTypeNext.id + "',StepType_id_Previous = '" + CStepTypeCur.id +
"',Description = '" + Reject_Description + "',update_user_id='" + Wade_User_ID + "',update_time='" + date0 + "' "
+ " output Inserted.id into @TempTable where id =" + dr["Flowid"] + ";"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment