Пример #1
0
        /// <summary>
        /// 根据条件获取实体集合
        /// </summary>
        /// <param name="pc">pc</param>
        /// <param name="obc">obc</param>
        /// <returns>实体</returns>
        public List <WorkorderInfoModel> RetrieveMultiple(ParameterCollection pc, OrderByCollection obc)
        {
            List <WorkorderInfoModel> workorderinfos = new List <WorkorderInfoModel>();

            WorkorderInfoModel workorderinfo = new WorkorderInfoModel();
            DataTable          dt            = DbUtil.Current.RetrieveMultiple(workorderinfo, pc, obc);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                workorderinfo = new WorkorderInfoModel();
                workorderinfo.ConvertFrom(dt, i);
                workorderinfos.Add(workorderinfo);
            }

            return(workorderinfos);
        }
Пример #2
0
        /// <summary>
        /// 根据主键获取实体
        /// </summary>
        /// <param name="workorderid"></param>
        /// <returns>实体</returns>
        public WorkorderInfoModel Retrieve(string workorderid)
        {
            WorkorderInfoModel workorderinfo = new WorkorderInfoModel();

            workorderinfo.WorkOrderId = workorderid;

            DataTable dt = DbUtil.Current.Retrieve(workorderinfo);

            if (dt.Rows.Count < 1)
            {
                return(null);
            }

            workorderinfo.ConvertFrom(dt);

            return(workorderinfo);
        }