public void deleteItem(string accountName, string tranType, string tranDate, string tranTime, string tranAmount, string tranDescription)
        {
            Model.POSClasses.EntityClasses.TransactionClass selectedTransaction = null;
            DateTime timeobj = System.DateTime.Now;

            foreach (var item in currentTransactions)
            {
                if (item.AccountName.CompareTo(accountName) == 0)
                {
                    if ((item.iscredit == 1 && tranType == "Credit") || (item.iscredit == 0 && tranType == "Debit"))
                    {
                        if (item.transactionDescription.CompareTo(tranDescription) == 0 && item.transactionAmount == double.Parse(tranAmount))
                        {
                            timeobj = DateTime.Parse(tranTime);
                        }
                        if (timeobj.ToLongTimeString().CompareTo(item.transactionTime.ToLongTimeString()) == 0)
                        {
                            selectedTransaction = item;
                            continue;
                        }
                    }
                }
            }
            if (selectedTransaction != null)
            {
                currentTransactions.Remove(selectedTransaction);
                updateGrid();
                reColorGrid();
            }
        }
        public int SaveTransaction(string accountname, int iscredit, double amount, string description)
        {
            try
            {
                Model.POSClasses.EntityClasses.TransactionClass tclass = new Model.POSClasses.EntityClasses.TransactionClass();
                tclass.AccountID   = GetAccountID(accountname);
                tclass.AccountName = accountname;
                if (description.Length > 0)
                {
                    tclass.transactionDescription = description;
                }
                else
                {
                    tclass.transactionDescription = "No Description";
                }
                tclass.transactionAmount = amount;
                tclass.iscredit          = iscredit;
                tclass.transactionDate   = System.DateTime.Now;
                tclass.transactionTime   = System.DateTime.Now;
                tclass.balance           = 0;
                currentTransactions.Add(tclass);

                updateGrid();
            }
            catch (Exception e)
            {
                MessageBox.Show("Error while saving credit transaction. Details" + e.InnerException.ToString());
            }
            return(0);
        }