Exemplo n.º 1
0
        public static List <CCode> getCodeByCodeType(int CodeTypeId)
        {
            try
            {
                CShared      oDBShared = new CShared();
                List <CCode> oCode     = new List <CCode>();
                DataSet      dsCode    = oDBShared.GetDataSet("TCode", "uspQueryGet " + CodeTypeId);

                using (DataTable dtCode = dsCode.Tables["TCode"])
                {
                    if (dtCode != null && dtCode.Rows.Count > 0)
                    {
                        oCode = CShared.DataTableToList <CCode>(dtCode);
                    }
                }

                return(oCode);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        //public static List<CCountry> GetCountry()
        //{
        //    try
        //    {
        //        List<CCountry> oCountry = new List<CCountry>();
        //        DataSet dsCode = CGlobal.oDBShared.GetDataSet("TCountry", "uspQueryGet_Web 'GetCountry'");

        //        using (DataTable dtCode = dsCode.Tables["TCountry"])
        //        {
        //            if (dtCode != null && dtCode.Rows.Count > 0)
        //            {
        //                oCountry = CShared.DataTableToList<CCountry>(dtCode);
        //            }
        //        }

        //        return oCountry;
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}

        public static List <CCompany> GetComapnyList(int AdminUserId)
        {
            try
            {
                List <CCompany> oCompany  = new List <CCompany>();
                CShared         oDBShared = new CShared();

                DataSet dsCompany = oDBShared.GetDataSet("TCompanyInfo", "uspCompanyInfoGet 0");

                using (DataTable dtCompany = dsCompany.Tables["TCompanyInfo"])
                {
                    if (dtCompany != null && dtCompany.Rows.Count > 0)
                    {
                        oCompany = CShared.DataTableToList <CCompany>(dtCompany);
                    }
                }

                return(oCompany);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }