Esempio n. 1
0
        public int Update(List <PayShiftsDC> objPayDesignations)
        {
            int          updatedCount   = 0;
            DBConnection objConnection  = new DBConnection();
            PayShiftsDA  objPayShiftsDA = new PayShiftsDA();

            try
            {
                objConnection.Open(true);
                updatedCount = objPayShiftsDA.Update(objConnection, objPayDesignations);
                IsDirty      = objPayShiftsDA.IsDirty;
                if (IsDirty)
                {
                    objConnection.Rollback();
                }
                else
                {
                    objConnection.Commit();
                }
            }
            catch (Exception ex)
            {
                objConnection.Rollback();
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(updatedCount);
        }
Esempio n. 2
0
        public PayShiftsDC LoadByPrimaryKey(string Code)
        {
            DBConnection objConnection  = new DBConnection();
            PayShiftsDA  objPayShiftsDA = new PayShiftsDA();
            PayShiftsDC  objPayShiftsDC = null;

            try
            {
                objConnection.Open(false);
                objPayShiftsDC = objPayShiftsDA.LoadByPrimaryKey(objConnection, Code);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(objPayShiftsDC);
        }
Esempio n. 3
0
        public List <PayShiftsDC> LoadAll()
        {
            DBConnection objConnection = new DBConnection();

            PayShiftsDA        objPayShiftsDA = new PayShiftsDA();
            List <PayShiftsDC> objPayShiftsDC = null;

            try
            {
                objConnection.Open(false);
                objPayShiftsDC = objPayShiftsDA.LoadAll(objConnection);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(objPayShiftsDC);
        }
Esempio n. 4
0
        public int Insert(List <PayShiftsDC> objPayDesignations)
        {
            int          insertedCount  = 0;
            DBConnection objConnection  = new DBConnection();
            PayShiftsDA  objPayShiftsDA = new PayShiftsDA();

            try
            {
                objConnection.Open(true);
                insertedCount = objPayShiftsDA.Insert(objConnection, objPayDesignations);
                objConnection.Commit();
            }
            catch (Exception ex)
            {
                objConnection.Rollback();
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(insertedCount);
        }