public BusinessUnit GetBusinessUnit() { BusinessUnit businessunit = new BusinessUnit(); using (SqlConnection con = new SqlConnection(connection())) { using (SqlCommand cmd = new SqlCommand("Prc_GetBusinessUnit1", con)) { cmd.CommandType = CommandType.StoredProcedure; con.Open(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { businessunit.ID = Convert.ToInt32(dr["BU_ID"]); businessunit.CompanyName = dr["BU_FULL_NAME"].ToString(); businessunit.CompanyShortName = dr["BU_SHORT_NAME"].ToString(); businessunit.IncorporationDate = dr["INCORPORATION_DATE"].ToString(); businessunit.PANNumber = dr["PAN_NO"].ToString(); businessunit.TANNumber = dr["TAN_NO"].ToString(); businessunit.Address = dr["BU_ADDRESS"].ToString(); businessunit.Countryname = dr["COUNTRY_ID"].ToString(); businessunit.ResionName = dr["REGION_ID"].ToString(); businessunit.Dzongkhagname = dr["DZONGKHAG_ID"].ToString(); businessunit.Locationname = dr["LOCATION_ID"].ToString(); businessunit.PostalCode = dr["POSTCODE"].ToString(); businessunit.CompanyEmail = dr["BU_EMAIL"].ToString(); businessunit.PhoneNumber = dr["PHONE_NUMBER"].ToString(); businessunit.ContactPerson = dr["CONTACT_PERSON"].ToString(); businessunit.ContactEmail = dr["CONTACT_EMAIL"].ToString(); businessunit.MobileNumber = dr["MOBILE_NUMBER"].ToString(); businessunit.FinancialYearFrom = dr["FINANCIAL_YEAR_FROM"].ToString(); businessunit.FinancialYearTo = dr["FINANCIAL_YEAR_TO"].ToString(); businessunit.CalendarYearFrom = dr["CALENDAR_YEAR_FROM"].ToString(); businessunit.CalendarYearTo = dr["CALENDAR_YEAR_TO"].ToString(); businessunit.Website = dr["WEBSITE"].ToString(); } con.Close(); } } return(businessunit); }