Exemplo n.º 1
0
        private List <RoadFlow.Data.Model.Menu> DataReaderToList(OracleDataReader dataReader)
        {
            List <RoadFlow.Data.Model.Menu> menuList = new List <RoadFlow.Data.Model.Menu>();

            while (dataReader.Read())
            {
                RoadFlow.Data.Model.Menu menu = new RoadFlow.Data.Model.Menu();
                menu.ID       = dataReader.GetString(0).ToGuid();
                menu.ParentID = dataReader.GetString(1).ToGuid();
                if (!dataReader.IsDBNull(2))
                {
                    menu.AppLibraryID = new Guid?(dataReader.GetString(2).ToGuid());
                }
                menu.Title = dataReader.GetString(3);
                if (!dataReader.IsDBNull(4))
                {
                    menu.Params = dataReader.GetString(4);
                }
                if (!dataReader.IsDBNull(5))
                {
                    menu.Ico = dataReader.GetString(5);
                }
                menu.Sort = dataReader.GetInt32(6);
                if (!dataReader.IsDBNull(7))
                {
                    menu.IcoColor = dataReader.GetString(7);
                }
                menuList.Add(menu);
            }
            return(menuList);
        }
Exemplo n.º 2
0
 public ActionResult Body(FormCollection collection)
 {
     RoadFlow.Platform.AppLibrary appLibrary1 = new RoadFlow.Platform.AppLibrary();
     RoadFlow.Platform.Menu       menu        = new RoadFlow.Platform.Menu();
     RoadFlow.Data.Model.Menu     model       = (RoadFlow.Data.Model.Menu)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;
     Guid     id1;
     ref Guid local = ref id1;
Exemplo n.º 3
0
        public int Add(RoadFlow.Data.Model.Menu model)
        {
            string sql = "INSERT INTO menu\r\n\t\t\t\t(ID,ParentID,AppLibraryID,Title,Params,Ico,Sort,IcoColor) \r\n\t\t\t\tVALUES(@ID,@ParentID,@AppLibraryID,@Title,@Params,@Ico,@Sort,@IcoColor)";

            MySqlParameter[] mySqlParameterArray = new MySqlParameter[8];
            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("@ParentID", MySqlDbType.VarChar, 36);

            mySqlParameter2.Value       = (object)model.ParentID;
            mySqlParameterArray[index2] = mySqlParameter2;
            int            index3 = 2;
            MySqlParameter mySqlParameter3;

            if (model.AppLibraryID.HasValue)
            {
                MySqlParameter mySqlParameter4 = new MySqlParameter("@AppLibraryID", MySqlDbType.VarChar, 36);
                mySqlParameter4.Value = (object)model.AppLibraryID;
                mySqlParameter3       = mySqlParameter4;
            }
            else
            {
                mySqlParameter3       = new MySqlParameter("@AppLibraryID", MySqlDbType.VarChar, 36);
                mySqlParameter3.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index3] = mySqlParameter3;
            int            index4          = 3;
            MySqlParameter mySqlParameter5 = new MySqlParameter("@Title", MySqlDbType.Text, -1);

            mySqlParameter5.Value       = (object)model.Title;
            mySqlParameterArray[index4] = mySqlParameter5;
            int            index5 = 4;
            MySqlParameter mySqlParameter6;

            if (model.Params != null)
            {
                MySqlParameter mySqlParameter4 = new MySqlParameter("@Params", MySqlDbType.Text, -1);
                mySqlParameter4.Value = (object)model.Params;
                mySqlParameter6       = mySqlParameter4;
            }
            else
            {
                mySqlParameter6       = new MySqlParameter("@Params", MySqlDbType.Text, -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("@Sort", MySqlDbType.Int32, 11);

            mySqlParameter8.Value       = (object)model.Sort;
            mySqlParameterArray[index7] = mySqlParameter8;
            int            index8 = 7;
            MySqlParameter mySqlParameter9;

            if (model.IcoColor != null)
            {
                MySqlParameter mySqlParameter4 = new MySqlParameter("@IcoColor", MySqlDbType.VarChar, 50);
                mySqlParameter4.Value = (object)model.IcoColor;
                mySqlParameter9       = mySqlParameter4;
            }
            else
            {
                mySqlParameter9       = new MySqlParameter("@IcoColor", MySqlDbType.VarChar, 50);
                mySqlParameter9.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index8] = mySqlParameter9;
            MySqlParameter[] parameter = mySqlParameterArray;
            return(this.dbHelper.Execute(sql, parameter, false));
        }
Exemplo n.º 4
0
        public int Add(RoadFlow.Data.Model.Menu model)
        {
            string sql = "INSERT INTO Menu\r\n\t\t\t\t(ID,ParentID,AppLibraryID,Title,Params,Ico,Sort,IcoColor) \r\n\t\t\t\tVALUES(:ID,:ParentID,:AppLibraryID,:Title,:Params,:Ico,:Sort,:IcoColor)";

            OracleParameter[] oracleParameterArray = new OracleParameter[8];
            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(":ParentID", OracleDbType.Varchar2);

            oracleParameter2.Value       = (object)model.ParentID;
            oracleParameterArray[index2] = oracleParameter2;
            int             index3 = 2;
            OracleParameter oracleParameter3;

            if (model.AppLibraryID.HasValue)
            {
                OracleParameter oracleParameter4 = new OracleParameter(":AppLibraryID", OracleDbType.Varchar2);
                oracleParameter4.Value = (object)model.AppLibraryID;
                oracleParameter3       = oracleParameter4;
            }
            else
            {
                oracleParameter3       = new OracleParameter(":AppLibraryID", OracleDbType.Varchar2);
                oracleParameter3.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index3] = oracleParameter3;
            int             index4           = 3;
            OracleParameter oracleParameter5 = new OracleParameter(":Title", OracleDbType.Varchar2);

            oracleParameter5.Value       = (object)model.Title;
            oracleParameterArray[index4] = oracleParameter5;
            int             index5 = 4;
            OracleParameter oracleParameter6;

            if (model.Params != null)
            {
                OracleParameter oracleParameter4 = new OracleParameter(":Params", OracleDbType.Varchar2);
                oracleParameter4.Value = (object)model.Params;
                oracleParameter6       = oracleParameter4;
            }
            else
            {
                oracleParameter6       = new OracleParameter(":Params", 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(":Sort", OracleDbType.Int32);

            oracleParameter8.Value       = (object)model.Sort;
            oracleParameterArray[index7] = oracleParameter8;
            int             index8 = 7;
            OracleParameter oracleParameter9;

            if (model.IcoColor != null)
            {
                OracleParameter oracleParameter4 = new OracleParameter(":IcoColor", OracleDbType.Varchar2);
                oracleParameter4.Value = (object)model.IcoColor;
                oracleParameter9       = oracleParameter4;
            }
            else
            {
                oracleParameter9       = new OracleParameter(":IcoColor", OracleDbType.Varchar2);
                oracleParameter9.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index8] = oracleParameter9;
            OracleParameter[] parameter = oracleParameterArray;
            return(this.dbHelper.Execute(sql, parameter));
        }
Exemplo n.º 5
0
        public int Add(RoadFlow.Data.Model.Menu model)
        {
            string sql = "INSERT INTO Menu\r\n\t\t\t\t(ID,ParentID,AppLibraryID,Title,Params,Ico,Sort,IcoColor) \r\n\t\t\t\tVALUES(@ID,@ParentID,@AppLibraryID,@Title,@Params,@Ico,@Sort,@IcoColor)";

            SqlParameter[] sqlParameterArray = new SqlParameter[8];
            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("@ParentID", SqlDbType.UniqueIdentifier, -1);

            sqlParameter2.Value       = (object)model.ParentID;
            sqlParameterArray[index2] = sqlParameter2;
            int          index3 = 2;
            SqlParameter sqlParameter3;

            if (model.AppLibraryID.HasValue)
            {
                SqlParameter sqlParameter4 = new SqlParameter("@AppLibraryID", SqlDbType.UniqueIdentifier, -1);
                sqlParameter4.Value = (object)model.AppLibraryID;
                sqlParameter3       = sqlParameter4;
            }
            else
            {
                sqlParameter3       = new SqlParameter("@AppLibraryID", SqlDbType.UniqueIdentifier, -1);
                sqlParameter3.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index3] = sqlParameter3;
            int          index4        = 3;
            SqlParameter sqlParameter5 = new SqlParameter("@Title", SqlDbType.NVarChar, 1000);

            sqlParameter5.Value       = (object)model.Title;
            sqlParameterArray[index4] = sqlParameter5;
            int          index5 = 4;
            SqlParameter sqlParameter6;

            if (model.Params != null)
            {
                SqlParameter sqlParameter4 = new SqlParameter("@Params", SqlDbType.VarChar, 5000);
                sqlParameter4.Value = (object)model.Params;
                sqlParameter6       = sqlParameter4;
            }
            else
            {
                sqlParameter6       = new SqlParameter("@Params", SqlDbType.VarChar, 5000);
                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("@Sort", SqlDbType.Int, -1);

            sqlParameter8.Value       = (object)model.Sort;
            sqlParameterArray[index7] = sqlParameter8;
            int          index8 = 7;
            SqlParameter sqlParameter9;

            if (model.IcoColor != null)
            {
                SqlParameter sqlParameter4 = new SqlParameter("@IcoColor", SqlDbType.VarChar, 50);
                sqlParameter4.Value = (object)model.IcoColor;
                sqlParameter9       = sqlParameter4;
            }
            else
            {
                sqlParameter9       = new SqlParameter("@IcoColor", SqlDbType.VarChar, 50);
                sqlParameter9.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index8] = sqlParameter9;
            SqlParameter[] parameter = sqlParameterArray;
            return(this.dbHelper.Execute(sql, parameter, false));
        }