private List <RoadFlow.Data.Model.ProgramBuilderButtons> DataReaderToList(MySqlDataReader dataReader) { List <RoadFlow.Data.Model.ProgramBuilderButtons> programBuilderButtonsList = new List <RoadFlow.Data.Model.ProgramBuilderButtons>(); while (dataReader.Read()) { RoadFlow.Data.Model.ProgramBuilderButtons programBuilderButtons = new RoadFlow.Data.Model.ProgramBuilderButtons(); programBuilderButtons.ID = dataReader.GetString(0).ToGuid(); programBuilderButtons.ProgramID = dataReader.GetString(1).ToGuid(); if (!dataReader.IsDBNull(2)) { programBuilderButtons.ButtonID = new Guid?(dataReader.GetString(2).ToGuid()); } programBuilderButtons.ButtonName = dataReader.GetString(3); if (!dataReader.IsDBNull(4)) { programBuilderButtons.ClientScript = dataReader.GetString(4); } if (!dataReader.IsDBNull(5)) { programBuilderButtons.Ico = dataReader.GetString(5); } programBuilderButtons.ShowType = dataReader.GetInt32(6); programBuilderButtons.Sort = dataReader.GetInt32(7); programBuilderButtons.IsValidateShow = dataReader.GetInt32(8); programBuilderButtonsList.Add(programBuilderButtons); } return(programBuilderButtonsList); }
public int Add(RoadFlow.Data.Model.ProgramBuilderButtons model) { string sql = "INSERT INTO programbuilderbuttons\r\n\t\t\t\t(ID,ProgramID,ButtonID,ButtonName,ClientScript,Ico,ShowType,Sort,IsValidateShow) \r\n\t\t\t\tVALUES(@ID,@ProgramID,@ButtonID,@ButtonName,@ClientScript,@Ico,@ShowType,@Sort,@IsValidateShow)"; MySqlParameter[] mySqlParameterArray = new MySqlParameter[9]; int index1 = 0; MySqlParameter mySqlParameter1 = new MySqlParameter("@ID", MySqlDbType.VarChar, 36); mySqlParameter1.Value = (object)model.ID; mySqlParameterArray[index1] = mySqlParameter1; int index2 = 1; MySqlParameter mySqlParameter2 = new MySqlParameter("@ProgramID", MySqlDbType.VarChar, 36); mySqlParameter2.Value = (object)model.ProgramID; mySqlParameterArray[index2] = mySqlParameter2; int index3 = 2; MySqlParameter mySqlParameter3; if (model.ButtonID.HasValue) { MySqlParameter mySqlParameter4 = new MySqlParameter("@ButtonID", MySqlDbType.VarChar, 36); mySqlParameter4.Value = (object)model.ButtonID; mySqlParameter3 = mySqlParameter4; } else { mySqlParameter3 = new MySqlParameter("@ButtonID", MySqlDbType.VarChar, 36); mySqlParameter3.Value = (object)DBNull.Value; } mySqlParameterArray[index3] = mySqlParameter3; int index4 = 3; MySqlParameter mySqlParameter5 = new MySqlParameter("@ButtonName", MySqlDbType.VarChar, 200); mySqlParameter5.Value = (object)model.ButtonName; mySqlParameterArray[index4] = mySqlParameter5; int index5 = 4; MySqlParameter mySqlParameter6; if (model.ClientScript != null) { MySqlParameter mySqlParameter4 = new MySqlParameter("@ClientScript", MySqlDbType.LongText, -1); mySqlParameter4.Value = (object)model.ClientScript; mySqlParameter6 = mySqlParameter4; } else { mySqlParameter6 = new MySqlParameter("@ClientScript", MySqlDbType.LongText, -1); mySqlParameter6.Value = (object)DBNull.Value; } mySqlParameterArray[index5] = mySqlParameter6; int index6 = 5; MySqlParameter mySqlParameter7; if (model.Ico != null) { MySqlParameter mySqlParameter4 = new MySqlParameter("@Ico", MySqlDbType.Text, -1); mySqlParameter4.Value = (object)model.Ico; mySqlParameter7 = mySqlParameter4; } else { mySqlParameter7 = new MySqlParameter("@Ico", MySqlDbType.Text, -1); mySqlParameter7.Value = (object)DBNull.Value; } mySqlParameterArray[index6] = mySqlParameter7; int index7 = 6; MySqlParameter mySqlParameter8 = new MySqlParameter("@ShowType", MySqlDbType.Int32, 11); mySqlParameter8.Value = (object)model.ShowType; mySqlParameterArray[index7] = mySqlParameter8; int index8 = 7; MySqlParameter mySqlParameter9 = new MySqlParameter("@Sort", MySqlDbType.Int32, 11); mySqlParameter9.Value = (object)model.Sort; mySqlParameterArray[index8] = mySqlParameter9; int index9 = 8; MySqlParameter mySqlParameter10 = new MySqlParameter("@IsValidateShow", MySqlDbType.Int32, 11); mySqlParameter10.Value = (object)model.IsValidateShow; mySqlParameterArray[index9] = mySqlParameter10; MySqlParameter[] parameter = mySqlParameterArray; return(this.dbHelper.Execute(sql, parameter, false)); }
public int Add(RoadFlow.Data.Model.ProgramBuilderButtons model) { string sql = "INSERT INTO ProgramBuilderButtons\r\n\t\t\t\t(ID,ProgramID,ButtonID,ButtonName,ClientScript,Ico,ShowType,Sort,IsValidateShow) \r\n\t\t\t\tVALUES(:ID,:ProgramID,:ButtonID,:ButtonName,:ClientScript,:Ico,:ShowType,:Sort,:IsValidateShow)"; OracleParameter[] oracleParameterArray = new OracleParameter[9]; int index1 = 0; OracleParameter oracleParameter1 = new OracleParameter(":ID", OracleDbType.Varchar2); oracleParameter1.Value = (object)model.ID; oracleParameterArray[index1] = oracleParameter1; int index2 = 1; OracleParameter oracleParameter2 = new OracleParameter(":ProgramID", OracleDbType.Varchar2); oracleParameter2.Value = (object)model.ProgramID; oracleParameterArray[index2] = oracleParameter2; int index3 = 2; OracleParameter oracleParameter3; if (model.ButtonID.HasValue) { OracleParameter oracleParameter4 = new OracleParameter(":ButtonID", OracleDbType.Varchar2); oracleParameter4.Value = (object)model.ButtonID; oracleParameter3 = oracleParameter4; } else { oracleParameter3 = new OracleParameter(":ButtonID", OracleDbType.Varchar2); oracleParameter3.Value = (object)DBNull.Value; } oracleParameterArray[index3] = oracleParameter3; int index4 = 3; OracleParameter oracleParameter5 = new OracleParameter(":ButtonName", OracleDbType.Varchar2); oracleParameter5.Value = (object)model.ButtonName; oracleParameterArray[index4] = oracleParameter5; int index5 = 4; OracleParameter oracleParameter6; if (model.ClientScript != null) { OracleParameter oracleParameter4 = new OracleParameter(":ClientScript", OracleDbType.Varchar2); oracleParameter4.Value = (object)model.ClientScript; oracleParameter6 = oracleParameter4; } else { oracleParameter6 = new OracleParameter(":ClientScript", OracleDbType.Varchar2); oracleParameter6.Value = (object)DBNull.Value; } oracleParameterArray[index5] = oracleParameter6; int index6 = 5; OracleParameter oracleParameter7; if (model.Ico != null) { OracleParameter oracleParameter4 = new OracleParameter(":Ico", OracleDbType.Varchar2); oracleParameter4.Value = (object)model.Ico; oracleParameter7 = oracleParameter4; } else { oracleParameter7 = new OracleParameter(":Ico", OracleDbType.Varchar2); oracleParameter7.Value = (object)DBNull.Value; } oracleParameterArray[index6] = oracleParameter7; int index7 = 6; OracleParameter oracleParameter8 = new OracleParameter(":ShowType", OracleDbType.Int32); oracleParameter8.Value = (object)model.ShowType; oracleParameterArray[index7] = oracleParameter8; int index8 = 7; OracleParameter oracleParameter9 = new OracleParameter(":Sort", OracleDbType.Int32); oracleParameter9.Value = (object)model.Sort; oracleParameterArray[index8] = oracleParameter9; int index9 = 8; OracleParameter oracleParameter10 = new OracleParameter(":IsValidateShow", OracleDbType.Int32); oracleParameter10.Value = (object)model.IsValidateShow; oracleParameterArray[index9] = oracleParameter10; OracleParameter[] parameter = oracleParameterArray; return(this.dbHelper.Execute(sql, parameter)); }
public int Add(RoadFlow.Data.Model.ProgramBuilderButtons model) { string sql = "INSERT INTO ProgramBuilderButtons\r\n\t\t\t\t(ID,ProgramID,ButtonID,ButtonName,ClientScript,Ico,ShowType,Sort,IsValidateShow) \r\n\t\t\t\tVALUES(@ID,@ProgramID,@ButtonID,@ButtonName,@ClientScript,@Ico,@ShowType,@Sort,@IsValidateShow)"; SqlParameter[] sqlParameterArray = new SqlParameter[9]; int index1 = 0; SqlParameter sqlParameter1 = new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1); sqlParameter1.Value = (object)model.ID; sqlParameterArray[index1] = sqlParameter1; int index2 = 1; SqlParameter sqlParameter2 = new SqlParameter("@ProgramID", SqlDbType.UniqueIdentifier, -1); sqlParameter2.Value = (object)model.ProgramID; sqlParameterArray[index2] = sqlParameter2; int index3 = 2; SqlParameter sqlParameter3; if (model.ButtonID.HasValue) { SqlParameter sqlParameter4 = new SqlParameter("@ButtonID", SqlDbType.UniqueIdentifier, -1); sqlParameter4.Value = (object)model.ButtonID; sqlParameter3 = sqlParameter4; } else { sqlParameter3 = new SqlParameter("@ButtonID", SqlDbType.UniqueIdentifier, -1); sqlParameter3.Value = (object)DBNull.Value; } sqlParameterArray[index3] = sqlParameter3; int index4 = 3; SqlParameter sqlParameter5 = new SqlParameter("@ButtonName", SqlDbType.NVarChar, 400); sqlParameter5.Value = (object)model.ButtonName; sqlParameterArray[index4] = sqlParameter5; int index5 = 4; SqlParameter sqlParameter6; if (model.ClientScript != null) { SqlParameter sqlParameter4 = new SqlParameter("@ClientScript", SqlDbType.VarChar, -1); sqlParameter4.Value = (object)model.ClientScript; sqlParameter6 = sqlParameter4; } else { sqlParameter6 = new SqlParameter("@ClientScript", SqlDbType.VarChar, -1); sqlParameter6.Value = (object)DBNull.Value; } sqlParameterArray[index5] = sqlParameter6; int index6 = 5; SqlParameter sqlParameter7; if (model.Ico != null) { SqlParameter sqlParameter4 = new SqlParameter("@Ico", SqlDbType.VarChar, 500); sqlParameter4.Value = (object)model.Ico; sqlParameter7 = sqlParameter4; } else { sqlParameter7 = new SqlParameter("@Ico", SqlDbType.VarChar, 500); sqlParameter7.Value = (object)DBNull.Value; } sqlParameterArray[index6] = sqlParameter7; int index7 = 6; SqlParameter sqlParameter8 = new SqlParameter("@ShowType", SqlDbType.Int, -1); sqlParameter8.Value = (object)model.ShowType; sqlParameterArray[index7] = sqlParameter8; int index8 = 7; SqlParameter sqlParameter9 = new SqlParameter("@Sort", SqlDbType.Int, -1); sqlParameter9.Value = (object)model.Sort; sqlParameterArray[index8] = sqlParameter9; int index9 = 8; SqlParameter sqlParameter10 = new SqlParameter("@IsValidateShow", SqlDbType.Int, -1); sqlParameter10.Value = (object)model.IsValidateShow; sqlParameterArray[index9] = sqlParameter10; SqlParameter[] parameter = sqlParameterArray; return(this.dbHelper.Execute(sql, parameter, false)); }
public int Update(RoadFlow.Data.Model.ProgramBuilderButtons model) { return(this.dataProgramBuilderButtons.Update(model)); }