/// <summary> /// 更新记录 /// </summary> /// <param name="model">BizProcess.Data.Model.WorkFlowComment实体类</param> public int Update(BizProcess.Data.Model.WorkFlowComment model) { string sql = @"UPDATE WorkFlowComment SET MemberID=@MemberID,Comment=@Comment,Type=@Type,Sort=@Sort WHERE ID=@ID" ; SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@MemberID", SqlDbType.VarChar, -1) { Value = model.MemberID }, new SqlParameter("@Comment", SqlDbType.NVarChar, 1000) { Value = model.Comment }, new SqlParameter("@Type", SqlDbType.Int, -1) { Value = model.Type }, new SqlParameter("@Sort", SqlDbType.Int, -1) { Value = model.Sort }, new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1) { Value = model.ID } }; return(dbHelper.Execute(sql, parameters)); }
/// <summary> /// 更新记录 /// </summary> /// <param name="model">BizProcess.Data.Model.WorkFlowComment实体类</param> public int Update(BizProcess.Data.Model.WorkFlowComment model) { string sql = @"UPDATE WorkFlowComment SET MemberID=:MemberID,Comment=:Comment,Type=:Type,Sort=:Sort WHERE ID=:ID" ; OracleParameter[] parameters = new OracleParameter[] { new OracleParameter(":MemberID", OracleDbType.Clob) { Value = model.MemberID }, new OracleParameter(":Comment", OracleDbType.NVarchar2, 1000) { Value = model.Comment }, new OracleParameter(":Type", OracleDbType.Int32) { Value = model.Type }, new OracleParameter(":Sort", OracleDbType.Int32) { Value = model.Sort }, new OracleParameter(":ID", OracleDbType.Char, 36) { Value = model.ID } }; return(dbHelper.Execute(sql, parameters)); }
/// <summary> /// 添加记录 /// </summary> /// <param name="model">BizProcess.Data.Model.WorkFlowComment实体类</param> /// <returns>操作所影响的行数</returns> public int Add(BizProcess.Data.Model.WorkFlowComment model) { string sql = @"INSERT INTO WorkFlowComment (ID,MemberID,Comment,Type,Sort) VALUES(@ID,@MemberID,@Comment,@Type,@Sort)" ; SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1) { Value = model.ID }, new SqlParameter("@MemberID", SqlDbType.VarChar, -1) { Value = model.MemberID }, new SqlParameter("@Comment", SqlDbType.NVarChar, 1000) { Value = model.Comment }, new SqlParameter("@Type", SqlDbType.Int, -1) { Value = model.Type }, new SqlParameter("@Sort", SqlDbType.Int, -1) { Value = model.Sort } }; return(dbHelper.Execute(sql, parameters)); }
/// <summary> /// 添加记录 /// </summary> /// <param name="model">BizProcess.Data.Model.WorkFlowComment实体类</param> /// <returns>操作所影响的行数</returns> public int Add(BizProcess.Data.Model.WorkFlowComment model) { string sql = @"INSERT INTO WorkFlowComment (ID,MemberID,Comment,Type,Sort) VALUES(:ID,:MemberID,:Comment,:Type,:Sort)" ; OracleParameter[] parameters = new OracleParameter[] { new OracleParameter(":ID", OracleDbType.Char, 36) { Value = model.ID }, new OracleParameter(":MemberID", OracleDbType.Clob) { Value = model.MemberID }, new OracleParameter(":Comment", OracleDbType.NVarchar2, 1000) { Value = model.Comment }, new OracleParameter(":Type", OracleDbType.Int32) { Value = model.Type }, new OracleParameter(":Sort", OracleDbType.Int32) { Value = model.Sort } }; return(dbHelper.Execute(sql, parameters)); }
public ActionResult Edit(FormCollection collection) { BizProcess.Platform.WorkFlowComment bworkFlowComment = new BizProcess.Platform.WorkFlowComment(); BizProcess.Data.Model.WorkFlowComment workFlowComment = null; string id = Request.QueryString["id"]; string member = string.Empty; string comment = string.Empty; string sort = string.Empty; bool isOneSelf = "1" == Request.QueryString["isoneself"]; Guid commentID; if (id.IsGuid(out commentID)) { workFlowComment = bworkFlowComment.Get(commentID); member = workFlowComment.MemberID; comment = workFlowComment.Comment; sort = workFlowComment.Sort.ToString(); } string oldXML = workFlowComment.Serialize(); if (collection != null) { member = isOneSelf ? BizProcess.Platform.Users.PREFIX + BizProcess.Platform.Users.CurrentUserID.ToString() : Request.Form["Member"]; comment = Request.Form["Comment"]; sort = Request.Form["Sort"]; bool isAdd = !id.IsGuid(); if (workFlowComment == null) { workFlowComment = new BizProcess.Data.Model.WorkFlowComment(); workFlowComment.ID = Guid.NewGuid(); workFlowComment.Type = isOneSelf ? 1 : 0; } workFlowComment.MemberID = member.IsNullOrEmpty() ? "" : member.Trim(); workFlowComment.Comment = comment.IsNullOrEmpty() ? "" : comment.Trim(); workFlowComment.Sort = sort.IsInt() ? sort.ToInt() : bworkFlowComment.GetManagerMaxSort(); if (isAdd) { bworkFlowComment.Add(workFlowComment); BizProcess.Platform.Log.Add("添加了流程意见", workFlowComment.Serialize(), BizProcess.Platform.Log.Types.流程相关); } else { bworkFlowComment.Update(workFlowComment); BizProcess.Platform.Log.Add("修改了流程意见", "", BizProcess.Platform.Log.Types.流程相关, oldXML, workFlowComment.Serialize()); } bworkFlowComment.RefreshCache(); ViewBag.Script = "new BPUI.Window().reloadOpener();alert('保存成功!');"; } return(View(workFlowComment == null ? new BizProcess.Data.Model.WorkFlowComment() : workFlowComment)); }
/// <summary> /// 将DataRedar转换为List /// </summary> private List <BizProcess.Data.Model.WorkFlowComment> DataReaderToList(SqlDataReader dataReader) { List <BizProcess.Data.Model.WorkFlowComment> List = new List <BizProcess.Data.Model.WorkFlowComment>(); BizProcess.Data.Model.WorkFlowComment model = null; while (dataReader.Read()) { model = new BizProcess.Data.Model.WorkFlowComment(); model.ID = dataReader.GetGuid(0); model.MemberID = dataReader.GetString(1); model.Comment = dataReader.GetString(2); model.Type = dataReader.GetInt32(3); model.Sort = dataReader.GetInt32(4); List.Add(model); } return(List); }
/// <summary> /// 更新 /// </summary> public int Update(BizProcess.Data.Model.WorkFlowComment model) { return(dataWorkFlowComment.Update(model)); }
/// <summary> /// 新增 /// </summary> public int Add(BizProcess.Data.Model.WorkFlowComment model) { return(dataWorkFlowComment.Add(model)); }