private void SalvarCNCM_Clicked(object sender, EventArgs e) { String SvCodigo = InputCodCNCM.Text; CNCM CN = new CNCM(); CommandCncm CmdCncm = new CommandCncm(); CmdCncm.CriarBancoCNCM(); if (SvCodigo == "" || SvCodigo == null) { List <CNCM> LCncm = CmdCncm.GetMax(); int Cod = 1; if (LCncm.Count > 0) { Cod = LCncm[0].CodCNCM + 1; } CN.CodCNCM = Cod; } else { CN.CodCNCM = Convert.ToInt32(SvCodigo); } CN.Descricao = InputCNCM.Text; CN.CEST = InputCEST.Text; CmdCncm.InserirCNCM(CN); TabelaM(); }
public bool DeletarCNCMSQL(CNCM sql) { try { using (var conexao = new SQLiteConnection(System.IO.Path.Combine(pasta, "StfrenteAndroid.db"))) { conexao.Delete(sql); return(true); } } catch (SQLiteException ex) { String exs = ex.ToString(); return(false); } }
public bool InserirCNCM(CNCM SQLServ) { try { using (var conexao = new SQLiteConnection(System.IO.Path.Combine(pasta, "StfrenteAndroid.db"))) { conexao.InsertOrReplace(SQLServ); return(true); } } catch (SQLiteException ex) { String exs = ex.ToString(); return(false); } }