Ejemplo n.º 1
0
        public Sals PostNistData([FromBody] NistSalModel updateValue)
        {
            int            assessmentId = Auth.AssessmentForUser();
            NistSalManager nistSal      = new NistSalManager();

            return(nistSal.UpdateSalValue(updateValue, assessmentId));
        }
Ejemplo n.º 2
0
        public Sals UpdateSalValue(NistSalModel updateValue, int assessmentid)
        {
            TinyMapper.Bind <NistSalModel, NIST_SAL_INFO_TYPES>(config =>
            {
                config.Ignore(x => x.Assessment_Id);
            });

            using (CSET_Context db = new CSET_Context())
            {
                NIST_SAL_INFO_TYPES update = db.NIST_SAL_INFO_TYPES.Where(x => x.Assessment_Id == assessmentid && x.Type_Value == updateValue.Type_Value).FirstOrDefault();
                TinyMapper.Map <NistSalModel, NIST_SAL_INFO_TYPES>(updateValue, update);
                db.SaveChanges();
                return(CalculateOveralls(assessmentid, db));
            }
        }