private List <RoadFlow.Data.Model.WorkFlowDelegation> DataReaderToList(OracleDataReader dataReader) { List <RoadFlow.Data.Model.WorkFlowDelegation> workFlowDelegationList = new List <RoadFlow.Data.Model.WorkFlowDelegation>(); while (dataReader.Read()) { RoadFlow.Data.Model.WorkFlowDelegation workFlowDelegation = new RoadFlow.Data.Model.WorkFlowDelegation(); workFlowDelegation.ID = dataReader.GetString(0).ToGuid(); workFlowDelegation.UserID = dataReader.GetString(1).ToGuid(); workFlowDelegation.StartTime = dataReader.GetDateTime(2); workFlowDelegation.EndTime = dataReader.GetDateTime(3); if (!dataReader.IsDBNull(4)) { workFlowDelegation.FlowID = new Guid?(dataReader.GetString(4).ToGuid()); } workFlowDelegation.ToUserID = dataReader.GetString(5).ToGuid(); workFlowDelegation.WriteTime = dataReader.GetDateTime(6); if (!dataReader.IsDBNull(7)) { workFlowDelegation.Note = dataReader.GetString(7); } workFlowDelegationList.Add(workFlowDelegation); } return(workFlowDelegationList); }
/// <summary> /// 将DataRedar转换为List /// </summary> private List <RoadFlow.Data.Model.WorkFlowDelegation> DataReaderToList(SqlDataReader dataReader) { List <RoadFlow.Data.Model.WorkFlowDelegation> List = new List <RoadFlow.Data.Model.WorkFlowDelegation>(); RoadFlow.Data.Model.WorkFlowDelegation model = null; while (dataReader.Read()) { model = new RoadFlow.Data.Model.WorkFlowDelegation(); model.ID = dataReader.GetGuid(0); model.UserID = dataReader.GetGuid(1); model.StartTime = dataReader.GetDateTime(2); model.EndTime = dataReader.GetDateTime(3); if (!dataReader.IsDBNull(4)) { model.FlowID = dataReader.GetGuid(4); } model.ToUserID = dataReader.GetGuid(5); model.WriteTime = dataReader.GetDateTime(6); if (!dataReader.IsDBNull(7)) { model.Note = dataReader.GetString(7); } List.Add(model); } return(List); }
/// <summary> /// 更新记录 /// </summary> /// <param name="model">RoadFlow.Data.Model.WorkFlowDelegation实体类</param> public int Update(RoadFlow.Data.Model.WorkFlowDelegation model) { string sql = @"UPDATE WorkFlowDelegation SET UserID=@UserID,StartTime=@StartTime,EndTime=@EndTime,FlowID=@FlowID,ToUserID=@ToUserID,WriteTime=@WriteTime,Note=@Note WHERE ID=@ID" ; SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@UserID", SqlDbType.UniqueIdentifier, -1) { Value = model.UserID }, new SqlParameter("@StartTime", SqlDbType.DateTime, 8) { Value = model.StartTime }, new SqlParameter("@EndTime", SqlDbType.DateTime, 8) { Value = model.EndTime }, model.FlowID == null ? new SqlParameter("@FlowID", SqlDbType.UniqueIdentifier, -1) { Value = DBNull.Value } : new SqlParameter("@FlowID", SqlDbType.UniqueIdentifier, -1) { Value = model.FlowID }, new SqlParameter("@ToUserID", SqlDbType.UniqueIdentifier, -1) { Value = model.ToUserID }, new SqlParameter("@WriteTime", SqlDbType.DateTime, 8) { Value = model.WriteTime }, model.Note == null ? new SqlParameter("@Note", SqlDbType.NVarChar, 8000) { Value = DBNull.Value } : new SqlParameter("@Note", SqlDbType.NVarChar, 8000) { Value = model.Note }, new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1) { Value = model.ID } }; return(dbHelper.Execute(sql, parameters)); }
/// <summary> /// 添加记录 /// </summary> /// <param name="model">RoadFlow.Data.Model.WorkFlowDelegation实体类</param> /// <returns>操作所影响的行数</returns> public int Add(RoadFlow.Data.Model.WorkFlowDelegation model) { string sql = @"INSERT INTO WorkFlowDelegation (ID,UserID,StartTime,EndTime,FlowID,ToUserID,WriteTime,Note) VALUES(@ID,@UserID,@StartTime,@EndTime,@FlowID,@ToUserID,@WriteTime,@Note)" ; SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1) { Value = model.ID }, new SqlParameter("@UserID", SqlDbType.UniqueIdentifier, -1) { Value = model.UserID }, new SqlParameter("@StartTime", SqlDbType.DateTime, 8) { Value = model.StartTime }, new SqlParameter("@EndTime", SqlDbType.DateTime, 8) { Value = model.EndTime }, model.FlowID == null ? new SqlParameter("@FlowID", SqlDbType.UniqueIdentifier, -1) { Value = DBNull.Value } : new SqlParameter("@FlowID", SqlDbType.UniqueIdentifier, -1) { Value = model.FlowID }, new SqlParameter("@ToUserID", SqlDbType.UniqueIdentifier, -1) { Value = model.ToUserID }, new SqlParameter("@WriteTime", SqlDbType.DateTime, 8) { Value = model.WriteTime }, model.Note == null ? new SqlParameter("@Note", SqlDbType.NVarChar, 8000) { Value = DBNull.Value } : new SqlParameter("@Note", SqlDbType.NVarChar, 8000) { Value = model.Note } }; return(dbHelper.Execute(sql, parameters)); }
/// <summary> /// 更新记录 /// </summary> /// <param name="model">RoadFlow.Data.Model.WorkFlowDelegation实体类</param> public int Update(RoadFlow.Data.Model.WorkFlowDelegation model) { string sql = @"UPDATE WorkFlowDelegation SET UserID=:UserID,StartTime=:StartTime,EndTime=:EndTime,FlowID=:FlowID,ToUserID=:ToUserID,WriteTime=:WriteTime,Note=:Note WHERE ID=:ID" ; OracleParameter[] parameters = new OracleParameter[] { new OracleParameter(":UserID", OracleDbType.Varchar2, 40) { Value = model.UserID }, new OracleParameter(":StartTime", OracleDbType.Date, 8) { Value = model.StartTime }, new OracleParameter(":EndTime", OracleDbType.Date, 8) { Value = model.EndTime }, model.FlowID == null ? new OracleParameter(":FlowID", OracleDbType.Varchar2, 40) { Value = DBNull.Value } : new OracleParameter(":FlowID", OracleDbType.Varchar2, 40) { Value = model.FlowID }, new OracleParameter(":ToUserID", OracleDbType.Varchar2, 40) { Value = model.ToUserID }, new OracleParameter(":WriteTime", OracleDbType.Date, 8) { Value = model.WriteTime }, model.Note == null ? new OracleParameter(":Note", OracleDbType.NVarchar2, 8000) { Value = DBNull.Value } : new OracleParameter(":Note", OracleDbType.NVarchar2, 8000) { Value = model.Note }, new OracleParameter(":ID", OracleDbType.Varchar2, 40) { Value = model.ID } }; return(dbHelper.Execute(sql, parameters)); }
/// <summary> /// 添加记录 /// </summary> /// <param name="model">RoadFlow.Data.Model.WorkFlowDelegation实体类</param> /// <returns>操作所影响的行数</returns> public int Add(RoadFlow.Data.Model.WorkFlowDelegation model) { string sql = @"INSERT INTO WorkFlowDelegation (ID,UserID,StartTime,EndTime,FlowID,ToUserID,WriteTime,Note) VALUES(:ID,:UserID,:StartTime,:EndTime,:FlowID,:ToUserID,:WriteTime,:Note)" ; OracleParameter[] parameters = new OracleParameter[] { new OracleParameter(":ID", OracleDbType.Varchar2, 40) { Value = model.ID }, new OracleParameter(":UserID", OracleDbType.Varchar2, 40) { Value = model.UserID }, new OracleParameter(":StartTime", OracleDbType.Date, 8) { Value = model.StartTime }, new OracleParameter(":EndTime", OracleDbType.Date, 8) { Value = model.EndTime }, model.FlowID == null ? new OracleParameter(":FlowID", OracleDbType.Varchar2, 40) { Value = DBNull.Value } : new OracleParameter(":FlowID", OracleDbType.Varchar2, 40) { Value = model.FlowID }, new OracleParameter(":ToUserID", OracleDbType.Varchar2, 40) { Value = model.ToUserID }, new OracleParameter(":WriteTime", OracleDbType.Date, 8) { Value = model.WriteTime }, model.Note == null ? new OracleParameter(":Note", OracleDbType.NVarchar2, 8000) { Value = DBNull.Value } : new OracleParameter(":Note", OracleDbType.NVarchar2, 8000) { Value = model.Note } }; return(dbHelper.Execute(sql, parameters)); }
public string Delete() { RoadFlow.Platform.WorkFlowDelegation workFlowDelegation1 = new RoadFlow.Platform.WorkFlowDelegation(); string str1 = this.Request.Form["ids"]; char[] chArray = new char[1] { ',' }; foreach (string str2 in str1.Split(chArray)) { Guid test; if (str2.IsGuid(out test)) { RoadFlow.Data.Model.WorkFlowDelegation workFlowDelegation2 = workFlowDelegation1.Get(test); if (workFlowDelegation2 != null) { workFlowDelegation1.Delete(test); RoadFlow.Platform.Log.Add("删除了流程意见", workFlowDelegation2.Serialize(), RoadFlow.Platform.Log.Types.流程相关, "", "", (RoadFlow.Data.Model.Users)null); } } } workFlowDelegation1.RefreshCache(); return("删除成功!"); }
public int Update(RoadFlow.Data.Model.WorkFlowDelegation model) { string sql = "UPDATE WorkFlowDelegation SET \r\n\t\t\t\tUserID=:UserID,StartTime=:StartTime,EndTime=:EndTime,FlowID=:FlowID,ToUserID=:ToUserID,WriteTime=:WriteTime,Note=:Note\r\n\t\t\t\tWHERE ID=:ID"; OracleParameter[] oracleParameterArray = new OracleParameter[8]; int index1 = 0; OracleParameter oracleParameter1 = new OracleParameter(":UserID", OracleDbType.Varchar2, 40); oracleParameter1.Value = (object)model.UserID; oracleParameterArray[index1] = oracleParameter1; int index2 = 1; OracleParameter oracleParameter2 = new OracleParameter(":StartTime", OracleDbType.Date, 8); oracleParameter2.Value = (object)model.StartTime; oracleParameterArray[index2] = oracleParameter2; int index3 = 2; OracleParameter oracleParameter3 = new OracleParameter(":EndTime", OracleDbType.Date, 8); oracleParameter3.Value = (object)model.EndTime; oracleParameterArray[index3] = oracleParameter3; int index4 = 3; OracleParameter oracleParameter4; if (model.FlowID.HasValue) { OracleParameter oracleParameter5 = new OracleParameter(":FlowID", OracleDbType.Varchar2, 40); oracleParameter5.Value = (object)model.FlowID; oracleParameter4 = oracleParameter5; } else { oracleParameter4 = new OracleParameter(":FlowID", OracleDbType.Varchar2, 40); oracleParameter4.Value = (object)DBNull.Value; } oracleParameterArray[index4] = oracleParameter4; int index5 = 4; OracleParameter oracleParameter6 = new OracleParameter(":ToUserID", OracleDbType.Varchar2, 40); oracleParameter6.Value = (object)model.ToUserID; oracleParameterArray[index5] = oracleParameter6; int index6 = 5; OracleParameter oracleParameter7 = new OracleParameter(":WriteTime", OracleDbType.Date, 8); oracleParameter7.Value = (object)model.WriteTime; oracleParameterArray[index6] = oracleParameter7; int index7 = 6; OracleParameter oracleParameter8; if (model.Note != null) { OracleParameter oracleParameter5 = new OracleParameter(":Note", OracleDbType.NVarchar2, 8000); oracleParameter5.Value = (object)model.Note; oracleParameter8 = oracleParameter5; } else { oracleParameter8 = new OracleParameter(":Note", OracleDbType.NVarchar2, 8000); oracleParameter8.Value = (object)DBNull.Value; } oracleParameterArray[index7] = oracleParameter8; int index8 = 7; OracleParameter oracleParameter9 = new OracleParameter(":ID", OracleDbType.Varchar2, 40); oracleParameter9.Value = (object)model.ID; oracleParameterArray[index8] = oracleParameter9; OracleParameter[] parameter = oracleParameterArray; return(this.dbHelper.Execute(sql, parameter)); }
/// <summary> /// 更新 /// </summary> public int Update(RoadFlow.Data.Model.WorkFlowDelegation model) { return(dataWorkFlowDelegation.Update(model)); }
/// <summary> /// 新增 /// </summary> public int Add(RoadFlow.Data.Model.WorkFlowDelegation model) { return(dataWorkFlowDelegation.Add(model)); }
protected void Page_Load(object sender, EventArgs e) { string id = Request.QueryString["id"]; string UserID = string.Empty; string ToUserID = string.Empty; string StartTime = string.Empty; string EndTime = string.Empty; string FlowID = string.Empty; string Note = string.Empty; isOneSelf = "1" == Request.QueryString["isoneself"]; Guid delegationID; if (id.IsGuid(out delegationID)) { workFlowDelegation = bworkFlowDelegation.Get(delegationID); if (workFlowDelegation != null) { FlowID = workFlowDelegation.FlowID.ToString(); } } string oldXML = workFlowDelegation.Serialize(); if (IsPostBack) { UserID = Request.Form["UserID"]; ToUserID = Request.Form["ToUserID"]; StartTime = Request.Form["StartTime"]; EndTime = Request.Form["EndTime"]; FlowID = Request.Form["FlowID"]; Note = Request.Form["Note"]; bool isAdd = !id.IsGuid(); if (workFlowDelegation == null) { workFlowDelegation = new RoadFlow.Data.Model.WorkFlowDelegation(); workFlowDelegation.ID = Guid.NewGuid(); } workFlowDelegation.UserID = isOneSelf ? RoadFlow.Platform.Users.CurrentUserID : RoadFlow.Platform.Users.RemovePrefix(UserID).ToGuid(); workFlowDelegation.EndTime = EndTime.ToDateTime(); if (FlowID.IsGuid()) { workFlowDelegation.FlowID = FlowID.ToGuid(); } workFlowDelegation.Note = Note.IsNullOrEmpty() ? null : Note; workFlowDelegation.StartTime = StartTime.ToDateTime(); workFlowDelegation.ToUserID = RoadFlow.Platform.Users.RemovePrefix(ToUserID).ToGuid(); workFlowDelegation.WriteTime = RoadFlow.Utility.DateTimeNew.Now; if (isAdd) { bworkFlowDelegation.Add(workFlowDelegation); RoadFlow.Platform.Log.Add("添加了工作委托", workFlowDelegation.Serialize(), RoadFlow.Platform.Log.Types.流程相关); } else { bworkFlowDelegation.Update(workFlowDelegation); RoadFlow.Platform.Log.Add("修改了工作委托", "", RoadFlow.Platform.Log.Types.流程相关, oldXML, workFlowDelegation.Serialize()); } bworkFlowDelegation.RefreshCache(); Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('保存成功!');new RoadUI.Window().reloadOpener();new RoadUI.Window().close();", true); } FlowOptions = new RoadFlow.Platform.WorkFlow().GetOptions(FlowID); if (workFlowDelegation == null) { workFlowDelegation = new RoadFlow.Data.Model.WorkFlowDelegation(); } }
public ActionResult Edit(FormCollection collection) { RoadFlow.Platform.WorkFlowDelegation bworkFlowDelegation = new RoadFlow.Platform.WorkFlowDelegation(); RoadFlow.Data.Model.WorkFlowDelegation workFlowDelegation = null; string id = Request.QueryString["id"]; string UserID = string.Empty; string ToUserID = string.Empty; string StartTime = string.Empty; string EndTime = string.Empty; string FlowID = string.Empty; string Note = string.Empty; bool isOneSelf = "1" == Request.QueryString["isoneself"]; Guid delegationID; if (id.IsGuid(out delegationID)) { workFlowDelegation = bworkFlowDelegation.Get(delegationID); if (workFlowDelegation != null) { FlowID = workFlowDelegation.FlowID.ToString(); } } string oldXML = workFlowDelegation.Serialize(); if (collection != null) { UserID = Request.Form["UserID"]; ToUserID = Request.Form["ToUserID"]; StartTime = Request.Form["StartTime"]; EndTime = Request.Form["EndTime"]; FlowID = Request.Form["FlowID"]; Note = Request.Form["Note"]; bool isAdd = !id.IsGuid(); if (workFlowDelegation == null) { workFlowDelegation = new RoadFlow.Data.Model.WorkFlowDelegation(); workFlowDelegation.ID = Guid.NewGuid(); } workFlowDelegation.UserID = isOneSelf ? RoadFlow.Platform.Users.CurrentUserID : RoadFlow.Platform.Users.RemovePrefix(UserID).ToGuid(); workFlowDelegation.EndTime = EndTime.ToDateTime(); if (FlowID.IsGuid()) { workFlowDelegation.FlowID = FlowID.ToGuid(); } workFlowDelegation.Note = Note.IsNullOrEmpty() ? null : Note; workFlowDelegation.StartTime = StartTime.ToDateTime(); workFlowDelegation.ToUserID = RoadFlow.Platform.Users.RemovePrefix(ToUserID).ToGuid(); workFlowDelegation.WriteTime = RoadFlow.Utility.DateTimeNew.Now; if (isAdd) { bworkFlowDelegation.Add(workFlowDelegation); RoadFlow.Platform.Log.Add("添加了工作委托", workFlowDelegation.Serialize(), RoadFlow.Platform.Log.Types.流程相关); } else { bworkFlowDelegation.Update(workFlowDelegation); RoadFlow.Platform.Log.Add("修改了工作委托", "", RoadFlow.Platform.Log.Types.流程相关, oldXML, workFlowDelegation.Serialize()); } bworkFlowDelegation.RefreshCache(); ViewBag.Script = "alert('保存成功!');new RoadUI.Window().reloadOpener();new RoadUI.Window().close();"; } ViewBag.FlowOptions = new RoadFlow.Platform.WorkFlow().GetOptions(FlowID); return(View(workFlowDelegation == null ? new RoadFlow.Data.Model.WorkFlowDelegation() { UserID = RoadFlow.Platform.Users.CurrentUserID } : workFlowDelegation)); }
public ActionResult Edit(FormCollection collection) { RoadFlow.Platform.WorkFlowDelegation workFlowDelegation1 = new RoadFlow.Platform.WorkFlowDelegation(); RoadFlow.Data.Model.WorkFlowDelegation model = (RoadFlow.Data.Model.WorkFlowDelegation)null; string str1 = this.Request.QueryString["id"]; string empty1 = string.Empty; string empty2 = string.Empty; string empty3 = string.Empty; string empty4 = string.Empty; string empty5 = string.Empty; string empty6 = string.Empty; bool flag = "1" == this.Request.QueryString["isoneself"]; Guid test; Guid? nullable1; if (str1.IsGuid(out test)) { model = workFlowDelegation1.Get(test); if (model != null) { nullable1 = model.FlowID; empty5 = nullable1.ToString(); } } string oldXML = model.Serialize(); if (collection != null) { string id1 = this.Request.Form["UserID"]; string id2 = this.Request.Form["ToUserID"]; string str2 = this.Request.Form["StartTime"]; string str3 = this.Request.Form["EndTime"]; empty5 = this.Request.Form["FlowID"]; string str4 = this.Request.Form["Note"]; int num = !str1.IsGuid() ? 1 : 0; if (model == null) { model = new RoadFlow.Data.Model.WorkFlowDelegation(); model.ID = Guid.NewGuid(); } model.UserID = flag ? RoadFlow.Platform.Users.CurrentUserID : RoadFlow.Platform.Users.RemovePrefix(id1).ToGuid(); model.EndTime = str3.ToDateTime(); if (empty5.IsGuid()) { model.FlowID = new Guid?(empty5.ToGuid()); } else { RoadFlow.Data.Model.WorkFlowDelegation workFlowDelegation2 = model; nullable1 = new Guid?(); Guid?nullable2 = nullable1; workFlowDelegation2.FlowID = nullable2; } model.Note = str4.IsNullOrEmpty() ? (string)null : str4; model.StartTime = str2.ToDateTime(); model.ToUserID = RoadFlow.Platform.Users.RemovePrefix(id2).ToGuid(); model.WriteTime = DateTimeNew.Now; if (num != 0) { workFlowDelegation1.Add(model); RoadFlow.Platform.Log.Add("添加了工作委托", model.Serialize(), RoadFlow.Platform.Log.Types.流程相关, "", "", (RoadFlow.Data.Model.Users)null); } else { workFlowDelegation1.Update(model); RoadFlow.Platform.Log.Add("修改了工作委托", "", RoadFlow.Platform.Log.Types.流程相关, oldXML, model.Serialize(), (RoadFlow.Data.Model.Users)null); } workFlowDelegation1.RefreshCache(); // ISSUE: reference to a compiler-generated field if (WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__0 == null) { // ISSUE: reference to a compiler-generated field WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "Script", typeof(WorkFlowDelegationController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, (string)null) })); } // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field object obj = WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__0.Target((CallSite)WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__0, this.ViewBag, "alert('保存成功!');new RoadUI.Window().getOpenerWindow().query();new RoadUI.Window().close();"); } // ISSUE: reference to a compiler-generated field if (WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__1 == null) { // ISSUE: reference to a compiler-generated field WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__1 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "FlowOptions", typeof(WorkFlowDelegationController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null) })); } // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field object obj1 = WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__1.Target((CallSite)WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__1, this.ViewBag, new RoadFlow.Platform.WorkFlow().GetOptions(empty5)); RoadFlow.Data.Model.WorkFlowDelegation workFlowDelegation3; if (model != null) { workFlowDelegation3 = model; } else { workFlowDelegation3 = new RoadFlow.Data.Model.WorkFlowDelegation(); workFlowDelegation3.UserID = RoadFlow.Platform.Users.CurrentUserID; } return((ActionResult)this.View((object)workFlowDelegation3)); }
public int Update(RoadFlow.Data.Model.WorkFlowDelegation model) { string sql = "UPDATE WorkFlowDelegation SET \r\n\t\t\t\tUserID=@UserID,StartTime=@StartTime,EndTime=@EndTime,FlowID=@FlowID,ToUserID=@ToUserID,WriteTime=@WriteTime,Note=@Note\r\n\t\t\t\tWHERE ID=@ID"; SqlParameter[] sqlParameterArray = new SqlParameter[8]; int index1 = 0; SqlParameter sqlParameter1 = new SqlParameter("@UserID", SqlDbType.UniqueIdentifier, -1); sqlParameter1.Value = (object)model.UserID; sqlParameterArray[index1] = sqlParameter1; int index2 = 1; SqlParameter sqlParameter2 = new SqlParameter("@StartTime", SqlDbType.DateTime, 8); sqlParameter2.Value = (object)model.StartTime; sqlParameterArray[index2] = sqlParameter2; int index3 = 2; SqlParameter sqlParameter3 = new SqlParameter("@EndTime", SqlDbType.DateTime, 8); sqlParameter3.Value = (object)model.EndTime; sqlParameterArray[index3] = sqlParameter3; int index4 = 3; SqlParameter sqlParameter4; if (model.FlowID.HasValue) { SqlParameter sqlParameter5 = new SqlParameter("@FlowID", SqlDbType.UniqueIdentifier, -1); sqlParameter5.Value = (object)model.FlowID; sqlParameter4 = sqlParameter5; } else { sqlParameter4 = new SqlParameter("@FlowID", SqlDbType.UniqueIdentifier, -1); sqlParameter4.Value = (object)DBNull.Value; } sqlParameterArray[index4] = sqlParameter4; int index5 = 4; SqlParameter sqlParameter6 = new SqlParameter("@ToUserID", SqlDbType.UniqueIdentifier, -1); sqlParameter6.Value = (object)model.ToUserID; sqlParameterArray[index5] = sqlParameter6; int index6 = 5; SqlParameter sqlParameter7 = new SqlParameter("@WriteTime", SqlDbType.DateTime, 8); sqlParameter7.Value = (object)model.WriteTime; sqlParameterArray[index6] = sqlParameter7; int index7 = 6; SqlParameter sqlParameter8; if (model.Note != null) { SqlParameter sqlParameter5 = new SqlParameter("@Note", SqlDbType.NVarChar, 8000); sqlParameter5.Value = (object)model.Note; sqlParameter8 = sqlParameter5; } else { sqlParameter8 = new SqlParameter("@Note", SqlDbType.NVarChar, 8000); sqlParameter8.Value = (object)DBNull.Value; } sqlParameterArray[index7] = sqlParameter8; int index8 = 7; SqlParameter sqlParameter9 = new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1); sqlParameter9.Value = (object)model.ID; sqlParameterArray[index8] = sqlParameter9; SqlParameter[] parameter = sqlParameterArray; return(this.dbHelper.Execute(sql, parameter, false)); }
public int Update(RoadFlow.Data.Model.WorkFlowDelegation model) { string sql = "UPDATE workflowdelegation SET \r\n\t\t\t\tUserID=@UserID,StartTime=@StartTime,EndTime=@EndTime,FlowID=@FlowID,ToUserID=@ToUserID,WriteTime=@WriteTime,Note=@Note\r\n\t\t\t\tWHERE ID=@ID"; MySqlParameter[] mySqlParameterArray = new MySqlParameter[8]; int index1 = 0; MySqlParameter mySqlParameter1 = new MySqlParameter("@UserID", MySqlDbType.VarChar, 36); mySqlParameter1.Value = (object)model.UserID; mySqlParameterArray[index1] = mySqlParameter1; int index2 = 1; MySqlParameter mySqlParameter2 = new MySqlParameter("@StartTime", MySqlDbType.DateTime, -1); mySqlParameter2.Value = (object)model.StartTime; mySqlParameterArray[index2] = mySqlParameter2; int index3 = 2; MySqlParameter mySqlParameter3 = new MySqlParameter("@EndTime", MySqlDbType.DateTime, -1); mySqlParameter3.Value = (object)model.EndTime; mySqlParameterArray[index3] = mySqlParameter3; int index4 = 3; MySqlParameter mySqlParameter4; if (model.FlowID.HasValue) { MySqlParameter mySqlParameter5 = new MySqlParameter("@FlowID", MySqlDbType.VarChar, 36); mySqlParameter5.Value = (object)model.FlowID; mySqlParameter4 = mySqlParameter5; } else { mySqlParameter4 = new MySqlParameter("@FlowID", MySqlDbType.VarChar, 36); mySqlParameter4.Value = (object)DBNull.Value; } mySqlParameterArray[index4] = mySqlParameter4; int index5 = 4; MySqlParameter mySqlParameter6 = new MySqlParameter("@ToUserID", MySqlDbType.VarChar, 36); mySqlParameter6.Value = (object)model.ToUserID; mySqlParameterArray[index5] = mySqlParameter6; int index6 = 5; MySqlParameter mySqlParameter7 = new MySqlParameter("@WriteTime", MySqlDbType.DateTime, -1); mySqlParameter7.Value = (object)model.WriteTime; mySqlParameterArray[index6] = mySqlParameter7; int index7 = 6; MySqlParameter mySqlParameter8; if (model.Note != null) { MySqlParameter mySqlParameter5 = new MySqlParameter("@Note", MySqlDbType.Text, -1); mySqlParameter5.Value = (object)model.Note; mySqlParameter8 = mySqlParameter5; } else { mySqlParameter8 = new MySqlParameter("@Note", MySqlDbType.Text, -1); mySqlParameter8.Value = (object)DBNull.Value; } mySqlParameterArray[index7] = mySqlParameter8; int index8 = 7; MySqlParameter mySqlParameter9 = new MySqlParameter("@ID", MySqlDbType.VarChar, 36); mySqlParameter9.Value = (object)model.ID; mySqlParameterArray[index8] = mySqlParameter9; MySqlParameter[] parameter = mySqlParameterArray; return(this.dbHelper.Execute(sql, parameter, false)); }