コード例 #1
0
ファイル: StudentModels.cs プロジェクト: manish-sf/Vedanta
        public static int UpdateFeeCollection(FeeCollections newFee)
        {
            using (VedantaEntities ve = new VedantaEntities())
            {
                FeeCollections oldFee = ve.FeeCollections.FirstOrDefault(st => st.Id == newFee.Id);

                if (oldFee == null)
                {
                    return(-1);//Admission record not found.
                }
                newFee.AdmissionId = oldFee.AdmissionId;
                var updatedFee = ve.ApplyCurrentValues(oldFee.GetType().Name, newFee);
                return(ve.SaveChanges());
            }
        }