public ActionResult Criar([Bind(Include = "Nome,Descricao,TipoServicoRelacao,TipoServicoInerente,Ordem")] ServicoEditModel model) { if (ModelState.IsValid) { try { var servico = new Servico { Nome = model.Nome, Descricao = model.Descricao, Ordem = model.Ordem, TipoServicoInerente = model.TipoServicoInerente, TipoServicoRelacao = model.TipoServicoRelacao }; _servicoTipoServico.Criar(servico); Success(Alerts.Success, true); return RedirectToAction("Index"); } catch (Exception exception) { Erro(Alerts.Erro, true, exception); } } return View(model); }
public static void Servico(ServicoDTO servico) { var rep = new DAL.Repositories.Repositorio<Servico>(); //var novoServico = Mapper.Map<ServicoDTO, Servico>(servico); Servico novoServico = new Servico(); novoServico.ID_Empresa = servico.ID_Empresa; novoServico.ID_Categoria_Servico = servico.ID_Categoria_Servico; novoServico.Nome = servico.Nome; novoServico.ISS = servico.ISS; novoServico.ICMS = servico.ICMS; novoServico.IVA = servico.IVA; novoServico.ST = servico.ST; novoServico.PIS = servico.PIS; novoServico.COFINS = servico.COFINS; novoServico.valor = servico.valor; novoServico.custo = servico.custo; rep.Cadastrar(novoServico); }
//public UserDataEntity() //{ // IdClienteAtual = 0; // ClienteAtual = new Cliente(); // ServicoAtual = new Servico(); // UsuarioAtual = new Usuario(); // UrlCSSClienteAtual = "./assets/themes/tecfort-theme.css"; //} public UserDataEntity(int idClienteAtual, Cliente clienteAtual, Servico servicoAtual, Usuario usuarioAtual,string urlCSSClienteAtual) { this.IdClienteAtual = idClienteAtual; this.ClienteAtual = clienteAtual; this.UrlCSSClienteAtual = urlCSSClienteAtual; this.ServicoAtual = servicoAtual; this.UsuarioAtual = usuarioAtual; }
/// <summary> /// Finalizando Ordem de serviço (Botão). /// </summary> private void finalizarToolStripMenuItem_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Txt_OS.Text)) { OrdemServico OSbase = new OrdemServico(); Servico ServicoBase = new Servico(); ControllerOrdemServico controllerOS = new ControllerOrdemServico(); ControllerServico controllerServico = new ControllerServico(); ControllerEmail controllerEmail = new ControllerEmail(); bool Resultado = false; if (controllerOS.Verificar(Txt_OS.Text))//Verifica se a OS existe ou não { Resultado = controllerOS.FinalizarOS(Txt_OS.Text); if (Resultado) { MessageBox.Show("Ordem de serviço Finalizada com sucesso!", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Ocorreu um problema ao finalizar sua Ordem de serviço, informações foram salvas no arquivo log no diretorio do sue software", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } //Gerando o serviço controllerServico.Save(Txt_Descricao.Text, double.Parse(Txt_Valor.Text), Txt_OS.Text); if (MessageBox.Show("Enviar E-mail para o cliente informando sobre o término do serviço?", "Pergunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { Model.Email EmailBase = new Model.Email(); //Decodificando Email Base para enviar! String EmailDecoficado = controllerEmail.DecodificarEmailBase(RecuperandoEmailBase(), NomeEmpresa(), InformacaoCliente()[0]); string ResultadoEnvio = controllerEmail.Enviar(InformacaoCliente()[0], InformacaoCliente()[1], NomeEmpresa(), EmailDecoficado); MessageBox.Show(ResultadoEnvio, "Informação", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } else { MessageBox.Show("Informe o numero da ordem de serviço!", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
static void Main(string[] args) { try { Console.WriteLine("Iniciando Chamada ao serviço ...\n"); var servico = new Servico(); Console.WriteLine("Listando Andares...\n"); dtoAndar[] listaAndares = servico.ListarAndares(); foreach (var andar in listaAndares) { Console.WriteLine(string.Format("Andar: {0} [ Id={1}, Quantidade de Vagas={2}, Vagas Livres={3} ]", andar.Nome, andar.Id.ToString(), andar.QtdVagas, andar.QtdLive)); } Console.WriteLine(); dtoAndar A1 = listaAndares.First(); Console.WriteLine("Listando Blocos do andar " + A1.Nome + "...\n"); dtoBloco[] listaBlocos = servico.ListarBlocos(A1.Id, true); foreach (var bloco in listaBlocos) { Console.WriteLine(string.Format("Bloco: {0} [ Id={1}, Quantidade de Vagas={2}, Vagas Livres={3} ]", bloco.Nome, bloco.Id.ToString(), bloco.QtdVagas, bloco.QtdLive)); } Console.WriteLine(); dtoBloco B1 = listaBlocos.First(); Console.WriteLine("Listando vagas do bloco " + B1.Nome + "...\n"); dtoVaga[] listaVagas = servico.ListarVagas(B1.Id, true); foreach (var vaga in listaVagas) { Console.WriteLine(string.Format("Vaga: {0} [ Id={1}, Livre={2} ]", vaga.Nome, vaga.Id.ToString(), vaga.Disponivel.ToString())); } Console.WriteLine(); string CPF = "753.618.942-73"; Console.WriteLine("Listando Carros do cliente de CPF " + CPF + "...\n"); dtoCarro[] listaCarros = servico.ListarCarros(CPF); foreach (var carro in listaCarros) { Console.WriteLine(string.Format("Carro: [ Id={0}, Marca={1}, Placa={2} ]", carro.Id, carro.Marca, carro.Placa)); } Console.WriteLine(); dtoVaga V1 = listaVagas.First(); dtoCarro C1 = listaCarros.First(); Console.WriteLine("Reservando a primeira vaga...\n"); bool concluidoComSucesso, resultSpecified; servico.ReservarVaga(V1.Id, true, C1.Id, true, out concluidoComSucesso, out resultSpecified); if (concluidoComSucesso) { Console.WriteLine("Reserva feita com sucesso...\n"); } Console.WriteLine("Listando vagas do bloco " + B1.Nome + "...\n"); listaVagas = servico.ListarVagas(B1.Id, true); foreach (var vaga in listaVagas) { Console.WriteLine(string.Format("Vaga: {0} [ Id={1}, Livre={2} ]", vaga.Nome, vaga.Id.ToString(), vaga.Disponivel.ToString())); } Console.WriteLine(); Console.WriteLine("Fim do método!"); } catch (Exception ex) { Console.WriteLine("ERRO: " + ex.Message); } Console.ReadLine(); }
public ProdutoModelView GetProdutoPorCodigoBarras(long codigoBarras) { return(new ProdutoModelView(Servico.BuscarPor(x => x.CodigoBarras == codigoBarras).FirstOrDefault())); }
public List <Produto> GetProdutosPorDepartamento(int departamentoId, int lojaId, int inicio, int quantidade) { return(Servico.GetProdutosPorDepartamento(departamentoId, lojaId).Skip(inicio).Take(quantidade).ToList()); }
public CRUDView(Servico servico, string title) : this() { this.crudViewModel = new CRUDViewModel(servico); this.BindingContext = this.crudViewModel; this.Title = title; }
public void PopularCandidaturas(Servico servicoSolicitado) { string connectionString; StringBuilder query = null; SqlConnection connection = null; SqlCommand command = null; SqlDataReader dataReader = null; Candidatura candidatura = null; UsuarioProfissional candidato = null; try { servicoSolicitado.Candidaturas = new List <Candidatura>(); query = new StringBuilder(); query.Append("SELECT "); query.Append(" C.Id, "); query.Append(" C.IdCandidato, "); query.Append(" C.Mensagem, "); query.Append(" C.DataHoraCandidatura, "); query.Append(" C.IdServicoCandidatado, "); query.Append(" U.Nome AS NomeCandidato, "); query.Append(" U.NumeroCelular AS CelularCandidato, "); query.Append(" U.DataHoraCadastro AS DataHoraCadastroCandidato, "); query.Append(" U.Email AS EmailCandidato, "); query.Append(" UPR.Resumo AS ResumoCandidato, "); query.Append(" UPR.IdEstado AS IdEstadoCandidato, "); query.Append(" UPR.IdMunicipio AS IdMunicipioCandidato "); query.Append("FROM Candidaturas C "); query.Append(" INNER JOIN Usuarios U ON C.IdCandidato = U.Id "); query.Append(" INNER JOIN UsuariosProfissionais UPR ON C.IdCandidato = UPR.Id "); query.Append("WHERE C.IdServicoCandidatado = @IdServicoCandidatado"); connectionString = WebConfigurationManager.ConnectionStrings["ConnectionEstudo"].ConnectionString; using (connection = new SqlConnection(connectionString)) { using (command = connection.CreateCommand()) { command.CommandType = CommandType.Text; command.CommandText = query.ToString(); command.Parameters.AddWithValue("@IdServicoCandidatado", servicoSolicitado.Id); connection.Open(); using (dataReader = command.ExecuteReader()) { while (dataReader.Read()) { candidatura = new Candidatura(); candidatura.Id = (int)dataReader["Id"]; candidatura.Mensagem = dataReader["Mensagem"].ToString(); candidatura.DataHoraCandidatura = (DateTime)dataReader["DataHoraCandidatura"]; candidato = new UsuarioProfissional(); candidato.Id = (int)dataReader["IdCandidato"]; candidato.Nome = dataReader["NomeCandidato"].ToString(); candidato.NumeroCelular = dataReader["CelularCandidato"].ToString(); candidato.DataHoraCadastro = (DateTime)dataReader["DataHoraCadastroCandidato"]; candidato.Email = dataReader["EmailCandidato"].ToString(); candidato.Resumo = dataReader["ResumoCandidato"].ToString(); candidatura.ServicoCandidatado = servicoSolicitado; candidatura.Candidato = candidato; servicoSolicitado.Candidaturas.Add(candidatura); } } } } } finally { if (query != null) { query = null; } if (candidatura != null) { candidatura = null; } if (candidato != null) { candidato = null; } } }
public ManterEspecialidadeDAO(Especialidade ObjEspec, Servico ObjServ) { this.ObjEspec = ObjEspec; this.ObjServ = ObjServ; }
public static void Alterar(Servico s) { _context.Servicos.Update(s); _context.SaveChanges(); }
public void Excluir(Servico Servico) { }
public void Alterar(Servico Servico) { }
public void Consultar(Servico Servico) { }
public void Incluir(Servico Servico) { }
public new void Salvar(Usuario entity) { Servico.Salvar(entity); }
public ActionResult RequisitarServico(string cp, string rua, int?nrPorta, string apartamento) { FuncionarioController funcC = new FuncionarioController(); var id_Pack = Helpers.CacheController.id_Pack; var data = Helpers.CacheController.Data; var servs = from m in db.Servico select m; int lengthS = servs.ToList <Servico>().Count; lengthS += 1; var fatur = from m in db.Fatura select m; int lengthF = fatur.ToList <Fatura>().Count; lengthF += 1; string estado = "Agendado"; int idCliente = Int32.Parse(User.Identity.Name); var pack = (from m in db.Pack where m.Id == id_Pack select m).First(); decimal precoAux = pack.Preco; var localidade = (from m in db.CP_Localidade where m.Id == cp select m).ToList().FirstOrDefault(); var cliente = (from c in db.Cliente where c.Id == idCliente select c).ToList().FirstOrDefault(); Fatura fact = new Fatura() { Id = lengthF, Apartamento = apartamento, CP = cp, CP_Localidade = localidade, Data = data, Id_Pack = id_Pack, Localidade = localidade.Localidade, NIF = cliente.Id, Nome_Cliente = cliente.Nome, Nome_Pack = pack.Nome, Nr = nrPorta.Value, Preco = pack.Preco, Rua = rua, Servico = servs.Where(x => x.Id_Pack == id_Pack && (DbFunctions.TruncateTime(x.DataHora) == DbFunctions.TruncateTime(data))).ToList() }; string comentario = ""; Servico serv = new Servico(lengthS, data, precoAux, estado, apartamento, cp, rua, nrPorta.Value, idCliente, id_Pack, lengthF, comentario); if (ModelState.IsValid) { db.Fatura.Add(fact); db.SaveChanges(); db.Servico.Add(serv); db.SaveChanges(); funcC.AlocarFuncionarios(lengthS); } ViewBag.Message = "Serviço Registado Com Sucesso"; ///////////////////////////////////////////Geração de Email com confirmação do serviço////////////////////////////////////////////////////////// string emailC = cliente.Email; string nomeP = pack.Nome; string loc = localidade.Localidade; Helpers.GeradorFaturas.ConfirmarServicoEmail(emailC, precoAux, data, nomeP, rua, loc, cp); ///////////////////////////////////////////////////////////////////////////////////////////////////// return(RedirectToAction("Index", "Cliente")); }
public void Ao_Movimentar_Um_Item_Deve_Calcular_O_Desconto_E_O_Acrescimo_Pelo_Percentual_Da_Forma_De_Pagamento() { // Primeiro testo uma forma de pagamento que não tem nenhum percentual. Nem de acréscimo nem de desconto. var formaPagamentoSemDescontoSemAcrescimo = new Mock <FormaPagamento>(); formaPagamentoSemDescontoSemAcrescimo.Setup(f => f.Id) .Returns(1); formaPagamentoSemDescontoSemAcrescimo.Setup(f => f.PercentualAcrescimo) .Returns(0); formaPagamentoSemDescontoSemAcrescimo.Setup(f => f.PercentualDesconto) .Returns(0); Servico servico1 = ServicoStub.GetInstance(1, "serviço 1", 1); Servico servico2 = ServicoStub.GetInstance(2, "serviço 2", 2); Atendimento atendimento = new Atendimento(DateTime.Now, this._empresaValida, this._clienteValido, formaPagamentoSemDescontoSemAcrescimo.Object); atendimento.AdicionarItem(servico1, 10.50m, 3); Assert.AreEqual(0, atendimento.AcrescimoFormaPagamento); Assert.AreEqual(0, atendimento.DescontoFormaPagamento); atendimento.AdicionarItem(servico2, 22m, 7); Assert.AreEqual(0, atendimento.AcrescimoFormaPagamento); Assert.AreEqual(0, atendimento.DescontoFormaPagamento); atendimento.AdicionarItem(servico1, 11m, 4); Assert.AreEqual(0, atendimento.AcrescimoFormaPagamento); Assert.AreEqual(0, atendimento.DescontoFormaPagamento); // Depois testo em uma forma de pagamento que tem percentual de acréscimo e de desconto var formaPagamento = new Mock <FormaPagamento>(); formaPagamento.Setup(f => f.Id) .Returns(1); formaPagamento.Setup(f => f.PercentualAcrescimo) .Returns(10); formaPagamento.Setup(f => f.PercentualDesconto) .Returns(20); atendimento = new Atendimento(DateTime.Now, this._empresaValida, this._clienteValido, formaPagamento.Object); atendimento.AdicionarItem(servico1, 10, 3); // 30 Assert.AreEqual(3m, atendimento.AcrescimoFormaPagamento); Assert.AreEqual(6m, atendimento.DescontoFormaPagamento); atendimento.AdicionarItem(servico2, 22m, 7); // 154 184 Assert.AreEqual(18.4m, atendimento.AcrescimoFormaPagamento); Assert.AreEqual(36.8m, atendimento.DescontoFormaPagamento); atendimento.RemoverItem(servico2); // 154 30 Assert.AreEqual(3m, atendimento.AcrescimoFormaPagamento); Assert.AreEqual(6m, atendimento.DescontoFormaPagamento); atendimento.AdicionarItem(servico1, 11m, 4); // 44 Assert.AreEqual(4.4m, atendimento.AcrescimoFormaPagamento); Assert.AreEqual(8.8m, atendimento.DescontoFormaPagamento); atendimento.AdicionarItem(servico2, 1m, 10); // 10 54 Assert.AreEqual(5.4m, atendimento.AcrescimoFormaPagamento); Assert.AreEqual(10.8m, atendimento.DescontoFormaPagamento); }
public static bool ExcluirServico(Servico s) { ctx.Servicos.Remove(s); ctx.SaveChanges(); return(true); }
public void Add(Servico servico) { db.Servicos.Add(servico); db.SaveChanges(); }
public async Task <ActionResult> Post([FromBody] Servico servico) { var created = await _servicoService.CreateAsync(servico); return(CreatedAtAction(nameof(Post), new { id = servico.ServicoId }, created)); }
public IEnumerable <LojaViewModel> Listar() { return(Servico.Buscar().Select(x => new LojaViewModel(x)).ToList()); }
public static List <Postagem> ListaDePostagem(string path, Form1 frm) { #region Recupera a formatação da planilha do Settings.settings List <FormatacaoPlanilha> lFormatacao = new List <FormatacaoPlanilha>(); lFormatacao = FormatacaoPlanilha.ListarFormatacao(); #endregion List <Postagem> lVipp = new List <Postagem>(); Excel.Application xlsAPP = new Excel.Application(); int cont = 0; try { Excel.Workbook xlsWorkbook = xlsAPP.Workbooks.Open(path, 0, true, 5, "", "", true, Excel.XlPlatform.xlWindows, "", false, false, 0, false, false, false); Excel.Sheets xlsSheets = xlsWorkbook.Worksheets; //For que acessa todas as planilhas foreach (Excel.Worksheet xlsWorksheet in xlsSheets) { //Acessa a aba da Planilha com o nome "Control Respuesta". if (xlsWorksheet.Index == 1) { Excel.Range xlsWorksRows = xlsWorksheet.Rows; //for do Numero de linhas foreach (Excel.Range xlsWorkCell in xlsWorksRows) { Destinatario oDestinatario = new Destinatario(); Servico oServico = new Servico(); WSVIPP.VolumeObjeto[] oVolumeObjetos = new WSVIPP.VolumeObjeto[] { new WSVIPP.VolumeObjeto() }; ItemConteudo[] oItemConteudos; DeclaracaoConteudo[] oDeclaracaoConteudos = new DeclaracaoConteudo[] { new DeclaracaoConteudo() }; Excel.Range xlsCell = xlsWorkCell.Cells; int quantidade = 0; #region Lista de Formatação //For para percorrer a lista de Formatação foreach (FormatacaoPlanilha list in lFormatacao) { String atributo = list.NomeAtributo; int coluna = list.Coluna; Excel.Range AtributoValor = xlsCell.Item[coluna]; string valor = AtributoValor.Text; if (atributo.Equals("UF")) { oDestinatario.UF = valor; } if (atributo.Equals("Destinatario")) { oDestinatario.Nome = valor; } else if (atributo.Equals("Endereco")) { oDestinatario.Endereco = valor; } else if (atributo.Equals("Numero")) { oDestinatario.Numero = valor; } else if (atributo.Equals("Bairro")) { oDestinatario.Bairro = valor; } else if (atributo.Equals("Cidade")) { oDestinatario.Cidade = valor; } else if (atributo.Equals("CEP")) { oDestinatario.Cep = valor; } else if (atributo.Equals("Complemento")) { oDestinatario.Complemento = valor; } else if (atributo.Equals("Conteudo")) { ItemConteudo oItemConteudo = new ItemConteudo() { DescricaoConteudo = valor, Quantidade = 1, Valor = "0,00" }; oItemConteudos = new ItemConteudo[] { oItemConteudo }; oVolumeObjetos[0].DeclaracaoConteudo = new DeclaracaoConteudo() { ItemConteudo = oItemConteudos, PesoTotal = 10 }; } else if (atributo.Equals("Observacao1")) { WSVIPP.VolumeObjeto oVolumeObjeto = new WSVIPP.VolumeObjeto { CodigoBarraVolume = valor }; oVolumeObjetos[0].CodigoBarraVolume = oVolumeObjeto.CodigoBarraVolume; } else if (atributo.Equals("Email")) { } else if (atributo.Equals("Quantidade")) { try { quantidade = int.Parse(valor); } catch (System.FormatException) { quantidade = 0; } } else if (atributo.Equals("DocumentoDestinatario")) { oVolumeObjetos[0].DeclaracaoConteudo.DocumentoDestinatario = valor; } else if (atributo.Equals("Servico")) { string servico = valor; if (valor.Equals("PAC")) { oServico.ServicoECT = "4669"; } else if (valor.Equals("SEDEX")) { oServico.ServicoECT = "4162"; } else { oServico.ServicoECT = valor; } } }//fim do For da Lista de Formatacao #endregion Postagem oPostagem = new Postagem() { Destinatario = oDestinatario, Volumes = oVolumeObjetos, Servico = oServico }; Postagem oPostagemExistente = (from o in lVipp where o.Volumes[0].CodigoBarraVolume.Equals( oPostagem.Volumes[0].CodigoBarraVolume) select o).FirstOrDefault(); if (oPostagemExistente == null) { lVipp.Add(oPostagem); cont++; frm.labelProgresso.Text = "Processando o item " + cont + " da lista"; } else { ItemConteudo[] x = oPostagemExistente.Volumes[0].DeclaracaoConteudo.ItemConteudo; Array.Resize(ref x, x.Length + 1); x[x.Length - 1] = oPostagem.Volumes[0].DeclaracaoConteudo.ItemConteudo[0]; oPostagemExistente.Volumes[0].DeclaracaoConteudo.ItemConteudo = x; } if (oPostagem.Destinatario.Nome.Equals(string.Empty)) { break; } } // fim do for que acessa as linhas } // fim do if q acessa a aba da Planilha com o nome "Control Respuesta". } // fim do For que acessa todas as planilhas } catch (Exception) { MessageBox.Show("Ocorreu um erro com o arquivo, o mesmo é invalido ou está mal formatado", "Erro", MessageBoxButton.OK, MessageBoxImage.Exclamation); } finally { GC.Collect(); } xlsAPP.Quit(); return(lVipp); }
public void Inserir(Servico servico) { _repositorio.Inserir(servico); }
public IActionResult Create(Servico Servico) { _ServicoService.Insert(Servico); return(RedirectToAction(nameof(Index))); }
public void Editar(Servico servico) { _repositorio.Editar(servico); }
public CRUDView(Servico servico, ObservableCollection <Servico> servicos) : this() { this.crudViewModel = new CRUDViewModel(servico, servicos); this.BindingContext = this.crudViewModel; this.Title = "Consulta Serviço"; }
public void Deletar(Servico servico) { _repositorio.Deletar(servico); }
public List <Produto> GetProdutosPorCategoria(int categoriaId, int lojaId, int inicio, int quantidade) { return(Servico.GetProdutosPorCategoria(categoriaId, lojaId).Skip(inicio).Take(quantidade).ToList()); }
public Servico recuperar(Servico servico) { return(_repositorio.Recuperar(servico)); }
public IEnumerable <Veiculo> BuscarVeiculosPorUsuario(int usuarioId) { return(Servico.BuscarPor(x => (x.Proprietario.Id == usuarioId || x.OutrosProprietarios.Count(y => y.Id == usuarioId) > 0)).Where(x => x.GetType() == typeof(Veiculo))); }
private void grvOrdem_CellValueChanged(object sender, DataGridViewCellEventArgs e) { string pecaouserv = ""; if (grvOrdem.Rows[e.RowIndex].Cells[0].Value.ToString() == "S" || grvOrdem.Rows[e.RowIndex].Cells[0].Value.ToString() == "s") { pecaouserv = "serv"; } else if (grvOrdem.Rows[e.RowIndex].Cells[0].Value.ToString() == "P" || grvOrdem.Rows[e.RowIndex].Cells[0].Value.ToString() == "p") { pecaouserv = "peca"; } if (grvOrdem.Rows[e.RowIndex].Cells[1].Value.ToString() != "0" && e.ColumnIndex == 1) { if (pecaouserv == "serv") { try { Servico obterServico = servicoController.Obter(Convert.ToInt32(grvOrdem.Rows[rowindex].Cells[1].Value)); listaServico.Add(obterServico); DataRow novatupla = DT.NewRow(); novatupla["ID"] = obterServico.ServicoId; novatupla["Quantidade"] = 1; novatupla["Valor"] = obterServico.Valor; //novatupla["Nome"] = obterServico.Nome; não tem no banco DT.Rows.Add(novatupla); grvOrdem.ClearSelection(); grvOrdem.DataSource = DT; grvOrdem.Rows[0].Cells[1].Value = 0; } catch (Exception) { MessageBox.Show("Serviço não cadastrado"); } } if (pecaouserv == "peca") { try { Peca obterPeca = pecaController.Obter(Convert.ToInt32(grvOrdem.Rows[rowindex].Cells[1].Value)); listaPeca.Add(obterPeca); DataRow novatupla = DT.NewRow(); novatupla["ID"] = obterPeca.PecaId; novatupla["Quantidade"] = 1; novatupla["Valor"] = 0; //obterPeca.Valor; não tem valor no banco novatupla["Nome"] = obterPeca.Nome; DT.Rows.Add(novatupla); grvOrdem.ClearSelection(); grvOrdem.DataSource = DT; grvOrdem.Rows[0].Cells[1].Value = 0; } catch (Exception) { MessageBox.Show("Peça não cadastrada"); } } else { } } atualizarValor(); }
/// <summary> /// Finalizando ordem de serviço(Mudando o Status da OS), e criando um novo serviço. /// </summary> /// <returns>The O.</returns> public static string FinalizarOS(Servico InformacoesDoServico) { Spartacus.Database.Generic database; Spartacus.Database.Command cmd = new Spartacus.Database.Command(); cmd.v_text = "update OrdemDeServico set Situacao = #situacao# where ID = #id#"; cmd.AddParameter("situacao", Spartacus.Database.Type.STRING); cmd.AddParameter("id", Spartacus.Database.Type.INTEGER); cmd.SetValue("situacao", "Finalizado"); cmd.SetValue("id", InformacoesDoServico.IdOrdemDeServico.ToString()); try { database = new Spartacus.Database.Sqlite(DB.GetStrConection()); database.Execute(cmd.GetUpdatedText()); ControllerServico.Criar(InformacoesDoServico);//Gerar um trabalho, após ter alterado as informações da OS. return "A Ordem de serviço foi finalizda com sucesso."; } catch (Spartacus.Database.Exception ex) { ControllerArquivoLog.GeraraLog(ex); return String.Format("Ocorreu um erro ao tentar finalizar a OS: {0}", ex.Message); } }
public void Register(Servico service) { BeginTrasaction(); Commit(); }
// GET api/<controller>/5 public IEnumerable <Servico> Get(long id) { var toReturn = new Servico().Get(DbConnection.GetInstance(), id); return(toReturn); }
public static Servico ValorServico(Servico s) { return(ctx.Servicos.FirstOrDefault(x => x.PrecoServico == s.PrecoServico)); }
public BaseInformation() { vistoria = StaticData.vistoriaAtual; service = new Servico(); }
public static bool Cadastrar(Servico s) { _context.Servicos.Add(s); _context.SaveChanges(); return(true); }