public void InsertByAssociateTypeId_InvalidInput_Failure() { #region Arrange var associate = new Associate { Created = DateTime.Now }; var associateType = new AssociateType { Created = DateTime.Now }; _dbContext.Associates.Add(associate); _dbContext.AssociateTypes.Add(associateType); _dbContext.SaveChanges(); #endregion #region Act var response = _repository.InsertByAssociateTypeId(-1, new List <int> { associate.Id }); #endregion #region Assert Assert.AreEqual(response.Success, false); Assert.AreEqual(_dbContext.AssociateAssociateTypes.Count(), 0); #endregion }
public AssociateTypeManageModel(AssociateType associateType) : this() { Id = associateType.Id; Name = associateType.Name; RecordOrder = associateType.RecordOrder; }
public void InsertByAssociateId_ValidInput_Success() { #region Arrange var associate = new Associate { Created = DateTime.Now }; _dbContext.Associates.Add(associate); var associateType = new AssociateType { Created = DateTime.Now }; _dbContext.AssociateTypes.Add(associateType); _dbContext.SaveChanges(); #endregion #region Act _repository.InsertByAssociateId(associate.Id, new List <int> { associateType.Id }); #endregion #region Assert Assert.AreEqual(_dbContext.AssociateAssociateTypes.Count(), 1); #endregion }
/// <summary> /// Get the associate of type nAssociateType belonging to oMaster. /// - nAssociateType: ASSOCIATE_TYPE_* /// - nMaster /// - nTh: Which associate of the specified type to return /// * Returns OBJECT_INVALID if no such associate exists. /// </summary> public static uint GetAssociate(AssociateType nAssociateType, uint oMaster = OBJECT_INVALID, int nTh = 1) { Internal.NativeFunctions.StackPushInteger(nTh); Internal.NativeFunctions.StackPushObject(oMaster); Internal.NativeFunctions.StackPushInteger(nAssociateType.InternalValue); Internal.NativeFunctions.CallBuiltIn(364); return(Internal.NativeFunctions.StackPopObject()); }
public static bool CreateIncludeFileByAssociateType(AssociateType associateType) { foreach (IncludeFileInfo info in GetIncludeFileListByAssociateType(associateType)) { CreateIncludeFile(info); } return(true); }
public AssociateTypeDetailModel(AssociateType associateType) : this() { Id = associateType.Id; AssociateType = new AssociateTypeManageModel(associateType); Created = associateType.Created; CreatedBy = associateType.CreatedBy; LastUpdate = associateType.LastUpdate; LastUpdateBy = associateType.LastUpdateBy; }
public IList <IncludeFileInfo> GetIncludeFileListByAssociateType(AssociateType associateType) { List <IncludeFileInfo> list = new List <IncludeFileInfo>(); Parameters cmdParams = new Parameters(); cmdParams.AddInParameter("@AssociateType", DbType.Int32, associateType); using (NullableDataReader reader = DBHelper.ExecuteReaderSql("SELECT * FROM PE_IncludeFile WHERE AssociateType = @AssociateType ORDER BY ID DESC", cmdParams)) { while (reader.Read()) { list.Add(GetIncludeFileInfoFromDataReader(reader)); } } return(list); }
/// <summary> /// 新增一条记录 /// </summary> /// <param name="qcRecord">质检实体</param> /// <returns></returns> public static bool InsertOneQCRecord(AssociateType qcRecord) { bool rbool = true; using (DCCarManagementDataContext db = new DCCarManagementDataContext()) { try { rbool = LinQBaseDao.InsertOne(db, qcRecord); } catch { rbool = false; } finally { db.Connection.Close(); } } return(rbool); }
public void InsertByAssociateTypeId_ValidInput_Success() { #region Arrange var associate = new Associate { FirstName = "First name", LastName = "Last name", Created = DateTime.Now, LastUpdate = DateTime.Now }; _dbContext.Associates.Add(associate); var associateType = new AssociateType { Name = "Associate Type", Created = DateTime.Now, LastUpdate = DateTime.Now }; _dbContext.AssociateTypes.Add(associateType); #endregion #region Act _repository.InsertByAssociateTypeId(associateType.Id, new List <int> { associate.Id }); #endregion #region Assert Assert.AreEqual(_dbContext.AssociateAssociateTypes.Count(), 1); #endregion }
public AssociateTypeModel(AssociateType associateType) : base(associateType) { Name = associateType.Name; }
internal ResponseModel Delete(AssociateType associateType) { return(_associateTypeRepository.Delete(associateType)); }
internal ResponseModel Insert(AssociateType associateType) { return(_associateTypeRepository.Insert(associateType)); }
public static IList <IncludeFileInfo> GetIncludeFileListByAssociateType(AssociateType associateType) { return(dal.GetIncludeFileListByAssociateType(associateType)); }