예제 #1
0
        public InventoryTransactionsLog GetByLine(int lineId)
        {
            var transLog   = new InventoryTransactionsLog(_companyDb);
            var tableQuery = new TableQuery(transLog);

            tableQuery.Where.Add(
                new QueryParam(
                    transLog.Collumns[InventoryTransactionsLog.FieldsName.ApplyEntry], _docEntry));

            tableQuery.Where.Add(
                new QueryParam(
                    transLog.Collumns[InventoryTransactionsLog.FieldsName.ApplyType], _docType));

            tableQuery.Where.Add(
                new QueryParam(
                    transLog.Collumns[InventoryTransactionsLog.FieldsName.ApplyLine], lineId));

            var transType     = DocumentObjectType.GetDocTransactionType((eDocumentObjectType)_docType);
            var accumOnHand   = 1;
            var accumCommited = 2;
            var stockEff      = transType == eTransactionType.oIn ? accumCommited : accumOnHand;

            tableQuery.Where.Add(
                new QueryParam(
                    transLog.Collumns[InventoryTransactionsLog.FieldsName.StockEff], eCondition.ecEqual, stockEff));

            var transLogs = transLog
                            .FillCollection <InventoryTransactionsLog>(tableQuery)
                            .FirstOrDefault() ?? new InventoryTransactionsLog(_companyDb);

            transLogs.Details = GetDetails(transLogs.LogEntry);

            return(transLogs);
        }
 public InventoryTransactionsLog(InventoryTransactionsLog pInventoryTransactionsLog)
 {
     CopyBy(pInventoryTransactionsLog);
 }