Exemplo n.º 1
0
 public void ShowList()
 {
     sl = 1;
     try
     {
         ObservableCollection <WOWisePeriodicIssueStatementModel> newObjectList = new ObservableCollection <WOWisePeriodicIssueStatementModel>();
         WOWisePeriodicIssueStatementModel newObj = new WOWisePeriodicIssueStatementModel();
         for (int i = 0; i < item.Count; i++)
         {
             if (itemNumberStart == null && itemNumberEnd == null)
             {
                 newObj = readyReport(i);
                 newObjectList.Add(newObj);
             }
             else if (((item[i].itemID >= itemNumberStart.itemID && item[i].itemID <= itemNumberEnd.itemID)))
             {
                 newObj = readyReport(i);
                 newObjectList.Add(newObj);
             }
         }
         IsprintEnable = true;
         ShowingReport = newObjectList;
     }
     catch
     {
         IsprintEnable = false;
     }
 }
Exemplo n.º 2
0
        public WOWisePeriodicIssueStatementModel readyReport(int i)
        {
            WOWisePeriodicIssueStatementModel newObj = new WOWisePeriodicIssueStatementModel();
            int isCnt = 0, retCnt = 0, totCnt = 0;

            for (int j = 0; j < allIssueVoucher.Count; j++)
            {
                DateTime thisVoucherDate = DateTime.ParseExact(allIssueVoucher[j].IssueVoucherDate, "dd/M/yyyy", null);
                if (workorderNo != null)
                {
                    if (allIssueVoucher[j].contructorName == contructorName.contructorName &&
                        allIssueVoucher[j].wareHouseName == wareHouseName.wareHouseName &&
                        allIssueVoucher[j].IsPrinted == 1 &&
                        item[i].itemNumber == allIssueVoucher[j].itemNumber &&
                        workorderNo.workOrderNo == allIssueVoucher[j].workOrderNo &&
                        (thisVoucherDate >= From && thisVoucherDate <= To))
                    {
                        isCnt = isCnt + allIssueVoucher[j].IssueQuantity;
                    }
                }
                if (workorderNo == null)
                {
                    if (allIssueVoucher[j].contructorName == contructorName.contructorName &&
                        allIssueVoucher[j].wareHouseName == wareHouseName.wareHouseName &&
                        allIssueVoucher[j].IsPrinted == 1 &&
                        item[i].itemNumber == allIssueVoucher[j].itemNumber &&
                        (thisVoucherDate >= From && thisVoucherDate <= To))
                    {
                        isCnt = isCnt + allIssueVoucher[j].IssueQuantity;
                    }
                }
            }
            newObj.issueQnty = isCnt;
            for (int l = 0; l < allRetrunVocuher.Count; l++)
            {
                DateTime thisVoucherDate = DateTime.ParseExact(allRetrunVocuher[l].returnDate, "dd/M/yyyy", null);;
                if (allRetrunVocuher[l].contructor == contructorName.contructorName &&
                    allRetrunVocuher[l].ret_warehouse == wareHouseName.wareHouseName &&
                    allRetrunVocuher[l].isPrinted == 1 &&
                    item[i].itemNumber == allRetrunVocuher[l].ItemNo &&
                    (thisVoucherDate >= From && thisVoucherDate <= To))
                {
                    retCnt = retCnt + allRetrunVocuher[l].quentity;
                }
            }
            newObj.retQnty = retCnt;
            for (int k = 0; k < stockData.Count; k++)
            {
                if (item[i].itemNumber == stockData[k].itemNO)
                {
                    newObj.unit = stockData[k].unit;
                    break;
                }
            }
            newObj.itemNumber   = item[i].itemNumber;
            newObj.description  = item[i].itemName;
            newObj.SL           = sl;
            newObj.netIssueQnty = newObj.issueQnty - newObj.retQnty;
            sl++;
            return(newObj);
        }