コード例 #1
0
ファイル: EducationDTO.cs プロジェクト: sadallo/UMNewProject
 public static EducationDto createEducationDTO(Education obj)
 {
     EducationDto edu = new EducationDto();
     edu.EducationId = obj.EducationId;
     edu.EducationDescription = obj.EducationDescription;
     return edu;
 }
コード例 #2
0
ファイル: Education.cs プロジェクト: sadallo/UMNewProject
 public static Education createEducation(String EducationId, String EducationDescription)
 {
     Education obj = new Education();
     obj.EducationId = EducationId;
     obj.EducationDescription = EducationDescription;
     return obj;
 }
コード例 #3
0
 public Education selectEducationById(Education obj)
 {
     try
     {
         IEducationSvc svc = (IEducationSvc)this.getService(typeof(IEducationSvc).Name);
         return svc.selectEducationById(obj);
     }
     catch (ServiceLoadException ex)
     {
         return null;
     }
 }
コード例 #4
0
 public Boolean deleteEducation(Education obj)
 {
     try
     {
         IEducationSvc svc = (IEducationSvc)this.getService(typeof(IEducationSvc).Name);
         return svc.deleteEducation(obj);
     }
     catch (ServiceLoadException ex)
     {
         return false;
     }
 }
コード例 #5
0
        public Education selectEducationById(Education obj)
        {
            NewRecruiteeBankContext db = new NewRecruiteeBankContext();

            try
            {

                return db.Educations.SqlQuery("dbo.SelectEducationById @EducationId='" + obj.EducationId.ToString() + "'").Single();
            }
            catch (Exception ex)
            {
                return null;
            }
        }
コード例 #6
0
        public Boolean insertEducation(Education obj)
        {
            using (NewRecruiteeBankContext db = new NewRecruiteeBankContext())
            {
                try
                {
                    db.Educations.Add(obj);
                    db.SaveChanges();
                    return true;
                }
                catch (Exception ex)
                {
                    return false;
                }

            }
        }
コード例 #7
0
        public Boolean deleteEducation(Education obj)
        {
            using (NewRecruiteeBankContext db = new NewRecruiteeBankContext())
            {
                try
                {
                    Education edu = db.Educations.SqlQuery("dbo.SelectEducationById @EducationId='" + obj.EducationId.ToString() + "'").Single();

                    if (edu != null)
                    {
                        db.Educations.Remove(edu);
                        #region Database Submission

                        try
                        {
                            db.SaveChanges();
                            return true;
                        }
                        catch (Exception ex)
                        {
                            return false;
                        }

                        #endregion
                    }
                    else
                    {
                        return false;
                    }
                }
                catch (Exception ex)
                {
                    return false;
                }
            }
        }