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

  • Home
  • SEARCH
  • 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 3332970
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:44:42+00:00 2026-05-17T23:44:42+00:00

I am using Visual Studio 2008 (C#). Is there any better way to write

  • 0

I am using Visual Studio 2008 (C#). Is there any better way to write this code? I am a poor programmer.

#region Properties
public string ItemCode
{
    get { return _itemCode; }
    set { _itemCode = value; }
}

public string ItemName
{
    get { return _itemName; }
    set { _itemName = value; }
}

public decimal? StockInHand
{
    get { return _stockInHand; }
    set { _stockInHand = value; }
}

public decimal? AlertLevelQty
{
    get { return _alertLevelQty; }
    set { _alertLevelQty = value; }
}

public string Unit
{
    get { return _unit; }
    set { _unit = value; }
}

public decimal? Discount
{
    get { return _discount; }
    set { _discount = value; }
}

public string WhetherInPercent
{
    get { return _whetherInPercent; }
    set { _whetherInPercent = value; }
}

public int CategoryID
{
    get { return _categoryID; }
    set { _categoryID = value; }
}
#endregion

#region Constructors
public ItemMaster()
{  }

public ItemMaster(string argItemName, string argItemCode, decimal? argStockInHand, decimal? argAlertLevelQty, string argUnit, decimal? argDiscount, string argWhetherInPercent, int argCategoryID)
{
    this.ItemName = argItemName;
    this.ItemCode = argItemCode;
    this.StockInHand = argStockInHand;
    this.AlertLevelQty = argAlertLevelQty;
    this.Unit = argUnit;
    this.Discount = argDiscount;
    this.WhetherInPercent = argWhetherInPercent;
    this.CategoryID = argCategoryID;
}
#endregion
  • 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-05-17T23:44:43+00:00Added an answer on May 17, 2026 at 11:44 pm

    Nothing is wrong with your code.

    I am a lazy programmer so I often use automatic properties in my code.

    public string Unit { get; set; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Visual Studio 2008 SP1 on .NET 3.5 SP1 on Vista Any time
Using Visual Studio 2008 Team Edition, is it possible to assign a shortcut key
Using Visual Studio 2008 / C# / VS Unit Testing. I have a very
I'm looking into using Visual Studio 2008's built in unit test projects instead of
I'm using visual studio 2008 and ReSharper 4 and it's kind of slow. My
I've started using Visual Studio 2008 and it keeps asking me to upgrade my
I'm using Visual Studio 2008 and the built-in installation tools for a C# client
I'm using Visual Studio 2008 Team System with SP1, and I've noticed an annoying
If I'm using Visual Studio 2008 targeted to ASP.NET 2.0, then which version of
Applications I am using: Visual Studio 2008 (C#/ASP.NET) Visual Source Safe 8.0 IIS 5.1

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.