Example #1
0
        public void AddTractorPurchaseDetails(TractorPurchaseDetail t)
        {
            // First Add the Invoice in it to Invoice Table.
            tblPurchaseInvoice invoice = new tblPurchaseInvoice();

            getTableInvoiceEquivalentFromSparePurchaseObj(ref invoice, t);
            dc.tblPurchaseInvoices.InsertOnSubmit(invoice);
            dc.SubmitChanges();

            // Add the Tractors Details inside to TractorPurchase Table.
            List <tblTractorPurchaseDetail> traPurchaseDetail = null;

            getTableTractorPurchaseDetailEquivalentFromTractorPurchaseObj(ref traPurchaseDetail, t);
            dc.tblTractorPurchaseDetails.InsertAllOnSubmit(traPurchaseDetail);
            dc.SubmitChanges();

            // Add the Tractor to Stock Table.
        }
Example #2
0
        public void AddPDIInfomrationForTractor(TractorPurchaseDetail _tractorPurchaseDetail)
        {
            // Vishwa : [Start] - COmmented Code.
            foreach (TractorPurchase tra in _tractorPurchaseDetail.TractorsPurchased)
            {
                int tractorPurchaseId = _tractorPurchaseDetail.TractorPurchaseId;// getTractorPurchaseId(tra.TractorEngineNo);

                // Add the Battery Details to Berrty Table.
                tblTractorBattery tba = new tblTractorBattery();
                tba.tractorPurchaseId = tractorPurchaseId;
                tba.batteryMaker      = tra.TractorBattery.BatteryMaker;
                tba.batteryRemarks    = tra.TractorBattery.Remarks;
                tba.batterySerialNo   = tra.TractorBattery.BatterySerialNo;
                tba.batterySize       = tra.TractorBattery.BatterySize;

                dc.tblTractorBatteries.InsertOnSubmit(tba);
                dc.SubmitChanges();

                // Add the Tyres Details to Tyre Table.
                List <tblTractorTyre> listofTyres = new List <tblTractorTyre>();
                foreach (Tyre ty in tra.TractorTyres.ToList())
                {
                    tblTractorTyre tty = new tblTractorTyre();
                    tty.tractorPurchaseId = tractorPurchaseId;
                    tty.tyreMaker         = ty.tyreMaker;
                    tty.tyreRemarks       = ty.tyreMaker;
                    tty.tyreSerialNo      = ty.tyreSerialNumber;
                    tty.tyreSize          = ty.tyreSize;
                    listofTyres.Add(tty);
                }

                dc.tblTractorTyres.InsertAllOnSubmit(listofTyres);
                dc.SubmitChanges();

                // Vishwa : [Start] - COmmented Code.
            }
        }
Example #3
0
        private void getTableTractorPurchaseDetailEquivalentFromTractorPurchaseObj(ref List <tblTractorPurchaseDetail> traPurchaseDetail, TractorPurchaseDetail t)
        {
            //throw new NotImplementedException();
            if (t.TractorsPurchased.Count() > 0)
            {
                traPurchaseDetail = new List <tblTractorPurchaseDetail>();
                foreach (TractorPurchase tra in t.TractorsPurchased)
                {
                    tblTractorPurchaseDetail traPurDetail = new tblTractorPurchaseDetail();


                    traPurDetail.invoiceId                = getInvoiceId(t.InvoiceNumber, t.supplierName);
                    traPurDetail.tractorSpecification     = tra.TractorSpecification;
                    traPurDetail.tractorId                = getTractorId(tra.TractorModel);
                    traPurDetail.engineNumber             = tra.TractorEngineNo;
                    traPurDetail.chassisNumber            = tra.TractorChassisNo;
                    traPurDetail.FIPNumber                = tra.TractorFIPNumber;
                    traPurDetail.alternateMake            = tra.TractorAlternateNumber;
                    traPurDetail.starterMotorMake         = tra.TractorStarterMoterMake;
                    traPurDetail.PDIHours                 = tra.PDIHours;
                    traPurDetail.subTotalUnitPurchaseRate = tra.SubTotalPurchaseRate;
                    traPurDetail.vatOnTractor             = tra.VATOnsubTotalPurchaseRate;
                    traPurDetail.insuranceAndOthers       = tra.InsuranceAndOthers;
                    traPurDetail.grandTotal               = tra.GrandTotal;


                    traPurchaseDetail.Add(traPurDetail);
                }
            }
        }
Example #4
0
 public bool SavePDIReport(TractorPurchaseDetail tractorPurChaseDetail)
 {
     throw new NotImplementedException();
 }