void CheckAndSubmit() { if (SelectedUserName.IsNullOrEmpty() || txtPassword.TextLength == 0 || tc.Code.IsNullOrEmpty()) { return; } DoLogin(); }
void DailyAmountLog(object parameter) { CollectionEntry dailyCollectionAmt = new CollectionEntry() { ID = SearchUserID, UserName = SelectedUserName, EntryDate = EntryDate, BalanceAmt = SelectedUserPendingAmt, CurrentAmt = CollectionAmt }; if (SearchUserID == null || SelectedUserName == null || EntryDate == null || SelectedUserPendingAmt.HasValue == false || CollectionAmt.HasValue == false || SelectedUserName.IsVoid() || CollectionAmt <= 0 || SelectedUserPendingAmt <= 0) { MessageBox.Show("Fill in all the mandatory fields"); } else { if (userCollectionModel == null) { userCollectionModel = new UserCollectionModel(); } string selectedDate = (string.Format("{0:yyyy-MM-dd H:mm:ss}", dailyCollectionAmt.EntryDate)); string userEntryExist = userCollectionModel.CheckEntryForSameDate(dailyCollectionAmt.ID, selectedDate); if (userEntryExist.IsVoid()) { userCollectionModel.DailyCollectionEntry(dailyCollectionAmt); SelectedUserPendingAmt = SelectedUserPendingAmt - CollectionAmt; ClearField(); } else { MessageBox.Show("Amount is already entered for the user"); } } }