public Education_AgentPassportSafety SaveExistingCertification(Education_AgentPassportSafety education_AgentPassportSafety) { var certif = db.Education_AgentPassportSafety .Where(w => w.AgentPassportSafety_Id == education_AgentPassportSafety.AgentPassportSafety_Id).FirstOrDefault(); certif.AgentPassportSafety_Passport = education_AgentPassportSafety.AgentPassportSafety_Passport; db.SaveChanges(); return(certif); }
public FrmCertificate(string type, bool isNew, long PassportId, Education_Agent agent) { InitializeComponent(); typeCertificate = type; AgentSelected = agent; isNewCertificate = isNew; if (isNewCertificate) { LoadNewForm(typeCertificate); } else { switch (typeCertificate) { case "Safety": AgentPassportSafetySelected = PassportSafetyRepository.LoadSinglePassport(PassportId); break; case "Business": AgentPassportBusinessSelected = PassportBusinessRepository.LoadSinglePassport(PassportId); break; case "Function": AgentCertifElecFuncSelected = CertificateElecFuncRepository.LoadSinglePassport(PassportId); break; case "OPP": AgentCertifElecOPPSelected = CertificateElecOPPRepository.LoadSinglePassport(PassportId); break; case "Design": AgentPassportDesignSelected = PassportDesignRepository.LoadSinglePassport(PassportId); break; case "Divers": AgentPassportDiversSelected = AgentCertifDiversRepository.LoadSingleCertificate(PassportId); break; } LoadForm(typeCertificate); } }
internal Education_AgentPassportSafety SaveNewSafetyPassport(Education_AgentPassportSafety agentPassportSafetySelected) { throw new NotImplementedException(); }
private void btnSaveCertification_Click(object sender, EventArgs e) { if (isNewCertificate) { switch (typeCertificate) { case "Safety": AgentPassportSafetySelected = AgentPassportSafetyRepository.SaveNewSafetyPassport(AgentPassportSafetySelected); break; case "Business": AgentPassportBusinessSelected = AgentPassportBusinessRepository.SaveNewBusinessPassport(AgentPassportBusinessSelected); break; case "Function": AgentCertifElecFuncSelected = agentCertifElecFuncRepository.SaveNewCertifFunc(AgentCertifElecFuncSelected); break; case "OPP": AgentCertifElecOPPSelected = AgentCertifElecOPPRepository.NewPassportDivers(AgentCertifElecOPPSelected); break; case "Design": AgentPassportDesignSelected = AgentPassportDesignRepository.SaveExistingPs(AgentPassportDesignSelected); break; case "Divers": AgentPassportDiversSelected = AgentCertifDiversRepository.NewPassportDivers(AgentPassportDiversSelected); break; } } else { switch (typeCertificate) { case "Safety": AgentPassportSafetySelected = PassportSafetyRepository.SaveExistingCertification(AgentPassportSafetySelected); break; case "Business": AgentPassportBusinessSelected = PassportBusinessRepository.SaveExistingPs(AgentPassportBusinessSelected); break; case "Function": AgentCertifElecFuncSelected = CertificateElecFuncRepository.SaveExistingCertification(AgentCertifElecFuncSelected); break; case "OPP": AgentCertifElecOPPSelected = AgentCertifElecOPPRepository.SaveExistingCertification(AgentCertifElecOPPSelected); break; case "Design": AgentPassportDesignSelected = PassportDesignRepository.SaveExistingPs(AgentPassportDesignSelected); break; case "Divers": AgentPassportDiversSelected = AgentCertifDiversRepository.NewPassportDivers(AgentPassportDiversSelected); break; } } }
private void LoadNewForm(string typeCertificate) { switch (typeCertificate) { case "Safety": FillLabels("Safety"); AgentPassportSafetySelected = new Education_AgentPassportSafety(); AgentPassportSafetySelected.AgentPassportSafety_Agent = AgentSelected.Agent_Id; AgentPassportSafetySelected.AgentPassportSafety_SendingDate = DateTime.Now; AgentPassportSafetySelected.AgentPassportSafety_ReturnDate = DateTime.Now; break; case "Business": FillLabels("Business"); AgentPassportBusinessSelected = new Education_AgentPassportBusiness(); AgentPassportBusinessSelected.AgentPassportBusiness_Agent = AgentSelected.Agent_Id; AgentPassportBusinessSelected.AgentPassportBusiness_SendingDate = DateTime.Now; AgentPassportBusinessSelected.AgentPassportBusiness_ReturnDate = DateTime.Now; break; case "Function": FillLabels("Function"); AgentCertifElecFuncSelected = new Education_AgentCertifElecFunc(); AgentCertifElecFuncSelected.AgentCertifElecFunc_Agent = AgentSelected.Agent_Id; AgentCertifElecFuncSelected.AgentCertifElecFunc_SendingDate = DateTime.Now; AgentCertifElecFuncSelected.AgentCertifElecFunc_ReceivedDate = DateTime.Now; break; case "OPP": FillLabels("OPP"); AgentCertifElecOPPSelected = new Education_AgentCertifElecOPP(); AgentCertifElecOPPSelected.AgentCertifElecOPP_Agent = AgentSelected.Agent_Id; AgentCertifElecOPPSelected.AgentCertifElecOPP_ReceivedDate = DateTime.Now; AgentCertifElecOPPSelected.AgentCertifElecOPP_SendingDate = DateTime.Now; break; case "Design": FillLabels("Design"); AgentPassportDesignSelected = new Education_AgentPassportDesign(); AgentPassportDesignSelected.AgentPassportDesign_Agent = AgentSelected.Agent_Id; AgentPassportDesignSelected.AgentPassportDesign_ReceivedDate = DateTime.Now; AgentPassportDesignSelected.AgentPassportDesign_SendingDate = DateTime.Now; break; case "Divers": FillLabels("Divers"); AgentPassportDiversSelected = new Education_AgentCertificatDivers(); AgentPassportDiversSelected.AgentCertificatDivers_Agent = AgentSelected.Agent_Id; AgentPassportDiversSelected.AgentCertificatDivers_ReturnDate = DateTime.Now; AgentPassportDiversSelected.AgentCertificatDivers_SendingDate = DateTime.Now; break; } }
public MyColumnCollectionDGPassportSafety(Education_AgentPassportSafety obj) { _obj = obj; }