Esempio n. 1
0
        public void GetStates()
        {
            Error = "";
            var result = new ObjectParameter("Result", typeof(Int32));
            var tranDt = new ObjectParameter("TranDT", typeof(DateTime));

            StatesList.Clear();
            StatesList.Add("");
            try
            {
                using (var context = new QuoteLogContext())
                {
                    var collection = context.usp_QT_Customer_States_Get();
                    foreach (var item in collection)
                    {
                        StatesList.Add(item.Abbreviation);
                    }

                    _view.cbxState.DataSource = StatesList;
                }
            }
            catch (Exception ex)
            {
                Error = (ex.InnerException != null)
                    ? "Failed to return states. " + ex.InnerException.Message
                    : "Failed to return states. " + ex.Message;
            }
        }