/// <summary>
        /// 更新
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Edit(V_tm_pm_itemreport model)
        {
            if (model == null) return false;
            tm_pm_itemreport entitys = ModelToEntity(model);
            
            return dal.Edit(entitys);
        }
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string Add(V_tm_pm_itemreport model)
        {
             if (model == null)
                return string.Empty;
            tm_pm_itemreport entity = ModelToEntity(model);
            entity.TASKID = string.IsNullOrEmpty(model.TASKID) ? Guid.NewGuid().ToString("N") : model.TASKID;

            return dal.Add(entity);
        }
        /// <summary>
        /// Entity转Model
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        private V_tm_pm_itemreport  EntityToModel(tm_pm_itemreport  entity)
        {
            if (entity != null)
            {
                V_tm_pm_itemreport  model = new V_tm_pm_itemreport ()
                {
                                       	TASKID = entity.TASKID,
                                        	PRETASK = entity.PRETASK,
                                        	SUBMITDATE = entity.SUBMITDATE,
                                        	SUBMITPROGRESS = entity.SUBMITPROGRESS,
                                        	SUBMITREMARK = entity.SUBMITREMARK,
                                        	PMANAGER = entity.PMANAGER,
                                        	ISCOMFIRM = entity.ISCOMFIRM,
                                        	STARTDATE = entity.STARTDATE,
                                        	COMFIRMDATE = entity.COMFIRMDATE,
                                        	OWENRID = entity.OWENRID,
                                        	OWNERDEPARTMENTID = entity.OWNERDEPARTMENTID,
                                        	OWNERCOMPANYID = entity.OWNERCOMPANYID,
                                        	CREATETIME = entity.CREATETIME,
                                        	CREATEUSER = entity.CREATEUSER,
                                        	EDITTIME = entity.EDITTIME,
                                        	EDITUSER = entity.EDITUSER,
                                    };

                return model;
            }

            return null;
        }
        /// <summary>
        /// Model转Entity
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        private tm_pm_itemreport ModelToEntity(V_tm_pm_itemreport model)
        {
            if (model != null)
            {
                tm_pm_itemreport entity = new tm_pm_itemreport()
                {
                	                    	TASKID = model.TASKID,
                                        	PRETASK = model.PRETASK,
                                        	SUBMITDATE = model.SUBMITDATE,
                                        	SUBMITPROGRESS = model.SUBMITPROGRESS,
                                        	SUBMITREMARK = model.SUBMITREMARK,
                                        	PMANAGER = model.PMANAGER,
                                        	ISCOMFIRM = model.ISCOMFIRM,
                                        	STARTDATE = model.STARTDATE,
                                        	COMFIRMDATE = model.COMFIRMDATE,
                                        	OWENRID = model.OWENRID,
                                        	OWNERDEPARTMENTID = model.OWNERDEPARTMENTID,
                                        	OWNERCOMPANYID = model.OWNERCOMPANYID,
                                        	CREATETIME = model.CREATETIME,
                                        	CREATEUSER = model.CREATEUSER,
                                        	EDITTIME = model.EDITTIME,
                                        	EDITUSER = model.EDITUSER,
                                    };

                return entity;
            }
            return null;
        }