//Add new Payment(AddNewpayment) is in NewPaymentView public void AddNewpayment(int treatmentPlanID, string customerID, decimal amount, string treatmentCompleteDate) { //Keep count for Sychronization DAOCount++; sqlite.UpdateCountRecordSQlite(DAOCount); long paymentId = sqlite.AddNewpayment(treatmentPlanID, customerID, amount, treatmentCompleteDate); //firease if (!IsWorkOffline) { FBCount++; firebaseDAO.UpdateCountRecordFB(FBCount); int paymentID = (int)paymentId; firebaseDAO.AddNewpayment(paymentID, treatmentPlanID, customerID, amount, treatmentCompleteDate); } }