Ejemplo n.º 1
0
 /// <summary>
 /// 编辑服务包
 /// </summary>
 public bool EditServiceBundle(ivt_service_bundle SerBun, long userId, string serIds)
 {
     try
     {
         var isbDal    = new ivt_service_bundle_dal();
         var oldSerBun = isbDal.FindNoDeleteById(SerBun.id);
         if (oldSerBun == null)
         {
             return(false);
         }
         var timeNow = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now);
         SerBun.update_time    = timeNow;
         SerBun.update_user_id = userId;
         isbDal.Update(SerBun);
         OperLogBLL.OperLogUpdate <ivt_service_bundle>(SerBun, oldSerBun, SerBun.id, userId, DTO.DicEnum.OPER_LOG_OBJ_CATE.IVT_SERVICE_BUNDLE, "编辑服务包");
         ServiceBundleManage(SerBun.id, serIds, userId);
     }
     catch (Exception)
     {
         return(false);
     }
     return(true);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 激活停用服务包
        /// </summary>
        public bool ActiveServiceBundle(long serviceId, bool isActive, long userId, ref string faileReason)
        {
            var isbDal  = new ivt_service_bundle_dal();
            var thisSer = isbDal.FindNoDeleteById(serviceId);

            if (thisSer == null)
            {
                faileReason = "未查询到该服务包信息";
                return(false);
            }
            if (thisSer.is_active == (sbyte)(isActive ? 1 : 0))
            {
                faileReason = $"该服务包已经是{(isActive?"激活":"停用")}状态!";
                return(false);
            }
            thisSer.is_active      = (sbyte)(isActive ? 1 : 0);
            thisSer.update_time    = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now);
            thisSer.update_user_id = userId;
            var oldSer = isbDal.FindNoDeleteById(serviceId);

            isbDal.Update(thisSer);
            OperLogBLL.OperLogUpdate <ivt_service_bundle>(thisSer, oldSer, thisSer.id, userId, DTO.DicEnum.OPER_LOG_OBJ_CATE.IVT_SERVICE_BUNDLE, "编辑服务包");
            return(true);
        }