public string GetFormMessage(GoodsSerialFormEntity form) { if (string.Compare(form.FormKind, FormKind.DispatchItem, true) == 0) { return("货品正在发货阶段!"); } else if (string.Compare(form.FormKind, FormKind.Receive, true) == 0) { return("货品正在收货阶段!"); } else if (string.Compare(form.FormKind, FormKind.ReceiveItem, true) == 0) { return("货品正在收货阶段!"); } else if (string.Compare(form.FormKind, FormKind.Inspection, true) == 0) { return("货品正在收货审核阶段!"); } else if (string.Compare(form.FormKind, FormKind.Incoming, true) == 0) { return("货品正在入库阶段!"); } else { return("货品处在未知阶段!"); } }
public static void Create(GoodsSerialFormEntity current, GoodsSerialFormEntity previous, Database db, DbTransaction trans) { previous.CreatedTime = DateTime.Now; SaveForms(previous, db, trans); Create(current, db, trans); }
private static void SaveForms(GoodsSerialFormEntity entity, Database db, DbTransaction trans) { var sql = string.Format(@"insert into goods_serial_forms(serial_id,form_id,form_kind,created_id,created_time) values(@p_serial_id,@p_form_id,@p_form_kind,@p_created_id,@p_created_time)", COLUMNS); var cmd = db.GetSqlStringCommand(sql); db.AddInParameter(cmd, "p_serial_id", DbType.String, entity.SerialId); db.AddInParameter(cmd, "p_form_id", DbType.String, entity.FormId); db.AddInParameter(cmd, "p_form_kind", DbType.String, entity.FormKind); db.AddInParameter(cmd, "p_created_id", DbType.String, entity.CreatedId); db.AddInParameter(cmd, "p_created_time", DbType.DateTime, entity.CreatedTime); db.ExecuteNonQuery(cmd, trans); }
public static void FlowNextForm(GoodsSerialFormEntity next, Database db, DbTransaction trans) { var sql = @"update goods_serial_form set form_id=@p_form_id,form_kind=@p_form_kind,created_id=@p_created_id,created_time=@p_created_time where serial_id=@p_serial_id"; var cmd = db.GetSqlStringCommand(sql); db.AddInParameter(cmd, "p_serial_id", DbType.String, next.SerialId); db.AddInParameter(cmd, "p_form_id", DbType.String, next.FormId); db.AddInParameter(cmd, "p_form_kind", DbType.String, next.FormKind); db.AddInParameter(cmd, "p_created_id", DbType.String, next.CreatedId); db.AddInParameter(cmd, "p_created_time", DbType.DateTime, next.CreatedTime); db.ExecuteNonQuery(cmd, trans); SaveForms(next, db, trans); }
public static GoodsSerialFormEntity GetBySerialId(string serialId) { var sql = string.Format("select {0} from goods_serial_form where serial_id=@p_serial_id", COLUMNS); var db = DatabaseFactory.CreateDatabase(); var cmd = db.GetSqlStringCommand(sql); db.AddInParameter(cmd, "p_serial_id", DbType.String, serialId); using (var reader = db.ExecuteReader(cmd)) { if (reader.Read()) { var entity = new GoodsSerialFormEntity(); entity.Init(reader); return(entity); } return(null); } }