|
|
|
@ -909,22 +909,61 @@ public class CM_State_Change_TemplatImportService : CMServiceBase, ICM_State_Cha
|
|
|
|
|
newchange.Id = 0;
|
|
|
|
|
newchange.Pid = req.Id;
|
|
|
|
|
Type type = newchange.GetType();
|
|
|
|
|
|
|
|
|
|
var XXDM = "";
|
|
|
|
|
var XXHM = "";
|
|
|
|
|
var Vessel = "";
|
|
|
|
|
var Voyno = "";
|
|
|
|
|
|
|
|
|
|
foreach (var 字段 in 字段列表)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrWhiteSpace(字段.Value))
|
|
|
|
|
continue;
|
|
|
|
|
var field = type.GetProperty(字段.Value);
|
|
|
|
|
|
|
|
|
|
if (field != null && dt.Columns.Contains(字段.Name))
|
|
|
|
|
{
|
|
|
|
|
var _value = row[字段.Name];
|
|
|
|
|
field.SetValue(newchange, _value);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (field == null && 字段.Value == "XXDM")
|
|
|
|
|
{
|
|
|
|
|
XXDM = row[字段.Name].ToString();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (field == null && 字段.Value == "XXHM")
|
|
|
|
|
{
|
|
|
|
|
XXHM = row[字段.Name].ToString();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (field == null && 字段.Value == "Vessel")
|
|
|
|
|
{
|
|
|
|
|
Vessel = row[字段.Name].ToString();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (field == null && 字段.Value == "Voyno")
|
|
|
|
|
{
|
|
|
|
|
Voyno = row[字段.Name].ToString();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
//throw new ArgumentException("Field not found", fieldName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (XXDM != "" && XXHM != "") {
|
|
|
|
|
newchange.Ctnall= XXDM + XXHM;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Vessel != "" && Voyno != "")
|
|
|
|
|
{
|
|
|
|
|
newchange.VesselVoyno = Vessel +" : "+ Voyno;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
changelist.Add(newchange);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -1187,6 +1226,11 @@ public class CM_State_Change_TemplatImportService : CMServiceBase, ICM_State_Cha
|
|
|
|
|
var _pid = reqtype.GetProperty("Pid");
|
|
|
|
|
_pid.SetValue(newchange, req.Id);
|
|
|
|
|
|
|
|
|
|
var XXDM = "";
|
|
|
|
|
var XXHM = "";
|
|
|
|
|
var Vessel = "";
|
|
|
|
|
var Voyno = "";
|
|
|
|
|
|
|
|
|
|
foreach (var 字段 in 字段列表)
|
|
|
|
|
{
|
|
|
|
|
//if (string.IsNullOrWhiteSpace(字段.Value))
|
|
|
|
@ -1228,12 +1272,48 @@ public class CM_State_Change_TemplatImportService : CMServiceBase, ICM_State_Cha
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
if (field == null && 字段.FieldTitle == "XXDM")
|
|
|
|
|
{
|
|
|
|
|
XXDM = row[字段.ColumnTitle].ToString();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (field == null && 字段.FieldTitle == "XXHM")
|
|
|
|
|
{
|
|
|
|
|
XXHM = row[字段.ColumnTitle].ToString();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (field == null && 字段.FieldTitle == "Vessel")
|
|
|
|
|
{
|
|
|
|
|
Vessel = row[字段.ColumnTitle].ToString();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (field == null && 字段.FieldTitle == "Voyno")
|
|
|
|
|
{
|
|
|
|
|
Voyno = row[字段.ColumnTitle].ToString();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
//throw new ArgumentException("Field not found", fieldName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (XXDM != "" && XXHM != "")
|
|
|
|
|
{
|
|
|
|
|
var field = reqtype.GetProperty("Ctnall");
|
|
|
|
|
if(field!=null)
|
|
|
|
|
field.SetValue(newchange, XXDM+ XXHM);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Vessel != "" && Voyno != "")
|
|
|
|
|
{
|
|
|
|
|
var field = reqtype.GetProperty("VesselVoyno");
|
|
|
|
|
if (field != null)
|
|
|
|
|
field.SetValue(newchange, Vessel +" : "+ Voyno);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
changelist.Add(newchange);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|