private void DeleteSingleAccount()
        {
            QueryManager qm = new QueryManager();
            MessageBoxButton btn = MessageBoxButton.OK;
            MessageBoxButton btnC = MessageBoxButton.YesNoCancel;

            try
            {
                int i = grvAccounts_AccountCreator_AccountDetails.SelectedIndex;

                if (i < 0)
                {
                    GlobusLogHelper.log.Info("Please Select Account For Deletion !");

                    var ResultMessageBox = ModernDialog.ShowMessage("Please Select Account For Deletion !", " Delete Account ", btnC);

                    return;
                }


                var result = ModernDialog.ShowMessage("Are You Want To Delete This Accounts Permanently?", " Delete Account ", btnC);

                if (result == MessageBoxResult.Yes)
                {
                    foreach (GramDominator.ViewModule.AccountNotifyPropertyChanged objAccountNotifyPropertyChanged in grvAccounts_AccountCreator_AccountDetails.SelectedItems)
                    {
                        try
                        {
                            // AccountViewModel._listOfAccount
                            //DataRowView row = (DataRowView)selection;

                            string Username = objAccountNotifyPropertyChanged.Username.ToString();
                            string Password = objAccountNotifyPropertyChanged.Password.ToString();
                            qm.DeleteAccounts(Username);
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error :" + ex.Message);
                        }
                    }
                    LoadAccountsFromDataBase();
                    AccounLoad();
                }

            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : 55" + ex.Message);
            }
        }
        private void DeleteSingleAccount()
        {
            QueryManager qm = new QueryManager();
            MessageBoxButton btn = MessageBoxButton.OK;
            MessageBoxButton btnC = MessageBoxButton.YesNoCancel;

            try
            {
                int i = grvAccounts_AccountCreator_AccountDetails.SelectedIndex;

                if (i < 0)
                {
                    GlobusLogHelper.log.Info("Please Select Account For Deletion !");

                    var ResultMessageBox = ModernDialog.ShowMessage("Please Select Account For Deletion !", " Delete Account ", btnC);

                    return;
                }


                var result = ModernDialog.ShowMessage("Are You Want To Delete This Accounts Permanently?", " Delete Account ", btnC);

                if (result == MessageBoxResult.Yes)
                {
                    foreach (var selection in grvAccounts_AccountCreator_AccountDetails.SelectedItems)
                    {
                        try
                        {
                            DataRowView row = (DataRowView)selection;

                            string Username = row["UserName"].ToString();
                            string Password = row["Password"].ToString();
                            qm.DeleteAccounts(Username);
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : 55" + ex.Message);
                        }
                    }
                    LoadAccountsFromDataBase();
                }

            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : 55" + ex.Message);
            }
        }
        private void Grid_PreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            DataGrid grid = (DataGrid)sender;
            if (e.Command == DataGrid.DeleteCommand)
            {
                try
                {
                    int i = grvAccounts_AccountCreator_AccountDetails.SelectedIndex;

                    if (i < 0)
                    {
                        GlobusLogHelper.log.Info("Please select account for deletion");
                        return;
                    }
                    QueryManager qm = new QueryManager();
                    MessageBoxButton btn = MessageBoxButton.OK;
                    MessageBoxButton btnC = MessageBoxButton.YesNo;

                    var result = ModernDialog.ShowMessage("Are you want to delete this Accounts permanently?", " Delete Account ", btnC);

                    if (result == MessageBoxResult.Yes)
                    {
                        foreach (var selection in grvAccounts_AccountCreator_AccountDetails.SelectedItems)
                        {
                            try
                            {
                                DataRowView row = (DataRowView)selection;

                                string Username = row[1].ToString();
                                string Password = row[2].ToString();
                                qm.DeleteAccounts(Username);
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : 55" + ex.Message);
                            }
                        }
                        LoadAccountsFromDataBase();
                    }

                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error("Error : 55" + ex.Message);
                }
                e.Handled = true;
            }
        }
        private void DeleteSingleAccount()
        {
            try
            {
                int i = grvAccounts_AccountCreator_AccountDetails.SelectedIndex;

                if (i < 0)
                {
                    GlobusLogHelper.log.Info("Please select account for deletion");
                    return;
                }
                QueryManager qm = new QueryManager();
                MessageBoxButton btn = MessageBoxButton.OK;
                MessageBoxButton btnC = MessageBoxButton.YesNoCancel;

                var result = ModernDialog.ShowMessage("Are you want to delete this Accounts permanently?", " Delete Account ", btnC);

                if (result == MessageBoxResult.Yes)
                {
                    foreach (var selection in grvAccounts_AccountCreator_AccountDetails.SelectedItems)
                    {
                        try
                        {
                            DataRowView row = (DataRowView)selection;

                            string Username = row[0].ToString();
                            string Password = row[1].ToString();
                            qm.DeleteAccounts(Username);
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : 55" + ex.Message);
                        }
                    }
                    LoadAccountsFromDataBase();
                }
                try
                {
                    DataSet ds = new DataSet();
                    ds = Qm.SelectAccounts();
                    DataTable dt = new DataTable();
                    dt = ds.Tables["tb_LinkedInAccount"];
                    Application.Current.Dispatcher.Invoke(new Action(() => { lblaccounts_ManageAccounts_LoadsAccountsCount.Content = dt.Rows.Count.ToString(); }));
                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error("Error : 55" + ex.Message);
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : 55" + ex.Message);
            }
        }