Example #1
0
        public static void deleteCertificateExist(int id)
        {
            certificateExist ce = db.certificateExist.Find(id);

            if (ce != null)
            {
                db.certificateExist.Remove(ce);
            }
            db.SaveChanges();
        }
Example #2
0
        //certificate
        public static certificateExist ConvertCertificateExist(CcertificateExist c)
        {
            certificateExist ce = new certificateExist();

            ce.Id = c.Id;
            ce.statusCertificate = c.statusCertificate;
            ce.dayCareCenterId   = c.dayCareCenterId;
            ce.picture           = c.picture;
            ce.issueDate         = c.issueDate;
            ce.certificateId     = c.certificateId;
            return(ce);
        }
Example #3
0
        //public static void addCertificateExist(string id, int statusCertificate, string dayCareCenterId,/*string picture,*/ DateTime issueDate, int certificateId)
        //{

        //    try
        //    {
        //        db.certificateExist.Add(new certificateExist()
        //        {
        //            Id = id,
        //            statusCertificate = statusCertificate,
        //            dayCareCenterId = dayCareCenterId,
        //            issueDate = issueDate,
        //            certificateId = certificateId
        //        });
        //        db.SaveChanges();
        //    }
        //    catch (Exception e)
        //    {
        //        throw e;
        //    }
        //}
        public static void addCertificateExist(CcertificateExist cce)
        {
            certificateExist ce = mapper.ConvertCertificateExist(cce);

            try
            {
                using (var db = new DBEntities())
                {
                    db.certificateExist.Add(ce);
                    db.SaveChanges();
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Example #4
0
        public static CcertificateExist convertCommonCertificate(certificateExist c)
        {
            CcertificateExist certificate = new CcertificateExist(c.Id, c.statusCertificate, c.dayCareCenterId, c.issueDate, c.certificateId, c.picture);

            return(certificate);
        }