Пример #1
0
        public static string NextLineVal(Session unitOfWork)
        {
            #region EndCode
            //int sequId = 0;

            //var sequNameParm = new DevExpress.Xpo.DB.SprocParameter("@SequenceName", UI_LABEL_ID_SEQU);
            //var outputParm = new DevExpress.Xpo.DB.SprocParameter()
            //{
            //    ParameterName = "@NewID",
            //    Direction = DevExpress.Xpo.DB.SprocParameterDirection.Output,
            //    DbType = DevExpress.Xpo.DB.DBColumnType.Int32
            //};
            //var data = unitOfWork.ExecuteSprocParametrized(SP_NEXT_TASK_LINE, sequNameParm, outputParm);
            //SelectStatementResultRow row = data.ResultSet[1].Rows[0];

            //sequId = (int)row.Values[1];// data.ResultSet[1].Rows[1].Values[1];
            #endregion
            long returnIndex   = 0;
            var  sequIdParm    = new DevExpress.Xpo.DB.SprocParameter("@SequenceId", SysSequence.UI_LABEL_SEQU);
            var  sequNameParm  = new DevExpress.Xpo.DB.SprocParameter("@SequenceName", Enum.GetName(typeof(SysSequence), SysSequence.UI_LABEL_SEQU));
            var  startWithParm = new DevExpress.Xpo.DB.SprocParameter("@StartWith", 100 * 1000);
            var  outputParm    = new DevExpress.Xpo.DB.SprocParameter()
            {
                ParameterName = "@NewID",
                Direction     = DevExpress.Xpo.DB.SprocParameterDirection.Output,
                DbType        = DevExpress.Xpo.DB.DBColumnType.Int32
            };
            var data = unitOfWork.ExecuteSprocParametrized(SP_NEXT_TASK_LINE, sequIdParm, sequNameParm, startWithParm, outputParm);
            SelectStatementResultRow row = data.ResultSet[1].Rows[0];

            returnIndex = (int)row.Values[1];// data.ResultSet[1].Rows[1].Values[1];


            return("@" + returnIndex.ToString());
        }
        public static int NextLineVal(Session unitOfWork)
        {
            int returnIndex = 0;
            var outputParm  = new DevExpress.Xpo.DB.SprocParameter()
            {
                ParameterName = "@NewID",
                Direction     = DevExpress.Xpo.DB.SprocParameterDirection.Output,
                DbType        = DevExpress.Xpo.DB.DBColumnType.Int32
            };
            var data = unitOfWork.ExecuteSprocParametrized(SP_NEXT_TASK_LINE, outputParm);
            SelectStatementResultRow row = data.ResultSet[1].Rows[0];

            returnIndex = (int)row.Values[1];// data.ResultSet[1].Rows[1].Values[1];

            return(returnIndex);
        }
Пример #3
0
        public static long NextVal(Session unitOfWork, MyEnums.SysSequence sysSequenceName, long startWith = 0)
        {
            long returnIndex   = 0;
            var  sequIdParm    = new DevExpress.Xpo.DB.SprocParameter("@SequenceId", sysSequenceName);
            var  sequNameParm  = new DevExpress.Xpo.DB.SprocParameter("@SequenceName", Enum.GetName(typeof(MyEnums.SysSequence), sysSequenceName));
            var  startWithParm = new DevExpress.Xpo.DB.SprocParameter("@StartWith", startWith);
            var  outputParm    = new DevExpress.Xpo.DB.SprocParameter()
            {
                ParameterName = "@NewID",
                Direction     = DevExpress.Xpo.DB.SprocParameterDirection.Output,
                DbType        = DevExpress.Xpo.DB.DBColumnType.Int32
            };
            var data = unitOfWork.ExecuteSprocParametrized(SP_NEXT_TASK_LINE, sequIdParm, sequNameParm, startWithParm, outputParm);
            SelectStatementResultRow row = data.ResultSet[1].Rows[0];

            returnIndex = (int)row.Values[1];// data.ResultSet[1].Rows[1].Values[1];

            return(returnIndex);
        }