Exemplo n.º 1
0
 public object fillCountryList(int COUNTRYID, string COUNTRCODE, string COUNTRNAME, string DESC, int USERID, XElement LOGXML = null)
 {
     try
     {
         xdoc = DBXML.COUNTRYMAST_g(COUNTRYID, COUNTRCODE, COUNTRNAME, USERID, LOGXML);
         DataTable dt       = SqlExe.GetDT(xdoc);
         var       dbResult = (from row in dt.AsEnumerable()
                               select new
         {
             id = row.Field <int>("COUNTRYID"),
             text = row.Field <string>("COUNTRYNAME")
         }).ToList();
         return(dbResult);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 2
0
        public List <COUNTRYMAST> getCountry(int COUNTRYID, string COUNTRCODE, string COUNTRNAME, string DESC, int USERID, XElement LOGXML = null)
        {
            try
            {
                xdoc = DBXML.COUNTRYMAST_g(COUNTRYID, COUNTRCODE, COUNTRNAME, USERID, LOGXML);
                DataTable          dt       = SqlExe.GetDT(xdoc);
                List <COUNTRYMAST> dbresult = dt != null ?
                                              (from s in dt.AsEnumerable()
                                               select new COUNTRYMAST
                {
                    COUNTRYID = s.Field <int>("COUNTRYID"),
                    COUNTRYNAME = s.Field <string>("COUNTRYNAME"),
                    COUNTRYCODE = s.Field <string>("COUNTRYCODE"),
                    SHORTNAME = s.Field <string>("SHORTNAME"),
                    ISACTIVE = s.Field <bool>("ISACTIVE")
                }).ToList() : null;

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