Ejemplo n.º 1
0
        //public int DeleteNashPointProfile(int NPID)
        //{
        //    var cont = new SeniorLinqDataContext();
        //    var query = (from npp in cont.NashPointProfiles where npp.NPID == NPID select npp).SingleOrDefault();
        //    cont.NashPointProfiles.DeleteOnSubmit(query);
        //    cont.SubmitChanges();
        //    var q = (from npp in cont.NashPointProfiles where npp.NPID == NPID select npp).SingleOrDefault();
        //    if (q == null)
        //        return 1;
        //    else return -1;
        //}
        public NashPointProfileModel RetreiveNashPointProfile(int NPID)
        {
            var cont  = new SeniorLinqDataContext();
            var query = (from npp in cont.NashPointProfiles where npp.NPID == NPID select npp).SingleOrDefault();
            NashPointProfileModel nppm = new NashPointProfileModel();

            nppm.NPID = query.NPID;
            nppm.GID  = query.GID;
            return(nppm);
        }
Ejemplo n.º 2
0
        public int AddNashPointProfile(NashPointProfileModel NP)
        {
            var cont = new SeniorLinqDataContext();
            NashPointProfile temp = new NashPointProfile();

            temp.NPID = NP.NPID;
            temp.GID  = NP.GID;
            cont.NashPointProfiles.InsertOnSubmit(temp);
            cont.SubmitChanges();
            var query = (from np in cont.NashPointProfiles where np.NPID == temp.NPID && np.NPID == temp.NPID select np.NPID).SingleOrDefault();

            if (query != null)
            {
                return(query);
            }
            return(-1);
        }