Example #1
0
        public IList <QM_INFRA_ABNORMALITY> GetAbnormalityData()
        {
            QM_INFRA_ABNORMALITY param = new QM_INFRA_ABNORMALITY();

            param.IsDeleted = false;
            return(qM_INFRA_ABNORMALITYBO.GetByParam(param));
        }
Example #2
0
        public HttpResponseMessage SaveAbnormality(QM_INFRA_ABNORMALITY param)
        {
            IList <QM_INFRA_ABNORMALITY> list = qM_INFRA_ABNORMALITYBO.GetByCode(param.AbnormalityCode);

            if (list.Count < 1)
            {
                param.IsDeleted = false;
                param.CreatedOn = SSGlobalConfig.Now;
                qM_INFRA_ABNORMALITYBO.Insert(param);

                return(Request.CreateResponse(HttpStatusCode.OK, "新增成功"));
            }
            else
            {
                QM_INFRA_ABNORMALITY entity = list[0];
                if (entity.IsDeleted == false)
                {
                    return(Request.CreateResponse(HttpStatusCode.OK, "该不良现象代码已存在"));
                }
                else
                {
                    entity.IsDeleted       = false;
                    entity.Abnormality     = param.Abnormality;
                    entity.AbnormalityDesc = param.AbnormalityDesc;
                    qM_INFRA_ABNORMALITYBO.UpdateSome(entity);
                    return(Request.CreateResponse(HttpStatusCode.OK, "新增成功"));
                }
            }
        }
Example #3
0
 public HttpResponseMessage ExitAbnormality(QM_INFRA_ABNORMALITY param)
 {
     try
     {
         QM_INFRA_ABNORMALITY entity = qM_INFRA_ABNORMALITYBO.GetEntity((int)param.PK);
         entity.Abnormality     = param.Abnormality;
         entity.AbnormalityDesc = param.AbnormalityDesc;
         entity.ModifiedBy      = param.ModifiedBy;
         entity.ModifiedOn      = SSGlobalConfig.Now;
         qM_INFRA_ABNORMALITYBO.UpdateSome(entity);
         return(Request.CreateResponse(HttpStatusCode.OK, "修改成功!"));
     }
     catch (Exception e)
     {
         return(Request.CreateResponse(HttpStatusCode.OK, "修改失败:" + e.Message));
     }
 }
Example #4
0
 public HttpResponseMessage RemoveAbnormality(int pk)
 {
     try
     {
         QM_INFRA_ABNORMALITY entity = qM_INFRA_ABNORMALITYBO.GetEntity(pk);
         entity.IsDeleted = true;
         qM_INFRA_ABNORMALITYBO.UpdateSome(entity);
         QM_INFRA_ABNORMALITY_CATEGORY qM_INFRA_ABNORMALITY_CATEGORY = new QM_INFRA_ABNORMALITY_CATEGORY()
         {
             AbnormalityCode = entity.AbnormalityCode
         };
         IList <QM_INFRA_ABNORMALITY_CATEGORY> list = qM_INFRA_ABNORMALITY_CATEGORYBO.GetByParam(qM_INFRA_ABNORMALITY_CATEGORY);
         foreach (QM_INFRA_ABNORMALITY_CATEGORY e in list)
         {
             qM_INFRA_ABNORMALITY_CATEGORYBO.Delete((int)e.PK);
         }
         return(Request.CreateResponse(HttpStatusCode.OK, "删除成功!"));
     }
     catch (Exception e) {
         return(Request.CreateResponse(HttpStatusCode.OK, "删除失败:" + e.Message));
     }
 }
Example #5
0
 public IList <QM_INFRA_ABNORMALITY> GetAbnormality(QM_INFRA_ABNORMALITY param)
 {
     param.IsDeleted = false;
     return(qM_INFRA_ABNORMALITYBO.GetByParam(param));
 }