示例#1
0
        //public ErrorItem CheckInputLot(NZString itemCode, NZString lotNo) {
        //    ItemBIZ biz = new ItemBIZ();
        //    ItemDTO dto = biz.LoadItem(itemCode);

        //    switch (DataDefine.ConvertValue2Enum<DataDefine.eLOT_CONTROL_CLS>(dto.LOT_CONTROL_CLS.StrongValue)) {
        //        case DataDefine.eLOT_CONTROL_CLS.No:
        //            if (!lotNo.IsNull || lotNo.StrongValue != string.Empty) {
        //                return new ErrorItem(lotNo.Owner, TKPMessages.eValidate.VLM0065.ToString());
        //            }
        //            break;
        //        case DataDefine.eLOT_CONTROL_CLS.Yes:
        //            if (lotNo.IsNull || lotNo.StrongValue.Trim() == String.Empty) {
        //                return new ErrorItem(lotNo.Owner, TKPMessages.eValidate.VLM0050.ToString(), new object[] { itemCode.StrongValue });
        //            }
        //            break;
        //    }


        //    return null;
        //}
        #endregion

        public ErrorItem CheckAdjustDateIsInCurrentPeriod(NZDateTime adjustDate)
        {
            InventoryPeriodDAO inventoryPeriodDAO = new InventoryPeriodDAO(CommonLib.Common.CurrentDatabase);
            InventoryPeriodDTO inventoryPeriodDTO = inventoryPeriodDAO.LoadCurrentYearMonth(null);

            if (inventoryPeriodDTO == null)
            {
                return(new ErrorItem(adjustDate.Owner, TKPMessages.eValidate.VLM0034.ToString()));
            }
            if (inventoryPeriodDTO.PERIOD_BEGIN_DATE.StrongValue.Date > adjustDate.StrongValue.Date ||
                inventoryPeriodDTO.PERIOD_END_DATE.StrongValue.AddMonths(1).Date < adjustDate.StrongValue.Date)
            {
                return(new ErrorItem(adjustDate.Owner, TKPMessages.eValidate.VLM0034.ToString()));
            }
            return(null);
        }
示例#2
0
        public InventoryPeriodDTO LoadCurrentPeriod()
        {
            InventoryPeriodDAO dao = new InventoryPeriodDAO(CommonLib.Common.CurrentDatabase);

            return(dao.LoadCurrentYearMonth(null));
        }