public static void deleteCertificateExist(int id) { certificateExist ce = db.certificateExist.Find(id); if (ce != null) { db.certificateExist.Remove(ce); } db.SaveChanges(); }
//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); }
//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; } }
public static CcertificateExist convertCommonCertificate(certificateExist c) { CcertificateExist certificate = new CcertificateExist(c.Id, c.statusCertificate, c.dayCareCenterId, c.issueDate, c.certificateId, c.picture); return(certificate); }