Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7938381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:47:57+00:00 2026-06-03T22:47:57+00:00

here ,i am using wpf .in my code there is one folder named by

  • 0

here ,i am using wpf .in my code there is one folder named by datacontect:and it contain code as below:

public interface IAccountCategoryDataSource
{
    bool Add(AccountCategory accountCategory);
    bool Update(AccountCategory accountCategory);
    bool Remove(AccountCategory accountCategory);

    AccountCategory GetById(int id);
    AccountCategory GetByName(string name);
    IEnumerable<AccountCategory> GetByParentCategory(AccountCategory category);
    IEnumerable<AccountCategory> GetTopLevelCategories();
    IEnumerable<AccountCategory> GetBySearchTerm(string searchTerm);
    IEnumerable<AccountCategory> GetAll();

    event EventHandler<ObjectAddedEventArgs> AccountCategoryAdded;
    event EventHandler<ObjectUpdatedEventArgs> AccountCategoryUpdated;
    event EventHandler<ObjectRemovedEventArgs> AccountCategoryRemoved;
}

ther is also other folder datasource: here datasource is related to the above file

public class AccountCategoryDataSource : IAccountCategoryDataSource
{
    public int ReferenceCountOf(AccountCategory accountCategory)
    {
        int count = 0;

        string query = "select count(*) from account_categories where parent_category=" + accountCategory.Id
                     + " union select count(*) from accounts where category=" + accountCategory.Id;

        DataTable dataTable = SQLiteHelper.ExecuteQuery(query);
        foreach (DataRow row in dataTable.Rows)
        {
            count += Convert.ToInt32(row[0]);
        }

        return count;
    }

    #region IAccountCategoryDataSource Members

    public bool Add(AccountCategory accountCategory)
    {
        string query = "insert into account_categories(name, description, parent_category) values("
                            + "'" + accountCategory.Name + "', "
                            + "'" + accountCategory.Description + "', "
                            + accountCategory.ParentCategory.Id
                            + ")";
        accountCategory.Id = SQLiteHelper.ExecuteInsert(query);

        if (accountCategory.Id > 0)
        {
            if (AccountCategoryAdded != null)
            {
                AccountCategoryAdded(this, new ObjectAddedEventArgs(accountCategory));
            }

            return true;
        }

        return false;
    }

    public bool Update(AccountCategory accountCategory)..................

and this related to the model floder’s accountcategory class

public class AccountCategory : IDataErrorInfo, IValidable
{
    #region State Properties

    public int Id { get; set; }
    public string Name { get; set; }
    public string Description { get; set; }
    public AccountCategory ParentCategory { get; set; }
    public bool Builtin { get; set; }

}

and for execution :helper class

 public class SQLiteHelper
{
    public static DataTable ExecuteQuery(string query)
    {
        DataTable dataTable = new DataTable();

        SQLiteConnection conn = new SQLiteConnection(Settings.Default["DBConnectionString"].ToString());

        using (SQLiteCommand cmd = new SQLiteCommand(query, conn))
        {
            conn.Open();

            SQLiteDataReader reader = cmd.ExecuteReader();
            dataTable.Load(reader);
            reader.Close();

            conn.Close();
        }

        return dataTable;
    }..........................

plz explain brief role of data contract.and how it interact with helper,model,and dataSouce . is it provide linq to sql concept?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T22:48:01+00:00Added an answer on June 3, 2026 at 10:48 pm

    DataContract is a WCF concept. It is unrelated to WPF (until it is communicating with WCF).

    From your code, seems like it it just a Folder which contain Data Access Layer classes and seems unrelated to WCF

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Infostrat's WPF wrapper for the Bing maps 3d control (blog here http://blogs.msdn.com/virtualearth3d/
This question is an extension to the one raised here: Using factory_girl in Rails
Possible Duplicate: WPF Button isPressed and isEnabled problem Here is a snippet of code
There is a group here using Java, server-side and client-side, with Swing for the
I have a C# WPF application using a rather noddy MVVM approach. In one
I was tying to add WPF code-behind embedded in the XAML and compile using
Is there any differences between following code snippets? I'm using VS 2010, .NET 4,
I've started developing my code using the example from SO WPF: arranging collection items
EDIT: The plugin in question is located here . PHP beginner here using a
why are we using here 5 parameters for stringWithFormat : return [NSString stringWithFormat:NSLocalizedString(@LatLongFormat, @LatLongFormat),

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.