コード例 #1
0
        public DataSet getStates(int CountryId)
        {
            ShopingDataContext context = new ShopingDataContext();
            var datset = context.ExecuteDataSet(getState, BuildStatePrams(CountryId));

            return(datset);
        }
コード例 #2
0
        public DataSet getCountrys()
        {
            ShopingDataContext context = new ShopingDataContext();
            var datset = context.ExecuteDataSetwithOutParameter(cmdCountry);

            return(datset);
        }
コード例 #3
0
        public List <Customer> getAllCustomer()
        {
            ShopingDataContext context = new ShopingDataContext();
            var details = context.ExecuteDataSet(spGetCustomers, BuildCustomerparams(0));

            return(HarnessUtilitys.ConvertDataTable <Customer>(details.Tables[0]));
        }
コード例 #4
0
        public int Create(Customer cust)
        {
            ShopingDataContext context = new ShopingDataContext();
            var res = Convert.ToInt32(context.executeScaler <decimal>(CreateOrUpdateSP, customerParamsBuilder(cust)));

            return(res);
        }
コード例 #5
0
        public Customer GetCustomer(int Id)
        {
            ShopingDataContext context = new ShopingDataContext();
            var details = context.executeDataReadar(spGetCustomers, BuildCustomerparams(Id));

            details.Read();
            Customer cus = new Customer()
            {
                Id        = Convert.ToInt32(details["Id"]),
                FirstName = Convert.ToString(details["FirstName"]),
                LastName  = Convert.ToString(details["LastName"]),
                City      = Convert.ToString(details["City"]),
                Country   = Convert.ToString(details["Country"]),
                Phone     = Convert.ToString(details["Phone"])
            };

            details.Close();
            return(cus);
        }