Пример #1
0
 public void UpdateMaterialPart(MaterialPart part)
 {
     StoredProcUpdate("spMaterialPartUpdate",
         _P("intMaterialPartID", part.MaterialPartID),
         _P("intMaterialID", part.MaterialID),
         _P("vchrPartName", part.PartName),
         _P("vchrSampleType", part.SampleType),
         _P("intNoSpecimens", part.NoSpecimens),
         _P("vchrNoSpecimensQual", part.NoSpecimensQual),
         _P("vchrLifestage", part.Lifestage),
         _P("vchrGender", part.Gender),
         _P("vchrRegNo", part.RegNo),
         _P("vchrCondition", part.Condition),
         _P("vchrStorageSite", part.StorageSite),
         _P("vchrStorageMethod", part.StorageMethod),
         _P("vchrCurationStatus", part.CurationStatus),
         _P("txtNotes", part.Notes)
     );
 }
Пример #2
0
        private int AddMaterialPart(int materialId)
        {
            var numberOfSpecimens = GetConvert<int?>("Material.Number of specimens");
            if (!numberOfSpecimens.HasValue || numberOfSpecimens.Value == 0) {
                numberOfSpecimens = 1;
            }

            var part = new MaterialPart {
                MaterialID = materialId,
                PartName = Get("Material.Part name"),
                SampleType = Get("Material.Sample type"),
                NoSpecimens = numberOfSpecimens,
                NoSpecimensQual = Get("Material.Number of specimens qualifier"),
                Lifestage = Get("Material.Life stage"),
                Gender = Get("Material.Gender"),
                RegNo = Get("Material.Part registration number"),
                Condition = Get("Material.Condition"),
                StorageSite = Get("Material.Storage site"),
                StorageMethod = Get("Material.Storage method"),
                CurationStatus = Get("Material.Curation status"),
                Notes = Get("Material.Subpart Notes")
            };

            var matService = new MaterialService(User);

            return matService.InsertMaterialPart(part);
        }
Пример #3
0
        public int InsertMaterialPart(MaterialPart part)
        {
            var retval = ReturnParam("NewMaterialPartID");

            StoredProcUpdate("spMaterialPartInsert",
                _P("intMaterialID", part.MaterialID),
                _P("vchrPartName", part.PartName),
                _P("vchrSampleType", part.SampleType),
                _P("intNoSpecimens", part.NoSpecimens),
                _P("vchrNoSpecimensQual", part.NoSpecimensQual),
                _P("vchrLifestage", part.Lifestage),
                _P("vchrGender", part.Gender),
                _P("vchrRegNo", part.RegNo),
                _P("vchrCondition", part.Condition),
                _P("vchrStorageSite", part.StorageSite),
                _P("vchrStorageMethod", part.StorageMethod),
                _P("vchrCurationStatus", part.CurationStatus),
                _P("txtNotes", part.Notes),
                retval
            );

            return (int)retval.Value;
        }