コード例 #1
0
        /// <summary>
        /// Entity转Model
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        private V_tm_pm_user  EntityToModel(tm_pm_user  entity)
        {
            if (entity != null)
            {
                V_tm_pm_user  model = new V_tm_pm_user ()
                {
                                       	USERID = entity.USERID,
                                        	USERNAME = entity.USERNAME,
                                        	EMAIL = entity.EMAIL,
                                        	PHONE = entity.PHONE,
                                        	PASSWORD = entity.PASSWORD,
                                        	ISCLOSED = entity.ISCLOSED,
                                        	POSTID = entity.POSTID,
                                        	OWENRID = entity.OWENRID,
                                        	OWNERDEPARTMENTID = entity.OWNERDEPARTMENTID,
                                        	OWNERCOMPANYID = entity.OWNERCOMPANYID,
                                        	CREATETIME = entity.CREATETIME,
                                        	CREATEUSER = entity.CREATEUSER,
                                        	EDITTIME = entity.EDITTIME,
                                        	EDITUSER = entity.EDITUSER,
                                        	OWNERPOSTID = entity.OWNERPOSTID,
                                        	COST = entity.COST,
                                    };

                return model;
            }

            return null;
        }
コード例 #2
0
        /// <summary>
        /// Model转Entity
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        private tm_pm_user ModelToEntity(V_tm_pm_user model)
        {
            if (model != null)
            {
                tm_pm_user entity = new tm_pm_user()
                {
                	                    	USERID = model.USERID,
                                        	USERNAME = model.USERNAME,
                                        	EMAIL = model.EMAIL,
                                        	PHONE = model.PHONE,
                                        	PASSWORD = model.PASSWORD,
                                        	ISCLOSED = model.ISCLOSED,
                                        	POSTID = model.POSTID,
                                        	OWENRID = model.OWENRID,
                                        	OWNERDEPARTMENTID = model.OWNERDEPARTMENTID,
                                        	OWNERCOMPANYID = model.OWNERCOMPANYID,
                                        	CREATETIME = model.CREATETIME,
                                        	CREATEUSER = model.CREATEUSER,
                                        	EDITTIME = model.EDITTIME,
                                        	EDITUSER = model.EDITUSER,
                                        	OWNERPOSTID = model.OWNERPOSTID,
                                        	COST = model.COST,
                                    };

                return entity;
            }
            return null;
        }