Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
 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);
     }
 }
Beispiel #3
0
 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; }
 }
Beispiel #4
0
 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; }
 }
Beispiel #5
0
 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; }
 }