Esempio n. 1
0
        /// <summary>
        /// 根据主键获取一个ClassProDetails实体记录。
        /// 该方法提供给其他实体的业务逻辑层(Logic)方法调用
        /// </summary>
        /// <returns>ClassProDetails实体</returns>
        /// <param name="columns">要返回的列</param>
        public ClassProDetailsEntity GetClassProDetails(int id, bool cache = false)
        {
            ClassProDetailsEntity list = null;

            if (cache)
            {
                string _cachekey = "GetClassProDetails_" + id;

                object obj = MemCache.GetCache(_cachekey);
                if (obj == null)
                {
                    list = ClassProDetailsDA.Instance.GetClassProDetails(id);
                    MemCache.AddCache(_cachekey, list);
                }
                else
                {
                    list = (ClassProDetailsEntity)obj;
                }
            }
            else
            {
                list = ClassProDetailsDA.Instance.GetClassProDetails(id);
            }
            return(list);
        }
Esempio n. 2
0
        public int ClassPropDetailEdit()
        {
            int    _pdid                 = FormString.IntSafeQ("pdid");
            int    _propid               = FormString.IntSafeQ("propid");
            string _name                 = FormString.SafeQ("name");
            int    _isactive             = FormString.IntSafeQ("isactive");
            int    _sort                 = FormString.IntSafeQ("sort");
            ClassProDetailsEntity entity = new ClassProDetailsEntity();

            if (_pdid > 0)
            {
                entity = ClassProDetailsBLL.Instance.GetClassProDetails(_pdid);
            }

            entity.PropertyId = _propid;
            entity.Name       = _name;
            entity.Sort       = _sort;
            entity.Active     = _isactive;
            if (_pdid == 0)
            {
                entity.Status   = 1;
                entity.Code     = "";
                entity.ParentId = 0;
                entity.PicUrl   = "";
            }
            int _result = ClassProDetailsBLL.Instance.AddClassProDetails(entity);

            return(_result);
        }
Esempio n. 3
0
 /// <summary>
 /// 插入一条记录到表ClassProDetails,如果表中存在自增字段,则返回值为新记录的自增字段值,否则返回0。
 /// 该方法提供给界面等UI层调用
 /// </summary>
 /// <param name="ClassProDetails">要添加的ClassProDetails数据实体对象</param>
 public int AddClassProDetails(ClassProDetailsEntity ClassProDetails)
 {
     if (ClassProDetails.Id > 0)
     {
         return(UpdateClassProDetails(ClassProDetails));
     }
     else if (string.IsNullOrEmpty(ClassProDetails.Name))
     {
         return((int)CommonStatus.ADD_Fail_Empty);
     }
     else if (ClassProDetailsBLL.Instance.IsExist(ClassProDetails))
     {
         return((int)CommonStatus.ADD_Fail_Exist);
     }
     else
     {
         return(ClassProDetailsDA.Instance.AddClassProDetails(ClassProDetails));
     }
 }
Esempio n. 4
0
        public ActionResult PropertiseDetailInfo()
        {
            int _propid = QueryString.IntSafeQ("propid", -1);
            int _pdid   = QueryString.IntSafeQ("pdid", -1);
            ClassProDetailsEntity entity = new ClassProDetailsEntity();

            if (_pdid > 0)
            {
                entity             = ClassProDetailsBLL.Instance.GetClassProDetails(_pdid, false);
                ViewBag.PropertyId = entity.PropertyId;
                ClassPropertiesEntity prp = ClassPropertiesBLL.Instance.GetClassProperties(entity.PropertyId);
                ViewBag.PropertyName = prp.Name;
            }
            else
            {
                ViewBag.PropertyId = _propid;
            }
            ViewBag.entity = entity;
            return(View());
        }
Esempio n. 5
0
 /// <summary>
 /// 更新一条ClassProDetails记录。
 /// 该方法提供给界面等UI层调用
 /// </summary>
 /// <param name="ClassProDetails">待更新的实体对象</param>
 /// <param name="columns">要更新的列名,不提供任何列名时默认将更新主键之外的所有列</param>
 public int UpdateClassProDetails(ClassProDetailsEntity ClassProDetails)
 {
     return(ClassProDetailsDA.Instance.UpdateClassProDetails(ClassProDetails));
 }
Esempio n. 6
0
 /// <summary>
 /// 判断对象是否存在
 /// </summary>
 /// <param name="dicEnum"></param>
 /// <returns></returns>
 public bool IsExist(ClassProDetailsEntity ClassProDetails)
 {
     return(ClassProDetailsDA.Instance.ExistNum(ClassProDetails) > 0);
 }