public void VaraIsGivenBooleanInputs() { var function = new Vara(); var boolInputTrue = true; var boolInputFalse = false; var result1 = function.Execute(FunctionsHelper.CreateArgs(boolInputTrue, boolInputTrue, boolInputFalse), this.ParsingContext); var result2 = function.Execute(FunctionsHelper.CreateArgs(boolInputTrue, boolInputTrue, boolInputTrue), this.ParsingContext); var result3 = function.Execute(FunctionsHelper.CreateArgs(boolInputTrue, boolInputFalse, boolInputFalse), this.ParsingContext); Assert.AreEqual(0.333333333, result1.ResultNumeric, .00001); Assert.AreEqual(0, result2.ResultNumeric, .00001); Assert.AreEqual(0.333333333, result3.ResultNumeric, .00001); }
// GET: Vara/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Vara vara = db.Varas.Find(id); if (vara == null) { return(HttpNotFound()); } return(View(vara)); }
public void VaraIsGivenStringsAsInputsByCellRange() { var function = new Vara(); using (var package = new ExcelPackage()) { var worksheet = package.Workbook.Worksheets.Add("Sheet1"); worksheet.Cells["B1"].Value = "string"; worksheet.Cells["B2"].Value = "another string"; worksheet.Cells["B3"].Value = "a third string"; worksheet.Cells["B4"].Formula = "=Vara(B1:B3)"; worksheet.Calculate(); Assert.AreEqual(0d, (worksheet.Cells["B4"].Value)); } }
public void VaraIsGivenMilitaryTimesAsInputsByCellRange() { var function = new Vara(); using (var package = new ExcelPackage()) { var worksheet = package.Workbook.Worksheets.Add("Sheet1"); worksheet.Cells["B1"].Value = "00:00"; worksheet.Cells["B2"].Value = "02:00"; worksheet.Cells["B3"].Value = "13:00"; worksheet.Cells["B4"].Formula = "=Vara(B1:B3)"; worksheet.Calculate(); Assert.AreEqual(0d, (worksheet.Cells["B4"].Value)); } }
// GET: Varas/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Vara vara = db.Varas.Find(id); if (vara == null) { return(HttpNotFound()); } ViewBag.ComarcaId = new SelectList(db.Comarcas, "Id", "Nome", vara.ComarcaId); return(View(vara)); }
// GET: Vara/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Vara vara = db.Varas.Find(id); if (vara == null) { return(HttpNotFound()); } ViewBag.TribunalID = new SelectList(db.Tribunais, "TribunalID", "Descricao", vara.TribunalID); return(View(vara)); }
public void VaraIsGivenADateSeperatedByABackslash() { var function = new Vara(); var input1 = "1/17/2011 2:00"; var input2 = "6/17/2011 2:00"; var input3 = "1/17/2012 2:00"; var input4 = "1/17/2013 2:00"; var result1 = function.Execute(FunctionsHelper.CreateArgs(input1, input1, input1), this.ParsingContext); var result2 = function.Execute(FunctionsHelper.CreateArgs(input1, input2, input1), this.ParsingContext); var result3 = function.Execute(FunctionsHelper.CreateArgs(input1, input3, input4), this.ParsingContext); Assert.AreEqual(0, result1.ResultNumeric, .00001); Assert.AreEqual(7600.333333, result2.ResultNumeric, .00001); Assert.AreEqual(133590.3333, result3.ResultNumeric, .0001); }
public void VaraIsGiven12HourTimesAsInputsByCellRefrence() { var function = new Vara(); using (var package = new ExcelPackage()) { var worksheet = package.Workbook.Worksheets.Add("Sheet1"); worksheet.Cells["B1"].Value = "12:00 am"; worksheet.Cells["B2"].Value = "02:00 am"; worksheet.Cells["B3"].Value = "01:00 pm"; worksheet.Cells["B4"].Formula = "=Vara(B1,B2,B3)"; worksheet.Calculate(); Assert.AreEqual(0d, (worksheet.Cells["B4"].Value)); } }
public void VaraIsGivenMonthDayYear12HourTimeAsInputsByCellRange() { var function = new Vara(); using (var package = new ExcelPackage()) { var worksheet = package.Workbook.Worksheets.Add("Sheet1"); worksheet.Cells["B1"].Value = "Jan 17, 2011 2:00 am"; worksheet.Cells["B2"].Value = "June 5, 2017 11:00 pm"; worksheet.Cells["B3"].Value = "June 15, 2017 11:00 pm"; worksheet.Cells["B4"].Formula = "=Vara(B1:B3)"; worksheet.Calculate(); Assert.AreEqual(0d, (worksheet.Cells["B4"].Value)); } }
public void VaraIsGivenDateTimeInputsSeperatedByADashAsInputsByCellRange() { var function = new Vara(); using (var package = new ExcelPackage()) { var worksheet = package.Workbook.Worksheets.Add("Sheet1"); worksheet.Cells["B1"].Value = "1-17-2017 2:00"; worksheet.Cells["B2"].Value = "6-17-2017 2:00"; worksheet.Cells["B3"].Value = "9-17-2017 2:00"; worksheet.Cells["B4"].Formula = "=Vara(B1:B3)"; worksheet.Calculate(); Assert.AreEqual(0d, (worksheet.Cells["B4"].Value)); } }
public void VaraIsGivenAMixOfTwoTypesAndTwoRangesThatShouldHaveAnOutputTestTwo() { var function = new Vara(); using (var package = new ExcelPackage()) { var worksheet = package.Workbook.Worksheets.Add("Sheet1"); worksheet.Cells["B1"].Value = 10; worksheet.Cells["B2"].Value = 2; worksheet.Cells["B3"].Value = "6/17/2011 2:00"; worksheet.Cells["B4"].Value = "02:00 am"; worksheet.Cells["B9"].Formula = "=Vara(B1:B4)"; worksheet.Calculate(); Assert.AreEqual(22.66666667, (double)worksheet.Cells["B9"].Value, .0001); } }
public void VaraTestingDirectInputVsRangeInputWithAGapInTheMiddle() { var function = new Vara(); using (var package = new ExcelPackage()) { var worksheet = package.Workbook.Worksheets.Add("Sheet1"); worksheet.Cells["B1"].Value = 1; worksheet.Cells["B3"].Value = 1; worksheet.Cells["B8"].Formula = "=Vara(B1,B3)"; worksheet.Cells["B9"].Formula = "=Vara(B1:B3)"; worksheet.Calculate(); Assert.AreEqual(0d, worksheet.Cells["B8"].Value); Assert.AreEqual(0d, worksheet.Cells["B9"].Value); } }
public void VaraTestingDirectINputVsRangeInputTest2() { var function = new Vara(); using (var package = new ExcelPackage()) { var worksheet = package.Workbook.Worksheets.Add("Sheet1"); worksheet.Cells["B1"].Value = 1; worksheet.Cells["B2"].Value = 0; worksheet.Cells["B8"].Formula = "=Vara(B1,B2)"; worksheet.Cells["B9"].Formula = "=Vara(B1:B2)"; worksheet.Calculate(); Assert.AreEqual(0.5, (double)worksheet.Cells["B8"].Value, .00001); Assert.AreEqual(0.5, (double)worksheet.Cells["B9"].Value, .00001); } }
public void VaraIsGivenAMixOfInputTypesByCellRange() { var function = new Vara(); using (var package = new ExcelPackage()) { var worksheet = package.Workbook.Worksheets.Add("Sheet1"); worksheet.Cells["B1"].Value = 15; worksheet.Cells["B2"].Value = 1; worksheet.Cells["B3"].Value = "6/17/2011 2:00"; worksheet.Cells["B4"].Value = "02:00 am"; worksheet.Cells["B9"].Formula = "=Vara(B1:B4)"; worksheet.Calculate(); Assert.AreEqual(54, (double)worksheet.Cells["B9"].Value, .00001); } }
public void VaraIsGivenBooleanInputsFromCellRefrence() { var function = new Vara(); using (var package = new ExcelPackage()) { var worksheet = package.Workbook.Worksheets.Add("Sheet1"); worksheet.Cells["B1"].Value = true; worksheet.Cells["B2"].Value = false; worksheet.Cells["B3"].Formula = "=Vara(B1,B1,B2)"; worksheet.Cells["B4"].Formula = "=Vara(B1,B1,B1)"; worksheet.Cells["B5"].Formula = "=Vara(B1,B2,B2)"; worksheet.Calculate(); Assert.AreEqual(0.333333333, (double)worksheet.Cells["B3"].Value, .00001); Assert.AreEqual(0d, (double)worksheet.Cells["B4"].Value, .00001); Assert.AreEqual(0.333333333, (double)worksheet.Cells["B5"].Value, .00001); } }
public void VaraIsGivenAMixOfInputTypesWithANullInTheCenterByCellRefrenceAndTwoRangeInputs() { var function = new Vara(); using (var package = new ExcelPackage()) { var worksheet = package.Workbook.Worksheets.Add("Sheet1"); worksheet.Cells["B1"].Value = 15; worksheet.Cells["B2"].Value = 1; //empty B3 cell worksheet.Cells["B4"].Value = "6/17/2011 2:00"; worksheet.Cells["B5"].Value = "02:00 am"; worksheet.Cells["B8"].Formula = "=Vara(B1,B2)"; worksheet.Cells["B9"].Formula = "=Vara(B1:B5,B1:B5)"; worksheet.Calculate(); Assert.AreEqual(98, (double)worksheet.Cells["B8"].Value, .00001); Assert.AreEqual(46.28571, (double)worksheet.Cells["B9"].Value, .00001); } }
[HttpPost] // só será acessada com POST public ActionResult Save(Vara vara) // recebemos um cliente { if (vara.Id == 0) { // armazena o cliente em memória _context.Vara.Add(vara); } else { var customerInDb = _context.Vara.Single(c => c.Id == vara.Id); customerInDb.Nome = vara.Nome; } // faz a persistência _context.SaveChanges(); // Voltamos para a lista de clientes return(RedirectToAction("Index")); }
public void VaraIsGivenADateSeperatedByABackslashInputFromCellRefrence() { var function = new Vara(); using (var package = new ExcelPackage()) { var worksheet = package.Workbook.Worksheets.Add("Sheet1"); worksheet.Cells["B1"].Value = "1/17/2011 2:00"; worksheet.Cells["B2"].Value = "6/17/2011 2:00"; worksheet.Cells["B3"].Value = "1/17/2012 2:00"; worksheet.Cells["B4"].Value = "1/17/2013 2:00"; worksheet.Cells["B5"].Formula = "=Vara(B1,B1,B1)"; worksheet.Cells["B6"].Formula = "=Vara(B1,B2,B1)"; worksheet.Cells["B7"].Formula = "=Vara(B1,B3,B4)"; worksheet.Calculate(); Assert.AreEqual(0d, (double)worksheet.Cells["B5"].Value, .00001); Assert.AreEqual(0d, (double)worksheet.Cells["B6"].Value, .00001); Assert.AreEqual(0d, (double)worksheet.Cells["B7"].Value, .00001); } }
public void VaraIsGivenStringNumbersAsInputsByCellRange() { var function = new Vara(); using (var package = new ExcelPackage()) { var worksheet = package.Workbook.Worksheets.Add("Sheet1"); worksheet.Cells["A1"].Value = "5"; worksheet.Cells["A2"].Value = "6"; worksheet.Cells["A3"].Value = "7"; worksheet.Cells["B1"].Value = "5.5"; worksheet.Cells["B2"].Value = "6.6"; worksheet.Cells["B3"].Value = "7.7"; worksheet.Cells["A4"].Formula = "=Vara(A1:A3)"; worksheet.Cells["B4"].Formula = "=Vara(B1:B3)"; worksheet.Calculate(); Assert.AreEqual(0d, (worksheet.Cells["B4"].Value)); Assert.AreEqual(0d, (worksheet.Cells["B4"].Value)); } }
public void VaraIsGivenNumberInputFromCellRefrenceWithEmptyCellsFirst() { var function = new Vara(); using (var package = new ExcelPackage()) { var worksheet = package.Workbook.Worksheets.Add("Sheet1"); worksheet.Cells["B3"].Value = 66; worksheet.Cells["B4"].Value = 52; worksheet.Cells["B5"].Value = 77; worksheet.Cells["B6"].Value = 71; worksheet.Cells["B7"].Value = 30; worksheet.Cells["B8"].Value = 90; worksheet.Cells["B9"].Value = 26; worksheet.Cells["B10"].Value = 56; worksheet.Cells["B12"].Value = 7; worksheet.Cells["A12"].Formula = "=Vara(B1:B12)"; worksheet.Calculate(); Assert.AreEqual(727.6944444, (double)worksheet.Cells["A12"].Value, .00001); } }
public void VaraIsGivenNumberInputFromCellRefrenceWithEmptyCellsFirstAndAnInvalidCellInTheMiddle() { var function = new Vara(); using (var package = new ExcelPackage()) { var worksheet = package.Workbook.Worksheets.Add("Sheet1"); worksheet.Cells["B3"].Value = 66; worksheet.Cells["B4"].Value = 52; worksheet.Cells["B5"].Value = 77; worksheet.Cells["B6"].Value = 71; //B7 is an empty cell worksheet.Cells["B8"].Value = 90; worksheet.Cells["B9"].Value = 26; worksheet.Cells["B10"].Value = 56; worksheet.Cells["B11"].Value = 7; worksheet.Cells["A12"].Formula = "=Vara(B1:B11)"; worksheet.Calculate(); Assert.AreEqual(748.2678571, (double)worksheet.Cells["A12"].Value, .00001); } }
public void VaraIsGivenAStringInputWithAEmptyCellInTheMiddleByCellRefrence() { var function = new Vara(); using (var package = new ExcelPackage()) { var worksheet = package.Workbook.Worksheets.Add("Sheet1"); worksheet.Cells["B3"].Value = 66; worksheet.Cells["B4"].Value = 52; worksheet.Cells["B5"].Value = 77; worksheet.Cells["B6"].Value = 71; //empty B7 cell worksheet.Cells["B8"].Value = 90; worksheet.Cells["B9"].Value = 26; worksheet.Cells["B10"].Value = 56; worksheet.Cells["B11"].Value = 7; worksheet.Cells["B12"].Value = 30; worksheet.Cells["A12"].Formula = "=Vara(B3:B12)"; worksheet.Calculate(); Assert.AreEqual(727.6944444, (double)worksheet.Cells["A12"].Value, .00001); } }
public void VaraIsTheSameTestsAsGivenAMixOfInputTypesByCellRefrenceExceptTheyAreAllOnes() { var function = new Vara(); using (var package = new ExcelPackage()) { var worksheet = package.Workbook.Worksheets.Add("Sheet1"); worksheet.Cells["B1"].Value = 1; worksheet.Cells["B2"].Value = 1; //empty B3 cell worksheet.Cells["B4"].Value = 1; worksheet.Cells["B5"].Value = 1; worksheet.Cells["B6"].Formula = "=Vara(B1,B2,B4,B5)"; worksheet.Cells["B7"].Formula = "=Vara(B1,B2,B3,B4,B5)"; worksheet.Cells["B8"].Formula = "=Vara(B1,B2)"; worksheet.Cells["B9"].Formula = "=Vara(B1:B5)"; worksheet.Calculate(); Assert.AreEqual(0d, worksheet.Cells["B6"].Value); Assert.AreEqual(0d, worksheet.Cells["B7"].Value); Assert.AreEqual(0d, worksheet.Cells["B8"].Value); Assert.AreEqual(0d, worksheet.Cells["B9"].Value); } }
public ActionResult Order(int Id) { Vara VaraObject = new Vara(); Labb2.LagerServiceReference.Service1Client client = new Labb2.LagerServiceReference.Service1Client(); // Same solution and method from Index. var list = client.GetListVara(); // Loop and get one specific ID. We forgot doing a method retreiving a specific ID from services. foreach (var item in list) { if (item.ID == Id) { VaraObject.ID = item.ID; VaraObject.Namn = item.Namn; VaraObject.ButikAntal = item.ButikAntal; VaraObject.LagerAntal = item.LagerAntal; VaraObject.Pris = item.Pris; } } return(View(VaraObject)); }
public Processo Select(int codigo) { Processo pro = null; IDbCommand objCommand; IDbConnection objConexao; IDataReader objDataReader; string sql = "SELECT "; sql += "PRO.*, "; sql += "CLI.PES_CODIGO AS CODIGO_CLIENTE, "; sql += "ADV.PES_CODIGO AS CODIGO_ADVOGADO, "; sql += "PRO.REC_CODIGO AS CODIGO_RECURSO, "; sql += "PRO.PRO_NUMEROPROCESSO AS NUMEROPROCESSO, "; sql += "PRO.PRO_DESCRICAO AS DESCRICAO, "; sql += "CON_ADV.CON_NOME AS NOME_ADVOGADO, "; sql += "CON_CLI.CON_NOME AS NOME_CLIENTE, "; sql += "ASS.ASS_ASSUNTO AS ASSUNTO, "; sql += "POS.POS_POSICAO AS POSICAO_CLIENTE, "; sql += "CLA.CLA_CLASSE AS CLASSE, "; sql += "VAR.VAR_VARA AS VARA, "; sql += "CID.CID_CIDADE AS COMARCA, "; sql += "MOV.MOV_CODIGO AS MOVIMENTACAO "; sql += "FROM PRO_PROCESSO PRO "; sql += "INNER JOIN APR_ADVOGADO_PROCESSO APR ON (PRO.PRO_CODIGO = APR.PRO_CODIGO) "; sql += "INNER JOIN PES_PESSOA ADV ON (ADV.PES_CODIGO = APR.PES_CODIGO) "; sql += "INNER JOIN CON_CONTATO CON_ADV ON (ADV.CON_CODIGO = CON_ADV.CON_CODIGO) "; sql += "INNER JOIN CPR_CLIENTE_PROCESSO CPR ON (PRO.PRO_CODIGO = CPR.PRO_CODIGO) "; sql += "INNER JOIN PES_PESSOA CLI ON (CLI.PES_CODIGO = CPR.PES_CODIGO) "; sql += "INNER JOIN CON_CONTATO CON_CLI ON (CLI.CON_CODIGO = CON_CLI.CON_CODIGO) "; sql += "INNER JOIN ASS_ASSUNTO ASS ON (PRO.ASS_CODIGO = ASS.ASS_CODIGO) "; sql += "INNER JOIN POS_POSICAOCLIENTE POS ON (POS.POS_CODIGO = PRO.POS_CODIGO) "; sql += "INNER JOIN CLA_CLASSE CLA ON (CLA.CLA_CODIGO = PRO.CLA_CODIGO) "; sql += "INNER JOIN VAR_VARA VAR ON (VAR.VAR_CODIGO = PRO.VAR_CODIGO) "; sql += "INNER JOIN CID_CIDADE CID ON (CID.CID_CODIGO = PRO.CID_CODIGO_COMARCA) "; sql += "INNER JOIN PMV_PROCESSO_MOVIMENTACAO PMV ON (PRO.PRO_CODIGO = PMV.PRO_CODIGO) "; sql += "INNER JOIN MOV_MOVIMENTACAO MOV ON (MOV.MOV_CODIGO = PMV.MOV_CODIGO) "; sql += "WHERE PRO.PRO_CODIGO = ?codigo AND PMV.PMV_FINALIZADO = 0 "; objConexao = Mapped.Connection(); objCommand = Mapped.Command(sql, objConexao); objCommand.Parameters.Add(Mapped.Parameter("?codigo", codigo)); objDataReader = objCommand.ExecuteReader(); while (objDataReader.Read()) { pro = new Processo(); pro.Codigo = Convert.ToInt32(objDataReader["PRO_CODIGO"]); pro.NumeroProcesso = Convert.ToString(objDataReader["PRO_NUMEROPROCESSO"]); pro.Descricao = Convert.ToString(objDataReader["PRO_DESCRICAO"]); pro.Observacao = Convert.ToString(objDataReader["PRO_OBSERVACAO"]); pro.DataCriacao = Convert.ToDateTime(objDataReader["PRO_DATACRIACAO"]); Vara var = new Vara(); var.Codigo = Convert.ToInt32(objDataReader["VAR_CODIGO"]); pro.Vara = var; Cidade cid = new Cidade(); cid.Codigo = Convert.ToInt32(objDataReader["CID_CODIGO_COMARCA"]); pro.Comarca = cid; Classe cla = new Classe(); cla.Codigo = Convert.ToInt32(objDataReader["CLA_CODIGO"]); pro.Classe = cla; PosicaoCliente pos = new PosicaoCliente(); pos.Codigo = Convert.ToInt32(objDataReader["POS_CODIGO"]); pro.PosicaoCliente = pos; Recurso rec = new Recurso(); if (objDataReader["CODIGO_RECURSO"] != DBNull.Value) { rec.Codigo = Convert.ToInt32(objDataReader["CODIGO_RECURSO"]); pro.Recurso = rec; } else { rec = new Recurso(); } Assunto ass = new Assunto(); ass.Codigo = Convert.ToInt32(objDataReader["ASS_CODIGO"]); pro.Assunto = ass; Pessoa pes = new Pessoa(); pes.Codigo = Convert.ToInt32(objDataReader["CODIGO_CLIENTE"]); pro.PessoaCliente = pes; Advogado adv = new Advogado(); adv.Codigo = Convert.ToInt32(objDataReader["CODIGO_ADVOGADO"]); pro.PessoaAdvogado = adv; Movimentacao mov = new Movimentacao(); mov.Codigo = Convert.ToInt32(objDataReader["MOVIMENTACAO"]); pro.Movimentacao = mov; } objConexao.Close(); objDataReader.Close(); objConexao.Dispose(); objCommand.Dispose(); objDataReader.Dispose(); return(pro); }
public Task <int> DeleteVaraAsync(Vara vara) { return(_database.DeleteAsync(vara)); }
private bool UpdateProcesso() { Recurso rec = new Recurso(); Recurso recurso = new Recurso(); RecursoDB recDB = new RecursoDB(); Assunto assunto = new Assunto(); AssuntoDB assuntoDB = new AssuntoDB(); DataProcesso dataProcesso = new DataProcesso(); DataProcessoDB dataDB = new DataProcessoDB(); Movimentacao mov = new Movimentacao(); Pessoa pes = new Pessoa(); Advogado adv = new Advogado(); Vara vara = new Vara(); PosicaoCliente pos = new PosicaoCliente(); Cidade cid = new Cidade(); Classe cla = new Classe(); Processo pro = new Processo(); ProcessoDB proDB = new ProcessoDB(); pro = proDB.Select(Convert.ToInt32(Session["Processo"])); int valor = Convert.ToInt32(Session["Processo"]); if (pro.Recurso == null) { if (rblRecurso.SelectedItem.Value == "1") { rec.Camara = txtCamara.Text; recDB.InsertCamara(rec); recurso.CodigoCamara = recDB.GetLastIdCamara(rec.Camara); recurso.CodigoTribunal = Convert.ToInt32(ddlTribunal.SelectedItem.Value); recDB.InsertRecurso(recurso); rec.Codigo = recDB.GetLastIdRecurso(recurso); pro.Recurso = rec; } else if (rblRecurso.SelectedItem.Value == "0") { txtCamara.Text = string.Empty; Function.LimpaDDL(ddlTribunal); } } else { rec = recDB.Select(pro.Recurso.Codigo); if (rblRecurso.SelectedItem.Value == "1") { rec.Camara = txtCamara.Text; //update recDB.UpdateCamara(rec); rec.CodigoTribunal = Convert.ToInt32(ddlTribunal.SelectedItem.Value); //update recDB.UpdateRecurso(rec); } else if (rblRecurso.SelectedItem.Value == "0") { txtCamara.Text = string.Empty; Function.LimpaDDL(ddlTribunal); } } assunto.Codigo = pro.Assunto.Codigo; assunto.Descricao = txtAssunto.Text; //update assuntoDB.Update(assunto); adv.Codigo = Convert.ToInt32(Session["Advogado"]); pro.PessoaAdvogado = adv; vara.Codigo = Convert.ToInt32(ddlVara.SelectedItem.Value); pro.Vara = vara; cla.Codigo = Convert.ToInt32(ddlClasse.SelectedItem.Value); pro.Classe = cla; pos.Codigo = Convert.ToInt32(ddlPosicao.SelectedItem.Value); pro.PosicaoCliente = pos; cid.Codigo = Convert.ToInt32(ddlCidade.SelectedItem.Value); pro.Comarca = cid; pro.DataCriacao = Convert.ToDateTime(txtDataCadastro.Text); pro.Descricao = txtDescricao.Text; pro.Observacao = txtObservacao.Text; pro.NumeroProcesso = txtNumero.Text; pes.Codigo = Convert.ToInt32(ddlCliente.SelectedItem.Value); pro.PessoaCliente = pes; //Persistencia //Update if (proDB.Update(pro)) { //Update cliente //dar insert nas tabelas de cliente e na de advogado proDB.UpdateClienteProcesso(pro.PessoaCliente.Codigo, Convert.ToInt32(Session["Processo"])); dataProcesso = dataDB.SelectByProcesso(pro.Codigo); if (dataProcesso != null) { if (!string.IsNullOrWhiteSpace(txtDataProcesso.Text)) { //pegar do cadastra processo ja atualizado e dar update pro.Codigo = Convert.ToInt32(Session["Processo"]); dataProcesso.Processo = pro; TimeSpan hora = Convert.ToDateTime(txtHoraAudiencia.Text).TimeOfDay; DateTime data = Convert.ToDateTime(txtDataProcesso.Text); dataProcesso.DataAudiencia = data + hora; dataDB.Update(dataProcesso); } else if (string.IsNullOrWhiteSpace(txtDataProcesso.Text)) { dataDB.Delete(Convert.ToInt32(Session["Processo"])); } } else { if (!string.IsNullOrWhiteSpace(txtDataProcesso.Text)) { if (string.IsNullOrWhiteSpace(txtHoraAudiencia.Text)) { //msg para entrar com uma hora para o update rolar } else if (!string.IsNullOrWhiteSpace(txtDataProcesso.Text) && !string.IsNullOrWhiteSpace(txtHoraAudiencia.Text)) { pro.Codigo = Convert.ToInt32(Session["Processo"]); DataProcesso dataa = new DataProcesso(); dataa.Processo = pro; TimeSpan hora = Convert.ToDateTime(txtHoraAudiencia.Text).TimeOfDay; DateTime data = Convert.ToDateTime(txtDataProcesso.Text); dataa.DataAudiencia = data + hora; dataDB.Insert(dataa); } } } } lblMensagem.Text = "Dados alterados com sucesso!"; divStatusPro.Attributes["class"] = "alert alert-success"; return(true); }
public BuiltInFunctions() { // Text Functions["len"] = new Len(); Functions["lower"] = new Lower(); Functions["upper"] = new Upper(); Functions["left"] = new Left(); Functions["right"] = new Right(); Functions["mid"] = new Mid(); Functions["replace"] = new Replace(); Functions["rept"] = new Rept(); Functions["substitute"] = new Substitute(); Functions["concatenate"] = new Concatenate(); Functions["concat"] = new Concat(); Functions["textjoin"] = new Textjoin(); Functions["char"] = new CharFunction(); Functions["exact"] = new Exact(); Functions["find"] = new Find(); Functions["fixed"] = new Fixed(); Functions["proper"] = new Proper(); Functions["search"] = new Search(); Functions["text"] = new Text.Text(); Functions["t"] = new T(); Functions["hyperlink"] = new Hyperlink(); Functions["value"] = new Value(CultureInfo.CurrentCulture); Functions["trim"] = new Trim(); Functions["clean"] = new Clean(); Functions["unicode"] = new Unicode(); Functions["unichar"] = new Unichar(); Functions["numbervalue"] = new NumberValue(); Functions["dollar"] = new Dollar(); // Numbers Functions["int"] = new CInt(); // Math Functions["aggregate"] = new Aggregate(); Functions["abs"] = new Abs(); Functions["asin"] = new Asin(); Functions["asinh"] = new Asinh(); Functions["acot"] = new Acot(); Functions["acoth"] = new Acoth(); Functions["cos"] = new Cos(); Functions["cot"] = new Cot(); Functions["coth"] = new Coth(); Functions["cosh"] = new Cosh(); Functions["csc"] = new Csc(); Functions["csch"] = new Csch(); Functions["power"] = new Power(); Functions["gcd"] = new Gcd(); Functions["lcm"] = new Lcm(); Functions["sec"] = new Sec(); Functions["sech"] = new SecH(); Functions["sign"] = new Sign(); Functions["sqrt"] = new Sqrt(); Functions["sqrtpi"] = new SqrtPi(); Functions["pi"] = new Pi(); Functions["product"] = new Product(); Functions["ceiling"] = new Ceiling(); Functions["ceiling.precise"] = new CeilingPrecise(); Functions["ceiling.math"] = new CeilingMath(); Functions["iso.ceiling"] = new IsoCeiling(); Functions["combin"] = new Combin(); Functions["combina"] = new Combina(); Functions["permut"] = new Permut(); Functions["permutationa"] = new Permutationa(); Functions["count"] = new Count(); Functions["counta"] = new CountA(); Functions["countblank"] = new CountBlank(); Functions["countif"] = new CountIf(); Functions["countifs"] = new CountIfs(); Functions["fact"] = new Fact(); Functions["factdouble"] = new FactDouble(); Functions["floor"] = new Floor(); Functions["floor.precise"] = new FloorPrecise(); Functions["floor.math"] = new FloorMath(); Functions["radians"] = new Radians(); Functions["roman"] = new Roman(); Functions["sin"] = new Sin(); Functions["sinh"] = new Sinh(); Functions["sum"] = new Sum(); Functions["sumif"] = new SumIf(); Functions["sumifs"] = new SumIfs(); Functions["sumproduct"] = new SumProduct(); Functions["sumsq"] = new Sumsq(); Functions["sumxmy2"] = new Sumxmy2(); Functions["sumx2my2"] = new SumX2mY2(); Functions["sumx2py2"] = new SumX2pY2(); Functions["seriessum"] = new Seriessum(); Functions["stdev"] = new Stdev(); Functions["stdeva"] = new Stdeva(); Functions["stdevp"] = new StdevP(); Functions["stdevpa"] = new Stdevpa(); Functions["stdev.s"] = new StdevDotS(); Functions["stdev.p"] = new StdevDotP(); Functions["subtotal"] = new Subtotal(); Functions["exp"] = new Exp(); Functions["log"] = new Log(); Functions["log10"] = new Log10(); Functions["ln"] = new Ln(); Functions["max"] = new Max(); Functions["maxa"] = new Maxa(); Functions["median"] = new Median(); Functions["min"] = new Min(); Functions["mina"] = new Mina(); Functions["mod"] = new Mod(); Functions["mode"] = new Mode(); Functions["mode.sngl"] = new ModeSngl(); Functions["mround"] = new Mround(); Functions["multinomial"] = new Multinomial(); Functions["average"] = new Average(); Functions["averagea"] = new AverageA(); Functions["averageif"] = new AverageIf(); Functions["averageifs"] = new AverageIfs(); Functions["round"] = new Round(); Functions["rounddown"] = new Rounddown(); Functions["roundup"] = new Roundup(); Functions["rand"] = new Rand(); Functions["randbetween"] = new RandBetween(); Functions["rank"] = new Rank(); Functions["rank.eq"] = new RankEq(); Functions["rank.avg"] = new RankAvg(); Functions["percentile"] = new Percentile(); Functions["percentile.inc"] = new PercentileInc(); Functions["percentile.exc"] = new PercentileExc(); Functions["quartile"] = new Quartile(); Functions["quartile.inc"] = new QuartileInc(); Functions["quartile.exc"] = new QuartileExc(); Functions["percentrank"] = new Percentrank(); Functions["percentrank.inc"] = new PercentrankInc(); Functions["percentrank.exc"] = new PercentrankExc(); Functions["quotient"] = new Quotient(); Functions["trunc"] = new Trunc(); Functions["tan"] = new Tan(); Functions["tanh"] = new Tanh(); Functions["atan"] = new Atan(); Functions["atan2"] = new Atan2(); Functions["atanh"] = new Atanh(); Functions["acos"] = new Acos(); Functions["acosh"] = new Acosh(); Functions["covar"] = new Covar(); Functions["covariance.p"] = new CovarianceP(); Functions["covariance.s"] = new CovarianceS(); Functions["var"] = new Var(); Functions["vara"] = new Vara(); Functions["var.s"] = new VarDotS(); Functions["varp"] = new VarP(); Functions["varpa"] = new Varpa(); Functions["var.p"] = new VarDotP(); Functions["large"] = new Large(); Functions["small"] = new Small(); Functions["degrees"] = new Degrees(); Functions["odd"] = new Odd(); Functions["even"] = new Even(); // Information Functions["isblank"] = new IsBlank(); Functions["isnumber"] = new IsNumber(); Functions["istext"] = new IsText(); Functions["isnontext"] = new IsNonText(); Functions["iserror"] = new IsError(); Functions["iserr"] = new IsErr(); Functions["error.type"] = new ErrorType(); Functions["iseven"] = new IsEven(); Functions["isodd"] = new IsOdd(); Functions["islogical"] = new IsLogical(); Functions["isna"] = new IsNa(); Functions["na"] = new Na(); Functions["n"] = new N(); Functions["type"] = new TypeFunction(); // Logical Functions["if"] = new If(); Functions["ifs"] = new Ifs(); Functions["maxifs"] = new MaxIfs(); Functions["minifs"] = new MinIfs(); Functions["iferror"] = new IfError(); Functions["ifna"] = new IfNa(); Functions["not"] = new Not(); Functions["and"] = new And(); Functions["or"] = new Or(); Functions["true"] = new True(); Functions["false"] = new False(); Functions["switch"] = new Switch(); Functions["xor"] = new Xor(); // Reference and lookup Functions["address"] = new Address(); Functions["hlookup"] = new HLookup(); Functions["vlookup"] = new VLookup(); Functions["lookup"] = new Lookup(); Functions["match"] = new Match(); Functions["row"] = new Row(); Functions["rows"] = new Rows(); Functions["column"] = new Column(); Functions["columns"] = new Columns(); Functions["choose"] = new Choose(); Functions["index"] = new RefAndLookup.Index(); Functions["indirect"] = new Indirect(); Functions["offset"] = new Offset(); // Date Functions["date"] = new Date(); Functions["datedif"] = new DateDif(); Functions["today"] = new Today(); Functions["now"] = new Now(); Functions["day"] = new Day(); Functions["month"] = new Month(); Functions["year"] = new Year(); Functions["time"] = new Time(); Functions["hour"] = new Hour(); Functions["minute"] = new Minute(); Functions["second"] = new Second(); Functions["weeknum"] = new Weeknum(); Functions["weekday"] = new Weekday(); Functions["days"] = new Days(); Functions["days360"] = new Days360(); Functions["yearfrac"] = new Yearfrac(); Functions["edate"] = new Edate(); Functions["eomonth"] = new Eomonth(); Functions["isoweeknum"] = new IsoWeekNum(); Functions["workday"] = new Workday(); Functions["workday.intl"] = new WorkdayIntl(); Functions["networkdays"] = new Networkdays(); Functions["networkdays.intl"] = new NetworkdaysIntl(); Functions["datevalue"] = new DateValue(); Functions["timevalue"] = new TimeValue(); // Database Functions["dget"] = new Dget(); Functions["dcount"] = new Dcount(); Functions["dcounta"] = new DcountA(); Functions["dmax"] = new Dmax(); Functions["dmin"] = new Dmin(); Functions["dsum"] = new Dsum(); Functions["daverage"] = new Daverage(); Functions["dvar"] = new Dvar(); Functions["dvarp"] = new Dvarp(); //Finance Functions["cumipmt"] = new Cumipmt(); Functions["cumprinc"] = new Cumprinc(); Functions["dollarde"] = new DollarDe(); Functions["dollarfr"] = new DollarFr(); Functions["ddb"] = new Ddb(); Functions["effect"] = new Effect(); Functions["fvschedule"] = new FvSchedule(); Functions["pduration"] = new Pduration(); Functions["rri"] = new Rri(); Functions["pmt"] = new Pmt(); Functions["ppmt"] = new Ppmt(); Functions["ipmt"] = new Ipmt(); Functions["ispmt"] = new IsPmt(); Functions["pv"] = new Pv(); Functions["fv"] = new Fv(); Functions["npv"] = new Npv(); Functions["rate"] = new Rate(); Functions["nper"] = new Nper(); Functions["nominal"] = new Nominal(); Functions["irr"] = new Irr(); Functions["mirr"] = new Mirr(); Functions["xirr"] = new Xirr(); Functions["sln"] = new Sln(); Functions["syd"] = new Syd(); Functions["xnpv"] = new Xnpv(); Functions["coupdays"] = new Coupdays(); Functions["coupdaysnc"] = new Coupdaysnc(); Functions["coupdaybs"] = new Coupdaybs(); Functions["coupnum"] = new Coupnum(); Functions["coupncd"] = new Coupncd(); Functions["couppcd"] = new Couppcd(); Functions["price"] = new Price(); Functions["yield"] = new Yield(); Functions["yieldmat"] = new Yieldmat(); Functions["duration"] = new Duration(); Functions["disc"] = new Disc(); //Engineering Functions["bitand"] = new BitAnd(); Functions["bitor"] = new BitOr(); Functions["bitxor"] = new BitXor(); Functions["bitlshift"] = new BitLshift(); Functions["bitrshift"] = new BitRshift(); Functions["convert"] = new ConvertFunction(); Functions["bin2dec"] = new Bin2Dec(); Functions["bin2hex"] = new Bin2Hex(); Functions["bin2oct"] = new Bin2Oct(); Functions["dec2bin"] = new Dec2Bin(); Functions["dec2hex"] = new Dec2Hex(); Functions["dec2oct"] = new Dec2Oct(); Functions["hex2bin"] = new Hex2Bin(); Functions["hex2dec"] = new Hex2Dec(); Functions["hex2oct"] = new Hex2Oct(); Functions["oct2bin"] = new Oct2Bin(); Functions["oct2dec"] = new Oct2Dec(); Functions["oct2hex"] = new Oct2Hex(); Functions["delta"] = new Delta(); Functions["erf"] = new Erf(); Functions["erf.precise"] = new ErfPrecise(); Functions["erfc"] = new Erfc(); Functions["erfc.precise"] = new ErfcPrecise(); Functions["besseli"] = new BesselI(); Functions["besselj"] = new BesselJ(); Functions["besselk"] = new BesselK(); Functions["bessely"] = new BesselY(); }
private bool CarregaProcessoModal(int codigo) { try { Recurso rec = new Recurso(); Recurso recurso = new Recurso(); RecursoDB recDB = new RecursoDB(); Assunto assunto = new Assunto(); AssuntoDB assuntoDB = new AssuntoDB(); DataProcesso dataProcesso = new DataProcesso(); DataProcessoDB dataDB = new DataProcessoDB(); Movimentacao mov = new Movimentacao(); Pessoa pes = new Pessoa(); Advogado adv = new Advogado(); Vara vara = new Vara(); PosicaoCliente pos = new PosicaoCliente(); Cidade cid = new Cidade(); CidadeDB cidDB = new CidadeDB(); Classe cla = new Classe(); Processo pro = new Processo(); ProcessoDB proDB = new ProcessoDB(); pro = proDB.Select(codigo); txtNumero.Text = pro.NumeroProcesso; txtDescricao.Text = pro.Descricao; txtObservacao.Text = pro.Observacao; txtDataCadastro.Text = pro.DataCriacao.ToString("dd/MM/yyyy"); Function.CarregaItemDDLByCodigo(ddlVara, pro.Vara.Codigo); cid = cidDB.SelectCidadePessoa(pro.Comarca.Codigo); Function.CarregaItemDDLByCodigo(ddlEstado, cid.Estado.Codigo); CarregaCidade(cid.Estado.Codigo); Function.CarregaItemDDLByCodigo(ddlCidade, pro.Comarca.Codigo); Function.CarregaItemDDLByCodigo(ddlClasse, pro.Classe.Codigo); Function.CarregaItemDDLByCodigo(ddlPosicao, pro.PosicaoCliente.Codigo); assunto = assuntoDB.Select(pro.Assunto.Codigo); txtAssunto.Text = assunto.Descricao; Function.CarregaItemDDLByCodigo(ddlCliente, pro.PessoaCliente.Codigo); //selecionar dataaudiencia dataProcesso = dataDB.SelectByProcesso(codigo); if (dataProcesso != null) { txtDataProcesso.Text = dataProcesso.DataAudiencia.ToString("dd/MM/yyyy"); txtHoraAudiencia.Text = dataProcesso.DataAudiencia.ToString("t"); } else { txtDataProcesso.Text = string.Empty; txtHoraAudiencia.Text = string.Empty; } if (pro.Recurso != null) { txtCamara.Enabled = true; ddlTribunal.Enabled = true; rec = recDB.Select(pro.Recurso.Codigo); int tribunal = rec.CodigoTribunal; int camara = rec.CodigoCamara; rblRecurso.Items[0].Selected = false; rblRecurso.Items[1].Selected = true; Function.CarregaItemDDLByCodigo(ddlTribunal, tribunal); rec = recDB.SelectCamara(camara); txtCamara.Text = rec.Camara; } else { txtCamara.Text = string.Empty; Function.LimpaDDL(ddlTribunal); txtCamara.Enabled = false; ddlTribunal.Enabled = false; rblRecurso.Items[0].Selected = true; rblRecurso.Items[1].Selected = false; } return(true); } catch (Exception) { return(false); } }
public void CarregaDetalhesProcesso(int id) { Recurso rec = new Recurso(); Recurso recurso = new Recurso(); RecursoDB recDB = new RecursoDB(); Assunto assunto = new Assunto(); AssuntoDB assuntoDB = new AssuntoDB(); DataProcesso dataProcesso = new DataProcesso(); DataProcessoDB dataDB = new DataProcessoDB(); Movimentacao mov = new Movimentacao(); MovimentacaoDB movDB = new MovimentacaoDB(); Pessoa pes = new Pessoa(); PessoaDB pesDB = new PessoaDB(); ClienteFisico clifisico = new ClienteFisico(); ClienteFisicoDB clifisicoDB = new ClienteFisicoDB(); ClienteJuridico clijuridico = new ClienteJuridico(); ClienteJuridicoDB clijuridicoDB = new ClienteJuridicoDB(); Contato contato = new Contato(); ContatoDB contatoDB = new ContatoDB(); Advogado adv = new Advogado(); Vara vara = new Vara(); VaraDB varaDB = new VaraDB(); PosicaoCliente pos = new PosicaoCliente(); PosicaoClienteDB posDB = new PosicaoClienteDB(); Cidade cid = new Cidade(); CidadeDB cidDB = new CidadeDB(); Estado est = new Estado(); EstadoDB estDB = new EstadoDB(); Classe cla = new Classe(); ClasseDB claDB = new ClasseDB(); Processo pro = new Processo(); ProcessoDB proDB = new ProcessoDB(); pro = proDB.Select(id); pes = pesDB.SelectGenerico(pro.PessoaCliente.Codigo); if (pes.Nivel == 3) { clifisico = clifisicoDB.Select(pes.Codigo); contato = contatoDB.SelectContato(clifisico.ContatoPessoa.Codigo); lblClienteDetalhes.Text = contato.Nome; } else if (pes.Nivel == 4) { clijuridico = clijuridicoDB.Select(pes.Codigo); contato = contatoDB.SelectContato(clijuridico.ContatoPessoa.Codigo); lblClienteDetalhes.Text = contato.Nome; } lblNumeroDetalhes.Text = pro.NumeroProcesso; lblDataCadastroDetalhes.Text = pro.DataCriacao.ToString("dd/MM/yyyy"); lblObservacaoDetalhes.Text = pro.Observacao; lblDescricaoDetalhes.Text = pro.Descricao; assunto = assuntoDB.Select(pro.Assunto.Codigo); lblAssuntoDetalhes.Text = assunto.Descricao; mov = movDB.Select(pro.Movimentacao.Codigo); lblMovDetalhes.Text = mov.Descricao; vara = varaDB.Select(pro.Vara.Codigo); lblVaraDetalhes.Text = vara.Descricao; pos = posDB.Select(pro.PosicaoCliente.Codigo); lblPosicaoDetalhes.Text = pos.Descricao; cla = claDB.Select(pro.Classe.Codigo); lblClasseDetalhes.Text = cla.Descricao; dataProcesso = dataDB.SelectByProcesso(id); if (dataProcesso != null) { lblDataAudiencia.Text = dataProcesso.DataAudiencia.ToString("dd/MM/yyyy"); lblHoraAudienciaDetalhes.Text = dataProcesso.DataAudiencia.ToString("t"); } if (pro.Recurso != null) { lblRecursoDetalhes.Text = "Sim"; recurso = recDB.Select(pro.Recurso.Codigo); rec = recDB.SelectCamara(recurso.CodigoCamara); lblCamaraDetalhes.Text = rec.Camara; rec = recDB.SelectTribunal(recurso.CodigoTribunal); lblTribunalDetalhes.Text = rec.Tribunal; } else { lblRecursoDetalhes.Text = "Não"; } cid = cidDB.SelectCidadePessoa(pro.Comarca.Codigo); lblComarcaDetalhes.Text = cid.NomeCidade; est = estDB.SelectEstado(cid.Estado.Codigo); lblEstado.Text = est.Descricao; }