public override WorkflowExecutionStatus Execute(Record record, RecordEventArgs e)
        {
            using (RecordService rs = new RecordService(record))
            {
                rs.Delete();
            }

            return(WorkflowExecutionStatus.Completed);
        }
        /// <summary>
        /// Delete Record
        /// </summary>
        /// <param name="id"></param>
        /// <param name="Model"></param>
        public void Delete(Guid id)
        {
            Record record = RecordService.GetRecord(id);
            record.IsDeleted = true;
            record.IsActive = false;
            record.LastModifiedBy = TSMContext.CurrentUser.ID;
            record.LastModifiedDate = DateTime.UtcNow;
            RecordService.Delete(record);

        }
Exemple #3
0
        public ApiResult Delete([FromBody] RequestVisitRecordQDTO request)
        {
            string reason;
            var    ret = recordService.Delete(request, SecurityHelper.LoginUser.ID, out reason);

            if (!ret)
            {
                return(new ApiResult()
                {
                    Status = EnumApiStatus.BizError, Msg = reason
                });
            }
            else
            {
                return(ret.ToApiResult());
            }
        }
Exemple #4
0
        public ActionResult Edit()
        {
            BizAnswerBank bizAnswerBank = new BizAnswerBank();
            bool          result        = false;

            AspectF.Define
            .Log(log, "AnswerBankController-Edit[post]开始", "AnswerBankController-Edit[post]结束")
            .HowLong(log)
            .Retry(log)
            .Do(() =>
            {
                var reader = new StreamReader(Request.InputStream).ReadToEnd();
                var model  = JsonConvert.DeserializeObject <ViewAnswerBank>(reader);
                ViewToDBForModel(bizAnswerBank, model);
                if (string.IsNullOrEmpty(model.id))
                {
                    result = answerBankService.Add(bizAnswerBank);
                    if (!string.IsNullOrEmpty(model.countID))
                    {
                        BizRecord bizRecord         = new BizRecord();
                        bizRecord.RecordID          = model.countID;
                        RecordService recordService = new RecordService();
                        recordService.Delete(new string[] { bizRecord.RecordID });
                    }
                }
                else
                {
                    bizAnswerBank.UpdateTime = DateTime.Now;
                    result = answerBankService.Update(bizAnswerBank);
                }
            });
            if (result)
            {
                return(Json(new { status = "y" }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { status = "n" }, JsonRequestBehavior.AllowGet));
            }
        }
Exemple #5
0
        public ActionResult Delete()
        {
            bool result = false;

            AspectF.Define
            .Log(log, "RecordController-Delete[post]开始", "RecordController-Delete[post]结束")
            .HowLong(log)
            .Retry(log)
            .Do(() =>
            {
                var reader = new StreamReader(Request.InputStream).ReadToEnd();
                var model  = JsonConvert.DeserializeObject <string []>(reader);
                result     = recordService.Delete(model);
            });
            if (result)
            {
                return(Json(new { status = "y" }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { status = "n" }, JsonRequestBehavior.AllowGet));
            }
        }
Exemple #6
0
        public static string DeleteRecord(String recordId)
        {
            string formGuid = null;

            try
            {
                RecordStorage rs = new RecordStorage();
                Record record = rs.GetRecord(Guid.Parse(recordId));
                RecordService s = new RecordService(record);
                formGuid = record.Form.ToString();
                s.Delete();
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("This license is invalid"))
                    return new MessageBox("Record deleted successfully", new Button("Ok", new Call("ListRecord", new string[] { formGuid, "1" }))).UmGo();
                else
                    return new MessageBox("Error to delete this record", new Button("Close")).UmGo("Warning");
            }

            return new MessageBox("Record deleted successfully", new Button("Ok", new Call("ListRecord", new string[] { formGuid, "1" })))
                .UmGo();
        }