private async void AddCreditAsync() { var progressDialog = ProgressDialog.Show(Activity, "", "Adding...", true); try { CreditDebitHistory creditDebitHistory = new CreditDebitHistory { TypeDate = Convert.ToDateTime(editDate.Text).ToString("yyyy-MM-dd"), Amount = Convert.ToDecimal(editAmount.Text), OperationDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Remarks = editRemarks.Text, Type = eType.CREDIT.ToString(), UserId = clsGlobal.UserId }; string TotalCreditAmount = await Task.Run(() => creditDebitDb.AddCredit(creditDebitHistory)); txtTotalCredit.Text = TotalCreditAmount; progressDialog.Hide(); Clear(); Toast.MakeText(Activity, "Amount added successfully!!", ToastLength.Long).Show(); } catch (Exception ex) { progressDialog.Hide(); clsGLB.ShowMessage(ex.Message, Activity, MessageTitle.ERROR); } }
private void CreditDebitHistoryAdapter_ItemClick(object sender, int e) { try { _SelectedHistoryItem = creditDebitHistoryAdapter.lst[e]; ShowConfirmBox("Sach mein delete krna hai ya majak kar rhe ho ?", this); } catch (Exception ex) { clsGLB.ShowMessage(ex.Message, this, MessageTitle.ERROR); } }
public int DeleteCreditDebit(CreditDebitHistory item) { try { using (var connection = new SQLiteConnection(clsGlobal.DBFilePath)) { return(connection.Delete(item)); } } catch (SQLiteException sqlex) { throw sqlex; } catch (Exception ex) { throw ex; } }
public string AddCredit(CreditDebitHistory item) { try { using (var connection = new SQLiteConnection(clsGlobal.DBFilePath)) { connection.Insert(item); return(GetTotalCreditAmount()); } } catch (SQLiteException sqlex) { throw sqlex; } catch (Exception ex) { throw ex; } }
public bool AddDebit(CreditDebitHistory item) { try { using (var connection = new SQLiteConnection(clsGlobal.DBFilePath)) { connection.Insert(item); return(true); } } catch (SQLiteException sqlex) { throw sqlex; } catch (Exception ex) { throw ex; } }