Refactor
:my
=>
'code'
Codes
Refactorings
Popular
Best
Submit
Spam
Account
Logout
Login
JavaScript doesn't seem to be activated, expect things to be ugly and sloppy!
Learn How to Create Your Own Programming Language
createyourproglang.com
Recent
How to get accepted in Fileice (200% Working) 22/2012
Premium Account
FILE HOSTS PREMIUM ACCOUNT
ALL FILE HOST PREMIUM ACCOUNTS
Zynga Slingo Trainer v5.12
iTunes Gift Card Generator V3.1 2012
Diablo 3 GOLD Coins FREE
Working PS3 Jailbreak 3.65 And 3.66
ExtaBit Premium Accounts and Cookies
Steam Wallet Hack - Money Adder & Hack v3
Popular
XBOX POINTS GENERATOR - MICROSOFT POINTS GENERATOR v1.2012
11 may 2012 premium uploading accounts 100% working
Free Microsoft Points
Free Microsoft Points - Microsoft Points Generator - Xbox Live Codes 2012
Car Town Free Blue Points Hack
Free CarTown Blue Points Generator and CarTown Templates
Better way to get content via jQuery $.get()
Free Microsoft Points
Simple Days Purger
Sharecash Downloader Bypass Surveys New 05/2012
Pastable version of
Help me with ineritance or the best way to do this
<pre class='prettyprint' language='cs'>public class MvNetDB { protected mvAccount _account = null; private static Logger logger = LogManager.GetCurrentClassLogger(); protected void LoginToDB() { _account = new mvAccount(ConfigHelper.ServerLogin, ConfigHelper.ServerAddress); } protected void LogoutFromDB() { if (_account != null) { _account.Logout(); _account.Dispose(); } } protected mvItem ReadRecord(string filename, string recordID) { mvFile file = _account.FileOpen(filename); mvItem item = file.Read(recordID); return item; } } public class Customer { public string ID { get; set; } public string Name { get; set; } public string Address { get; set; } public string City { get; set; } public string State { get; set; } public string Zip { get; set; } public CustCode CustCode { get; set; } } public class CustCode { public string ID { get; set; } public string Name { get; set; } } public class MvNetServiceCallRepository : MvNetDB, IServiceCallRepository { private Customer GetCustomerByID(string custID) { mvItem customerItem = null; try { LoginToDB(); customerItem = ReadRecord("CUSTOMER", custID); } finally { LogoutFromDB(); } Customer customer = new Customer(); customer.ID = custID; customer.Name = customerItem["1"].ToString(); customer.Address = customerItem["2"].ToString(); customer.City = customerItem["3"].ToString(); customer.State = customerItem["4"].ToString(); customer.Zip = customerItem["5"].ToString(); string custCodeID = customerItem["42"].ToString(); customer.CustCode = GetCustCodeByID(custCodeID); return customer; } private CustCode GetCustCodeByID(string custCodeID) { mvItem custCodeItem = null; try { LoginToDB(); custCodeItem = ReadRecord("CUST.CODE", custCodeID); } finally { LogoutFromDB(); } CustCode custCode = new CustCode(); custCode.ID = custCodeID; custCode.Name = custCodeItem["1"].ToString(); return custCode; } }</pre> <a href="http://www.refactormycode.com/codes/737-help-me-with-ineritance-or-the-best-way-to-do-this" style="color:#fff" title="As seen on RefactorMyCode.com"><img alt="Small_logo" src="http://www.refactormycode.com/images/small_logo.gif" style="border:0" /></a>