public ActionResult SaveCustomFormContent() { SaveCustomFormContentArgs args = RequestArgs <SaveCustomFormContentArgs>(); if (args == null) { return(RespondResult(false, "参数无效。")); } args.MemberId = MemberContext.Member.Id; CustomFormContentEntity contentArgs = new CustomFormContentEntity(); if (args.ContentId.HasValue) { contentArgs.Id = args.ContentId.Value; } contentArgs.Domain = DomainContext.Domain.Id; contentArgs.AppId = DomainContext.AppId; contentArgs.Form = args.FormId; contentArgs.MemberOpenId = this.OpenId; contentArgs.FillinTime = DateTime.Now; contentArgs.Status = EnumCustomFormContentStatus.Unprocessed; _customFormManager.SaveCustomFormContent(contentArgs, args); SessionContainer.ClearMemberContext(this.HttpContext); return(RespondResult()); }
public void UpdateCustomFormContent(CustomFormContentEntity customFormContent) { if (customFormContent == null) { Debug.Assert(false, "customFormContent 为空"); return; } _dataBase.Update(customFormContent); }
public CustomFormContentEntity GetCustomFormContent(Guid id) { CustomFormContentEntity customFormContent = new CustomFormContentEntity(); customFormContent.Id = id; if (_dataBase.Fill <CustomFormContentEntity>(customFormContent)) { return(customFormContent); } else { return(null); } }
public void CreateCustomFormContent(CustomFormContentEntity customFormContent) { if (customFormContent == null) { Debug.Assert(false, "customFormContent 为空"); return; } customFormContent.FillinTime = DateTime.Now; _dataBase.Insert(customFormContent); List <CommandParameter> parameterList = new List <CommandParameter>(); parameterList.Add(new CommandParameter("@formId", customFormContent.Form)); _dataBase.ExecuteNonQuery("UPDATE [CustomForm] SET [FillinCount] = [FillinCount] +1 WHERE [Id] = @formId", parameterList); }
public void SaveCustomFormContent(CustomFormContentEntity contentArgs, SaveCustomFormContentArgs args) { List <CommandParameter> parameterList = new List <CommandParameter>(); parameterList.Add(new CommandParameter("@id", args.MemberId)); parameterList.Add(new CommandParameter("@name", args.Name)); parameterList.Add(new CommandParameter("@birthday", args.Birthday)); parameterList.Add(new CommandParameter("@mobilePhone", args.MobilePhone)); parameterList.Add(new CommandParameter("@email", args.Email)); _dataBase.ExecuteNonQuery( "UPDATE [Member] SET [Name] = @name,[Birthday] = @birthday,[MobilePhone] = @mobilePhone,[Email]=@email WHERE [Id] = @id", parameterList); RemoveCustomFormContent(args.FormId, contentArgs.Id); CreateCustomFormContent(contentArgs); }