Ejemplo n.º 1
0
        public int InsertEthnicity(Ethnicity objEthnicity)
        {
            objEthnicity.EthnicityID = 1;
            BeginTransaction();

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

            return objEthnicity.EthnicityID;
        }
Ejemplo n.º 2
0
        public int DeleteEthnicity(Ethnicity objEthnicity)
        {
            int rowsaffected = -1;
            BeginTransaction();
            try
            {
                String[] UpdateProperties = new String[] { "Status" };
                rowsaffected = Update(objEthnicity, UpdateProperties);

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

        }
Ejemplo n.º 3
0
        // POST api/ethnicity
        public Ethnicity Post(Ethnicity ethnicity)
        {
            if (ethnicity.GUID > 0)
            {
                ethnicity.EthnicityID = ethnicity.GUID;
                int rowResult = EthnicityBO.UpdateEthnicity(ethnicity);

                //Return Back to The Client               
                return ethnicity;
            }
            else
            {
                
                int rowResult = EthnicityBO.InsertEthnicity(ethnicity);

                //Return Back to The Client               
                return ethnicity;
            }
        }
Ejemplo n.º 4
0
        public int UpdateEthnicity(Ethnicity objEthnicity)
        {
            int rowsaffected = -1;
            BeginTransaction();
            try
            {
                String[] UpdateProperties = new String[] { "EthnicityName", "Category", "UpdatedBy", "UpdatedDate",
                                                           "Status", "ValidRegions", "SyncStatus" };
                rowsaffected = Update(objEthnicity, UpdateProperties);

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

        }
Ejemplo n.º 5
0
 public static int DeleteEthnicity(Ethnicity objEthnicity)
 {
     return new EthnicityDAO().DeleteEthnicity(objEthnicity);
 }
Ejemplo n.º 6
0
 public static int UpdateEthnicity(Ethnicity objEthnicity)
 {
     return new EthnicityDAO().UpdateEthnicity(objEthnicity);
 }
Ejemplo n.º 7
0
 public static Ethnicity GetEthnicity(int EthnicityID)
 {
     Ethnicity objEthnicity = new Ethnicity();
     return (Ethnicity)(new EthnicityDAO().FillDTO(objEthnicity, "EthnicityID=" + EthnicityID));
 }
Ejemplo n.º 8
0
 public static int InsertEthnicity(Ethnicity objEthnicity)
 {
     return new EthnicityDAO().InsertEthnicity(objEthnicity);
 }