示例#1
0
        public SerialViewModel SearchSerial(SerialViewModel model)
        {
            PetaPoco.Database db    = null;
            var             dbConn  = DataContext.Database.Connection;
            SerialViewModel Details = new SerialViewModel();

            try
            {
                using (DataContext)
                {
                    dbConn.Open();
                    db = new PetaPoco.Database(dbConn);
                    db.EnableAutoSelect = false;
                    Details.SerialList  = db.Query <Serial>("exec usp_SearchSerial ",
                                                            new { }).ToList();
                    dbConn.Close();
                }
            }
            catch (Exception ex)
            {
                throw;
            }

            finally
            {
                if (dbConn != null)
                {
                    dbConn.Close();
                }
            }
            return(Details);
        }
        public SerialView()
        {
            InitializeComponent();
            SerialViewModel svm = new SerialViewModel();

            this.DataContext = svm;

            svm.SetAutoscroll = setAutoScroll;
        }
示例#3
0
        public ActionResult ManageComplain(SerialViewModel Model)
        {
            PDService service = new PDService();

            //Model = service.SearchSerial(Model);


            return(View("ManageComplain", Model));
        }
示例#4
0
        public ActionResult ManageSerial(SerialViewModel Model)
        {
            PDService service = new PDService();

            Model = service.SearchSerial(Model);

            if (Request.IsAjaxRequest())
            {
                return(PartialView("_SerialGrid", Model.SerialList));
            }
            return(View("ManageSerial", Model));
        }
        public SerialViewModel SearchSerial(SerialViewModel model)
        {
            SerialViewModel Details = new SerialViewModel();

            try
            {
                Details = _repository.SearchSerial(model);
            }

            catch (Exception ex)
            {
                throw;
            }

            return(Details);
        }
示例#6
0
        public async Task <ProdutoViewModel> InsereSeriail(SerialViewModel serialViewModel)
        {
            var serial = _mapper.Map <Serial>(serialViewModel);

            _repositorio.AddSerial(serial);
            await _uow.Commit();

            var produtoPersistido = await _repositorio.GetById(serialViewModel.IdProduto);

            if (produtoPersistido == null)
            {
                return(new ProdutoViewModel());
            }

            return(_mapper.Map <ProdutoViewModel>(produtoPersistido));
        }
示例#7
0
 public SerialPage()
 {
     InitializeComponent();
     Title = "Serial";
     Title = "OPM Settings";
     vm    = (SerialViewModel)BindingContext;
     vm.BaudRatePickerSource.Add("110");
     vm.BaudRatePickerSource.Add("300");
     vm.BaudRatePickerSource.Add("600");
     vm.BaudRatePickerSource.Add("1200");
     vm.BaudRatePickerSource.Add("2400");
     vm.BaudRatePickerSource.Add("4800");
     vm.BaudRatePickerSource.Add("9600");
     vm.BaudRatePickerSource.Add("14400");
     vm.BaudRatePickerSource.Add("19200");
     vm.BaudRatePickerSource.Add("38400");
     vm.BaudRatePickerSource.Add("57600");
     vm.BaudRatePickerSource.Add("115200");
     vm.BaudRatePickerSource.Add("230400");
     vm.BaudRatePickerSource.Add("460800");
     vm.BaudRatePickerSource.Add("921600");
     vm.DataBitsPickerSource.Add("7");
     vm.DataBitsPickerSource.Add("8");
     vm.ParityPickerSource.Add("None");
     vm.ParityPickerSource.Add("Odd");
     vm.ParityPickerSource.Add("Even");
     vm.ParityPickerSource.Add("Mark");
     vm.ParityPickerSource.Add("Space");
     vm.StopBitsPickerSource.Add("1");
     vm.StopBitsPickerSource.Add("1.5");
     vm.StopBitsPickerSource.Add("2");
     BaudRatePicker.SelectedIndex = 0;
     StopBitsPicker.SelectedIndex = 0;
     ParityPicker.SelectedIndex   = 0;
     DataBitsPicker.SelectedIndex = 0;
 }
示例#8
0
        public async Task <ActionResult <ProdutoViewModel> > Post(SerialViewModel serialViewModel)
        {
            var produtoViewModel = await _produtoService.InsereSeriail(serialViewModel);

            return(produtoViewModel);
        }