using DeviceRepair.DataAccess.Data; using DeviceRepair.Models; using DeviceRepair.Models.SFC; using NLog; using System; using System.Collections.Generic; using System.Data.SqlClient; namespace DeviceRepair.DataAccess.SFC { public class BatchDa : BaseDa { private static readonly Logger log = LogManager.GetCurrentClassLogger(); public BatchDa(IDictionary apiParams) : base(apiParams) { } /// /// 判断批次是否存在 /// /// /// public APIResponseData GetBatchInfoToStaff(out bool BatchExists) { BatchExists = false; try { string Batch = base.GetParamString("Batch", "批次号"); int Count = sfcData.Queryable().Count(x => x.Batch.ToUpper().Equals(Batch.ToUpper())); BatchExists = Count > 0; return new APIResponseData { Code = 1 }; } catch (SqlException sqlEx) { throw sqlEx; } catch (Exception ex) { log.Error(ex); throw ex; } } } }