示例#1
0
        public int Update(List <PayLeavesDC> objPayDesignations)
        {
            int          updatedCount   = 0;
            DBConnection objConnection  = new DBConnection();
            PayLeavesDA  objPayLeavesDA = new PayLeavesDA();

            try
            {
                objConnection.Open(true);
                updatedCount = objPayLeavesDA.Update(objConnection, objPayDesignations);
                IsDirty      = objPayLeavesDA.IsDirty;
                if (IsDirty)
                {
                    objConnection.Rollback();
                }
                else
                {
                    objConnection.Commit();
                }
            }
            catch (Exception ex)
            {
                objConnection.Rollback();
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(updatedCount);
        }
示例#2
0
        public PayLeavesDC LoadByPrimaryKey(string Code)
        {
            DBConnection objConnection  = new DBConnection();
            PayLeavesDA  objPayLeavesDA = new PayLeavesDA();
            PayLeavesDC  objPayLeavesDC = null;

            try
            {
                objConnection.Open(false);
                objPayLeavesDC = objPayLeavesDA.LoadByPrimaryKey(objConnection, Code);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(objPayLeavesDC);
        }
示例#3
0
        public List <PayLeavesDC> LoadAll()
        {
            DBConnection objConnection = new DBConnection();

            PayLeavesDA        objPayLeavesDA = new PayLeavesDA();
            List <PayLeavesDC> objPayLeavesDC = null;

            try
            {
                objConnection.Open(false);
                objPayLeavesDC = objPayLeavesDA.LoadAll(objConnection);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(objPayLeavesDC);
        }
示例#4
0
        public int Delete(List <PayLeavesDC> objPayDesignations)
        {
            int          deletedCount   = 0;
            DBConnection objConnection  = new DBConnection();
            PayLeavesDA  objPayLeavesDA = new PayLeavesDA();

            try
            {
                objConnection.Open(true);
                deletedCount = objPayLeavesDA.Delete(objConnection, objPayDesignations);
                objConnection.Commit();
            }
            catch (Exception ex)
            {
                objConnection.Rollback();
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(deletedCount);
        }