コード例 #1
0
        public LeaveVO GetByID(int id)
        {
            LeaveVO   vo = new LeaveVO();
            DataTable dt = Select("ID=" + id + "");

            if (dt.Rows.Count > 0)
            {
                vo = b.ConvertObj(dt.Rows[0], new LeaveVO()) as LeaveVO;
            }
            return(vo);
        }
コード例 #2
0
        public LeaveVO GetByLeaveName(string value)
        {
            LeaveVO   vo = new LeaveVO();
            DataTable dt = b.SelectByQuery("Select * From Leave Where LeaveName=N'" + value + "'");

            if (dt.Rows.Count > 0)
            {
                vo = b.ConvertObj(dt.Rows[0], new LeaveVO()) as LeaveVO;
            }
            return(vo);
        }
コード例 #3
0
        public int Insert(LeaveVO vo)
        {
            int lastInsertId = 0;

            try
            {
                lastInsertId = b.Insert("Leave", b.ConvertColName(vo), b.ConvertValueList(vo));
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            return(lastInsertId);
        }
コード例 #4
0
        public int Create(LeaveVO vo)
        {
            int id;

            if (!dao.isExist(vo.Id.ToString()))
            {
                id = dao.Insert(vo);
            }
            else
            {
                id = dao.Update(vo);
            }
            return(id);
        }
コード例 #5
0
        public int Update(LeaveVO vo)
        {
            int ID = 0;

            try
            {
                b.Update("Leave", vo.Id.ToString(), b.ConvertColName(vo), b.ConvertValueList(vo));
                ID = vo.Id;
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            return(ID);
        }