Esempio n. 1
0
        public DataSet getStates(int CountryId)
        {
            ShopingDataContext context = new ShopingDataContext();
            var datset = context.ExecuteDataSet(getState, BuildStatePrams(CountryId));

            return(datset);
        }
Esempio n. 2
0
        public DataSet getCountrys()
        {
            ShopingDataContext context = new ShopingDataContext();
            var datset = context.ExecuteDataSetwithOutParameter(cmdCountry);

            return(datset);
        }
Esempio n. 3
0
        public List <Customer> getAllCustomer()
        {
            ShopingDataContext context = new ShopingDataContext();
            var details = context.ExecuteDataSet(spGetCustomers, BuildCustomerparams(0));

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

            return(res);
        }
Esempio n. 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);
        }