Ejemplo n.º 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());
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 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);
        }