Exemplo n.º 1
0
        public ActionResult SubmitFaultForm(string KeyValue, CalFault entity)
        {
            try
            {
                CalFault entitySource = FaultRe.FindEntity(KeyValue);
                string   Message      = KeyValue == "" ? "新增成功。" : "编辑成功。";
                if (!string.IsNullOrEmpty(KeyValue))
                {
                    entitySource.CalFaultID = KeyValue;
                }
                entitySource.CauseAnaly     = entity.CauseAnaly;
                entitySource.ImproveMeasure = entity.ImproveMeasure;
                FaultRe.Update(entitySource);


                return(Content(new JsonMessage {
                    Success = true, Code = "1", Message = Message
                }.ToString()));
            }
            catch (Exception ex)
            {
                //database.Rollback();
                //database.Close();
                return(Content(new JsonMessage {
                    Success = false, Code = "-1", Message = "操作失败:" + ex.Message
                }.ToString()));
            }
        }
Exemplo n.º 2
0
        public ActionResult SetFaultForm(string KeyValue)
        {
            CalFault entity = FaultRe.FindEntity(KeyValue);

            if (entity == null)
            {
                return(Content(""));
            }

            string strJson = entity.ToJson();

            //strJson = strJson.Insert(1, Base_FormAttributeBll.Instance.GetBuildForm(KeyValue));
            return(Content(strJson));
        }