private void btnEnregistrer_Click_1(object sender, EventArgs e) { Facture f = RecopieViewFacture(); if (f.Control()) { if (!f.Update) { Facture f_ = new BLL.FactureBll(f).Insert(); if ((f_ != null) ? f_.Id > 0 : false) { f.Id = f_.Id; f.Update = true; fact.Id = f_.Id; AddCurrentFacture(f); fact.Update = true; Messages.Succes(); } } else { if (new BLL.FactureBll(f).Update()) { f.Update = true; UpdateCurrentFacture(f); fact.Update = true; Messages.Succes(); } } } }
private void btnEnregistrer_Click(object sender, EventArgs e) { //sauvegarde nouvelle facture //Facture fa = new Facture(); //fa.Categorie = new CategorieComptable(); //fa.Client = clientZero; //fa.DocumentLie = new Facture(); //fa.Entete = new Entete(); //fa.HeureDoc = DateTime.Now; ////fa.MontantAvance = new CategorieComptable(); ////fact.NumDoc = TOOLS.Utils.GenererReference(TOOLS.Constantes.DOC_FACTURE); //Facture f = new BLL.FactureBll(fact).Insert(); //fact.Id = f.Id; Facture f = RecopieViewFacture(); if (f.Control()) { if (!f.Update) { Facture f_ = new BLL.FactureBll(f).Insert(); if ((f_ != null) ? f_.Id > 0 : false) { f.Id = f_.Id; f.Update = true; fact.Id = f_.Id; AddCurrentFacture(f); fact.Update = true; Messages.Succes(); } } else { if (new BLL.FactureBll(f).Update()) { f.Update = true; UpdateCurrentFacture(f); fact.Update = true; Messages.Succes(); } } } }