// GET api/educationalstatus
 public IEnumerable<EducationalStatus> Get()
 {
     List<EducationalStatus> listEducationalStatus = new List<EducationalStatus>();
     DataView dvEducationalStatus = EducationalStatusBO.GetEducationalStatusIDForSync();
     foreach (DataRowView drvEducationalStatus in dvEducationalStatus)
     {
         EducationalStatus educationalStaus = new EducationalStatus();
         listEducationalStatus.Add(EducationalStatusBO.GetEducationalStatus(Convert.ToInt32(drvEducationalStatus["EducationalStatusID"])));
     }
     return listEducationalStatus;
 }
        public int InsertEduationalStatus(EducationalStatus objEducationalStatus)
        {
            objEducationalStatus.EducationalStatusID = 1;
            BeginTransaction();

            try
            {
                objEducationalStatus.EducationalStatusID = Insert(objEducationalStatus);
                CommitTransaction();
            }
            catch (Exception ex)
            {
                RollBackTransaction();
                objEducationalStatus.EducationalStatusID = -1;
            }

            return objEducationalStatus.EducationalStatusID;
        }
        public int DeleteEducationalStatus(EducationalStatus objEducationalStatus)
        {
            int rowsaffected = -1;
            BeginTransaction();
            try
            {
                String[] UpdateProperties = new String[] { "Status" };
                rowsaffected = Update(objEducationalStatus, UpdateProperties);

                CommitTransaction();
            }
            catch (Exception e)
            {
                RollBackTransaction();
                rowsaffected = -1;
            }
            return rowsaffected;

        }
        // POST api/educationalstatus
        public EducationalStatus Post(EducationalStatus education)
        {

            if (education.GUID > 0)
            {
                education.EducationalStatusID = education.GUID;
                int rowResult = EducationalStatusBO.UpdateEducationalStatus(education);

                //Return Back to The Client               
                return education;
            }
            else
            {
                education.GUID = education.EducationalStatusID;               
                int rowResult = EducationalStatusBO.InsertEduationalStatus(education);

                //Return Back to The Client               
                return education;
            }
        }
 public static int DeleteEducationalStatus(EducationalStatus objEducationalStatus)
 {
     return new EducationalStatusDAO().DeleteEducationalStatus(objEducationalStatus);
 }
 public static int UpdateEducationalStatus(EducationalStatus objEducationalStatus)
 {
     return new EducationalStatusDAO().UpdateEducationalStatus(objEducationalStatus);
 }
 public static EducationalStatus GetEducationalStatus(int EducationalStatusID)
 {
     EducationalStatus objEducationalStatus = new EducationalStatus();
     return (EducationalStatus)(new EducationalStatusDAO().FillDTO(objEducationalStatus, "EducationalStatusID=" + EducationalStatusID));
 }
 public static int InsertEduationalStatus(EducationalStatus objEducationalStatus)
 {
     return new EducationalStatusDAO().InsertEduationalStatus(objEducationalStatus);
 }