예제 #1
0
        private void UpdateDataBook(ETestState state)
        {
            if (context.Report.RecNo < 0)
            {
                return;
            }

            context.DB.Lock();

            try
            {
                FbTransaction trans = context.DB.BeginTrans();

                try
                {
                    DataBookDataSet set = context.DB.DataBookSet;

                    set.RecNo = context.Report.RecNo;
                    set.Update(state, trans);

                    context.DB.CommitTrans();
                }
                catch (Exception e)
                {
                    Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
                    context.DB.RollbackTrans();
                }
            }
            finally
            {
                context.DB.Unlock();
            }
        }
예제 #2
0
        private void UpdateDataBook(DateTime time, TimeSpan elpased,
                                    string capacity, string power, string eer_cop, ETestState state)
        {
            if (context.Report.RecNo < 0)
            {
                return;
            }

            context.DB.Lock();

            try
            {
                FbTransaction trans = context.DB.BeginTrans();

                try
                {
                    DataBookDataSet set = context.DB.DataBookSet;

                    set.RecNo         = context.Report.RecNo;
                    set.EndTime       = time.ToString(Resource.csDateTimeFormat);
                    set.ElapsedTime   = elpased.ToString(@"ddd\.hh\:mm\:ss");
                    set.TotalCapacity = capacity;
                    set.TotalPower    = power;
                    set.TotalEER_COP  = eer_cop;
                    set.State         = state;
                    set.Update(trans);

                    context.DB.CommitTrans();
                }
                catch (Exception e)
                {
                    Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
                    context.DB.RollbackTrans();
                }
            }
            finally
            {
                context.DB.Unlock();
            }
        }