Exemple #1
0
        public void EntityWriter_Add()
        {
            var customer  = MemorySeeder.SeedCustomer();
            var successed = _writer.Add(customer);

            Assert.IsTrue(successed);
            Assert.IsTrue(customer.Id.IsNotZeroOrEmpty());

            var result = _reader.FirstOrDefault(customer.Id);

            Assert.IsNotNull(result);
            Assert.IsInstanceOf(typeof(Customer), result);
        }
Exemple #2
0
        private static void Add_RSL_RTS_EQP_IN_OUT_ACT_IF(IEntityWriter <RSL_RTS_EQP_IN_OUT_ACT_IF> result,
                                                          string factoryID, string shopID, DateTime rptDate, string eqpID, string stepID, string processID,
                                                          string productID, string productVersion, string ownerType, string ownerID,
                                                          int qty, string isFixed, bool baseTrackIn, DateTime currRptDate, DateTime now)
        {
            var find = result.Find(factoryID,
                                   shopID,
                                   rptDate,
                                   eqpID,
                                   stepID,
                                   processID,
                                   productID,
                                   productVersion,
                                   ownerType,
                                   ownerID);

            if (find == null)
            {
                find = new RSL_RTS_EQP_IN_OUT_ACT_IF();

                find.FACTORY_ID = factoryID;
                find.SHOP_ID    = shopID;
                find.RPT_DATE   = rptDate;
                find.EQP_ID     = eqpID;
                find.STEP_ID    = stepID;
                find.PROC_ID    = processID;
                find.PROD_ID    = productID;
                find.PROD_VER   = productVersion;
                find.OWNER_TYPE = ownerType;
                find.OWNER_ID   = ownerID;
                find.IN_QTY     = 0;
                find.OUT_QTY    = 0;
                find.IS_FIXED   = isFixed;

                result.Add(find);
            }

            if (baseTrackIn)
            {
                find.IN_QTY += qty;
            }
            else
            {
                find.OUT_QTY += qty;
            }

            //当前进行的时间段时,做“未确定”处理
            //현재 진행중인 시간대인 경우 미확정 처리
            if (rptDate >= currRptDate)
            {
                find.IS_FIXED = "N";
            }

            find.UPDATE_DTTM = now;
        }