/// <summary>
        /// 新增
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string Add(V_tm_pm_dotask model)
        {
            using (tm_pm_dotaskDAL dal = new tm_pm_dotaskDAL())
            {
                if (model == null)
                    return string.Empty;
                tm_pm_dotask entity = ModelToEntity(model);
                entity.TASKID = string.IsNullOrEmpty(model.TASKID) ? Guid.NewGuid().ToString("N") : model.TASKID;

                return dal.Add(entity);
            }
        }
		/// <summary>
        /// 更新
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Edit(V_tm_pm_dotask model)
        {
            using (tm_pm_dotaskDAL dal = new tm_pm_dotaskDAL())
            {
                if (model == null) return false;
                tm_pm_dotask entitys = ModelToEntity(model);

                return dal.Edit(entitys);
            }
        }
        /// <summary>
        /// Entity转Model
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        private V_tm_pm_dotask  EntityToModel(tm_pm_dotask  entity)
        {
            if (entity != null)
            {
                V_tm_pm_dotask  model = new V_tm_pm_dotask ()
                {
                                       	TASKID = entity.TASKID,
                                        	TITLE = entity.TITLE,
                                        	MODELCODE = entity.MODELCODE,
                                        	MODELID = entity.MODELID,
                                        	ARRIVEDATE = entity.ARRIVEDATE,
                                        	EXPIREDTIME = entity.EXPIREDTIME,
                                        	ISCLOSED = entity.ISCLOSED,
                                        	CLOSEDTIME = entity.CLOSEDTIME,
                                        	OWENRID = entity.OWENRID,
                                        	OWNERDEPARTMENTID = entity.OWNERDEPARTMENTID,
                                        	OWNERCOMPANYID = entity.OWNERCOMPANYID,
                                        	CREATETIME = entity.CREATETIME,
                                        	CREATEUSER = entity.CREATEUSER,
                                        	EDITTIME = entity.EDITTIME,
                                        	EDITUSER = entity.EDITUSER,
                                        	OWNERPOSTID = entity.OWNERPOSTID,
                                    };

                return model;
            }

            return null;
        }
        /// <summary>
        /// Model转Entity
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        private tm_pm_dotask ModelToEntity(V_tm_pm_dotask model)
        {
            if (model != null)
            {
                tm_pm_dotask entity = new tm_pm_dotask()
                {
                	                    	TASKID = model.TASKID,
                                        	TITLE = model.TITLE,
                                        	MODELCODE = model.MODELCODE,
                                        	MODELID = model.MODELID,
                                        	ARRIVEDATE = model.ARRIVEDATE,
                                        	EXPIREDTIME = model.EXPIREDTIME,
                                        	ISCLOSED = model.ISCLOSED,
                                        	CLOSEDTIME = model.CLOSEDTIME,
                                        	OWENRID = model.OWENRID,
                                        	OWNERDEPARTMENTID = model.OWNERDEPARTMENTID,
                                        	OWNERCOMPANYID = model.OWNERCOMPANYID,
                                        	CREATETIME = model.CREATETIME,
                                        	CREATEUSER = model.CREATEUSER,
                                        	EDITTIME = model.EDITTIME,
                                        	EDITUSER = model.EDITUSER,
                                        	OWNERPOSTID = model.OWNERPOSTID,
                                    };

                return entity;
            }
            return null;
        }