private void TFPainelMudanca_Load(object sender, EventArgs e) { this.Icon = Utils.ResourcesUtils.TecnoAliance_ICO; //Buscar CFG Mudanca lCfg = CamadaNegocio.Mudanca.Cadastros.TCN_CFGMudanca.buscar(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, null); //Image imagem = null; //byte[] img = CamadaNegocio.ConfigGer.TCN_CadParamGer.BuscaVlImagem("IMAGEM_RELATORIO", lCfg[0].Cd_empresa, null); //if (img != null) //{ // System.IO.MemoryStream ms = new System.IO.MemoryStream(); // ms.Write(img, 0, img.Length); // imagem = Image.FromStream(ms); // pLogo.BackgroundImage = imagem; //} tcPainel.TabPages.Remove(tpMes); cbxAno.SelectedItem = DateTime.Now.Year; for (int i = 0; lista.Count() > i; i++) { lista[i] = new ListBox(); } //Buscar Veiculos CamadaDados.Frota.Cadastros.TList_CadVeiculo lVeic = new CamadaDados.Frota.Cadastros.TCD_CadVeiculo().Select( new Utils.TpBusca[] { new Utils.TpBusca() { vNM_Campo = "isnull(a.st_registro, 'A')", vOperador = "<>", vVL_Busca = "'I'" } }, 0, string.Empty); if (lVeic.Count > 0) { lVeic.ForEach(p => { this.NewListBox(p.placa, new EventArgs()); }); } }
public static void GerarPedidoMudanca(ref CamadaDados.Faturamento.Pedido.TRegistro_Pedido rPed, CamadaDados.Mudanca.TRegistro_LanMudanca rMudanca, decimal valor, CamadaDados.Mudanca.Cadastros.TList_CFGMudanca lCfg) { if (!string.IsNullOrEmpty(lCfg[0].CFG_PedServico)) { if (rPed == null) { rPed = new CamadaDados.Faturamento.Pedido.TRegistro_Pedido(); rPed.CD_Empresa = rMudanca != null ? rMudanca.Cd_empresa : string.Empty; rPed.DT_Pedido = DateTime.Now; rPed.CFG_Pedido = lCfg[0].CFG_PedServico; rPed.TP_Movimento = "S"; //Pedido de saida rPed.ST_Pedido = "F"; //Pedido fechado rPed.ST_Registro = "F"; //Pedido fechado rPed.CD_Clifor = rMudanca != null ? rMudanca.Cd_clifor : string.Empty; rPed.CD_Endereco = rMudanca != null ? rMudanca.Cd_endereco : string.Empty; CamadaDados.Faturamento.Pedido.TRegistro_LanPedido_Item reg = new CamadaDados.Faturamento.Pedido.TRegistro_LanPedido_Item(); reg.Cd_Empresa = rMudanca.Cd_empresa; reg.Cd_local = "000001"; reg.Cd_produto = lCfg[0].CD_ServPadrao; reg.Ds_produto = lCfg[0].DS_ServPadrao; reg.Quantidade = 1; reg.Vl_unitario = valor; reg.Vl_subtotal = valor; reg.Tp_pedOS = "SV"; rPed.Pedido_Itens.Add(reg); } } else { throw new Exception("Não existe configuracao para emitir pedido de serviço para mudança!"); } }