/// <summary> /// Edite la commande en fonction du type /// après retour du service intermag /// </summary> /// <param name="doPieceOrigin">N° de l'ABC qui a été envoyé au founisseur</param> /// <param name="magPiece"></param> /// <param name="ds"></param> /// <param name="targetDb"></param> /// <param name="typeIndex"></param> private void editCde(string doPieceOrigin, string magPiece, DataSet ds, string targetDb, int typeIndex) { try { if (openBaseCial() == false) { throw new Exception("Connexion à la base impossible"); } IBODocumentAchat3 docAOrigin = GetInstance().FactoryDocumentAchat.ReadPiece( DocumentType.DocumentTypeAchatCommandeConf, doPieceOrigin ); // Vérouille le doc docAOrigin.CouldModified(); if (typeIndex == 0) { editCommandeDepot(docAOrigin, magPiece); } else if (typeIndex == 1) { editCommandeRetro(docAOrigin, magPiece, targetDb); } } catch (Exception e) { throw new Exception(e.ToString()); } }
public bool DocumentIsClosed(string doPiece) { openBaseCial(); IBODocumentAchat3 docA = GetInstance().FactoryDocumentAchat.ReadPiece(DocumentType.DocumentTypeAchatCommandeConf, doPiece); docA.CouldModified(); return(true); }
public bool DocumentIsClosed(string DoPiece) { if (openBaseCial()) { try { _OMDocument.CouldModified(); } catch (Exception) { throw new Exception($"Veuillez fermer le document {DoPiece}"); } } return(true); }
/// <summary> /// Vérifie que le doc en cours ainsi que lees éventuels docs /// liés ne sont pas en cours d'utilisation /// </summary> /// <param name="CmLignes"></param> /// <param name="doPiece"></param> /// <returns></returns> public bool DocumentIsClosed(Collection <Contremarque> CmLignes, string doPiece) { if (openBaseCial()) { try { var doc = (IBODocumentVente3)GetDocument(doPiece); doc.CouldModified(); // Sinon le doc reste ouvert pour OM doc.Write(); } catch (Exception) { throw new Exception($"Veuillez fermer le document {doPiece}"); } foreach (Contremarque cm in CmLignes) { if (cm.Liaisons != null) { foreach (LiaisonCde li in cm.Liaisons) { if (li.Qte > 0) { try { IBODocumentAchat3 doc = GetInstance().FactoryDocumentAchat.ReadPiece(DocumentType.DocumentTypeAchatCommandeConf, li.NumPiece); doc.CouldModified(); // TODO doc.Read() doc.Write(); } catch (Exception) { throw new Exception($"Veuillez fermer le document {li.NumPiece}"); } } } } } } return(true); }
public bool DocumentIsClosed(string doPiece) { if (openBaseCial()) { try { IBODocumentAchat3 doc = GetInstance().FactoryDocumentAchat.ReadPiece(DocumentType.DocumentTypeAchatCommandeConf, doPiece); doc.CouldModified(); // Sinon le doc reste ouvert pour OM doc.Write(); } catch (Exception) { throw new Exception($"Veuillez fermer le document {doPiece}"); } } return(true); }