コード例 #1
0
        // retrieve open Adj Voucher
        public AdjustmentVoucher retrieveNewOrAvailableAdjustmentVoucherForClerk(int deliveredEmployeeId)
        {
            AdjustmentVoucher targetAdjustmentVoucher = (AdjustmentVoucher)adjustmentVoucherRepo.FindBy(x => x.EmployeeId == deliveredEmployeeId && x.Status == "Open").FirstOrDefault();
            AdjustmentVoucher returnTargetAdjustmentVoucherId;

            if (targetAdjustmentVoucher == null)
            {
                AdjustmentVoucher newAdjustmentVoucher = new AdjustmentVoucher()
                {
                    EmployeeId = deliveredEmployeeId, Status = "Open", Date = DateTime.Now
                };
                newAdjustmentVoucher            = adjustmentVoucherRepo.Create(newAdjustmentVoucher);
                returnTargetAdjustmentVoucherId = adjustmentVoucherRepo.FindOneBy(x => x.EmployeeId == deliveredEmployeeId && x.Status == "Open");
            }
            else
            {
                returnTargetAdjustmentVoucherId = targetAdjustmentVoucher;
            }
            return(returnTargetAdjustmentVoucherId);
        }
コード例 #2
0
 public void CreateAdjustmentVoucher(AdjustmentVoucher adj)
 {
     adjustmentVoucherRepo.Create(adj);
 }