public static int UpdateTbl_Flow(Tbl_Flow tbl_flow) { WebCommon.Public.WriteLog("修改流程:" + tbl_flow.FlowName); tbl_flow.DealUser = WebCommon.Public.GetUserName(); tbl_flow.DealTime = DateTime.Now; return(new Tbl_FlowService().UpdateTbl_FlowById(tbl_flow)); }
/// <summary> ///根据SQL语句获取集合 /// </summary> private IList <Tbl_Flow> getTbl_FlowsBySql(string sql) { IList <Tbl_Flow> list = new List <Tbl_Flow>(); DataSet ds = DBHelper.ExecuteDataset(this.connection, CommandType.Text, sql); if (ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { Tbl_Flow tbl_flow = new Tbl_Flow(); tbl_flow.ID = Convert.ToInt32(dr["ID"]); tbl_flow.FlowName = Convert.ToString(dr["FlowName"]); tbl_flow.FormID = Convert.ToInt32(dr["FormID"]); tbl_flow.FormContent = Convert.ToString(dr["FormContent"]); tbl_flow.FlowType = Convert.ToString(dr["FlowType"]); tbl_flow.Remark = Convert.ToString(dr["Remark"]); tbl_flow.DealFlag = Convert.ToString(dr["DealFlag"]); tbl_flow.DealUser = Convert.ToString(dr["DealUser"]); tbl_flow.DealTime = Convert.ToDateTime(dr["DealTime"]); tbl_flow.AddDate = Convert.ToDateTime(dr["AddDate"]); list.Add(tbl_flow); } } return(list); }
public int AddTbl_Flow(Tbl_Flow tbl_flow) { string sql = "insert into [Tbl_Flow] ([FlowName],[FormID],[FormContent],[FlowType],[Remark],[DealUser]) values (@FlowName,@FormID,@FormContent,@FlowType,@Remark,@DealUser)"; SqlParameter[] sp = new SqlParameter[] { new SqlParameter("@FlowName", tbl_flow.FlowName), new SqlParameter("@FormID", tbl_flow.FormID), new SqlParameter("@FormContent", tbl_flow.FormContent), new SqlParameter("@FlowType", tbl_flow.FlowType), new SqlParameter("@Remark", tbl_flow.Remark), new SqlParameter("@DealUser", tbl_flow.DealUser) }; return(DBHelper.ExecuteNonQuery(this.connection, CommandType.Text, sql, sp)); }
public int UpdateTbl_FlowById(Tbl_Flow tbl_flow) { string sql = "update [Tbl_Flow] set [FlowName]=@FlowName,[FormID]=@FormID,[FormContent]=@FormContent,[FlowType]=@FlowType,[Remark]=@Remark,[DealUser]=@DealUser,[DealTime]=@DealTime where DealFlag=0 and [ID]=@ID"; SqlParameter[] sp = new SqlParameter[] { new SqlParameter("@ID", tbl_flow.ID), new SqlParameter("@FlowName", tbl_flow.FlowName), new SqlParameter("@FormID", tbl_flow.FormID), new SqlParameter("@FormContent", tbl_flow.FormContent), new SqlParameter("@FlowType", tbl_flow.FlowType), new SqlParameter("@Remark", tbl_flow.Remark), new SqlParameter("@DealUser", tbl_flow.DealUser), new SqlParameter("@DealTime", tbl_flow.DealTime.ToString()) }; return(DBHelper.ExecuteNonQuery(this.connection, CommandType.Text, sql, sp)); }
public static int AddTbl_Flow(Tbl_Flow tbl_flow) { WebCommon.Public.WriteLog("添加流程:" + tbl_flow.FlowName); return(new Tbl_FlowService().AddTbl_Flow(tbl_flow)); }