public void setCustomers(SAPWS.ZFSS_S_MUSTERI[] E) { Domino.NotesDocumentClass doc; Domino.NotesDatabaseClass database = (Domino.NotesDatabaseClass)session.GetDatabase("", DB_CUSTOMER, false); for (int n = 0; n < E.Length; n++) { Domino.NotesDocumentCollectionClass docs = (Domino.NotesDocumentCollectionClass)database.Search("Kunden_Nummer = '" + Sap.shiftLeft(E[n].KUNNR, "0") + "'", null, 99999); if (E[n].CHANGE_IND == "I" && (docs == null || docs.Count <= 0)) { doc = (Domino.NotesDocumentClass)database.CreateDocument(); doc.AppendItemValue("FORM", "Kunde"); doc.AppendItemValue("Kunden_Nummer", Sap.shiftLeft(E[n].KUNNR, "0")); doc.AppendItemValue("txtkdnr", Sap.shiftLeft(E[n].KUNNR, "0")); doc.AppendItemValue("Suchname", E[n].NAME1); doc.AppendItemValue("txtkdkrzbez", E[n].NAME1); doc.AppendItemValue("CompanyCity", E[n].BEZEI); doc.AppendItemValue("State", E[n].VKBEZ); doc.AppendItemValue("CompanyMainZIP", E[n].BRTXT); doc.AppendItemValue("CompanyAddress", E[n].STRAS + " " + E[n].PSTLZ + " " + E[n].ORT01); doc.AppendItemValue("SalesGroup", Sap.shiftLeft(E[n].PERNR_Y2, "0")); doc.AppendItemValue("SalesGroupTemp", Sap.shiftLeft(E[n].PERNR_Y2, "0")); doc.AppendItemValue("TSRVan", E[n].VORNA_Y2 + " " + E[n].NACHN_Y2); doc.AppendItemValue("TSRName", E[n].VORNA_Y2 + " " + E[n].NACHN_Y2); doc.AppendItemValue("Region", SAP_TERRITORY); doc.AppendItemValue("BodySymbol", 0); doc.AppendItemValue("SalesOffice", SAP_TERRITORY); doc.AppendItemValue("SalesOfficeTemp", SAP_TERRITORY); doc.AppendItemValue("SAPStatus", "No"); doc.AppendItemValue("SAPTerritory", "NO"); doc.AppendItemValue("SAPTSRID", "0101"); doc.AppendItemValue("TeamReaderStandAlone", TEAM_READER_STAND_ALONE); doc.AppendItemValue("ReadAll", READ_ALL); doc.Save(false, false, false); } else if ((E[n].CHANGE_IND == "I" && (docs != null && docs.Count > 0)) || (E[n].CHANGE_IND == "U")) { for (int m = 0; m < docs.Count; m++) { doc = (Domino.NotesDocumentClass)docs.GetNthDocument(m); doc.ReplaceItemValue("Kunden_Nummer", Sap.shiftLeft(E[n].KUNNR, "0")); doc.ReplaceItemValue("txtkdnr", Sap.shiftLeft(E[n].KUNNR, "0")); doc.ReplaceItemValue("Suchname", E[n].NAME1); doc.ReplaceItemValue("txtkdkrzbez", E[n].NAME1); doc.ReplaceItemValue("CompanyCity", E[n].BEZEI); doc.ReplaceItemValue("State", E[n].VKBEZ); doc.ReplaceItemValue("CompanyMainZIP", E[n].BRTXT); doc.ReplaceItemValue("CompanyAddress", E[n].STRAS + " " + E[n].PSTLZ + " " + E[n].ORT01); doc.ReplaceItemValue("SalesGroup", Sap.shiftLeft(E[n].PERNR_Y2, "0")); doc.ReplaceItemValue("SalesGroupTemp", Sap.shiftLeft(E[n].PERNR_Y2, "0")); doc.ReplaceItemValue("TSRVan", E[n].VORNA_Y2 + " " + E[n].NACHN_Y2); doc.ReplaceItemValue("TSRName", E[n].VORNA_Y2 + " " + E[n].NACHN_Y2); doc.Save(false, false, false); } } } }
public void setDispatchs(SAPWS.ZFSS_S_DISPATCH[] E, SAPWS.ZFSS_S_DISPATCH_TEXT[] T, SAPWS.ZFSS_S_DISPATCH_Z7[] Z7, SAPWS.ZFSS_S_DISPATCH_EQUIPMENT[] DE) { String text; Domino.NotesDocumentClass doc; Domino.NotesDatabaseClass database = (Domino.NotesDatabaseClass)session.GetDatabase("", DB_DISPATCH, false); for (int n = 0; n < E.Length; n++) { Domino.NotesDocumentCollectionClass docs = (Domino.NotesDocumentCollectionClass)database.Search("numeanr = '" + Sap.shiftLeft(E[n].AUFNR, "0") + "'", null, 99999); if (E[n].CHANGE_IND == "I" && (docs == null || docs.Count <= 0)) { // Parent Dispatch doc = (Domino.NotesDocumentClass)database.CreateDocument(); appendDispatchFields(ref doc, E[n], T, Z7, DE, DISPATCH_TYPE.PARENT, database); doc.Save(true, true, true); // Child Dispatch doc = (Domino.NotesDocumentClass)database.CreateDocument(); appendDispatchFields(ref doc, E[n], T, Z7, DE, DISPATCH_TYPE.CHILD, database); doc.Save(true, true, true); } else if ((E[n].CHANGE_IND == "I" && (docs != null && docs.Count > 0)) || (E[n].CHANGE_IND == "U")) { for (int m = 0; m < docs.Count; m++) { doc = (Domino.NotesDocumentClass)docs.GetNthDocument(m); switch (getItemValue(doc, "FORM")) { case DISPATCH_PARENT_FORM: replaceDispatchFields(ref doc, E[n], T, Z7, DE, DISPATCH_TYPE.PARENT); doc.Save(true, true, true); break; case DISPATCH_CHILD_FORM: replaceDispatchFields(ref doc, E[n], T, Z7, DE, DISPATCH_TYPE.CHILD); doc.Save(true, true, true); break; } } } } }
public void setMaterials(SAPWS.ZFSS_S_MALZEME[] E) { Domino.NotesDocumentClass doc; Domino.NotesDatabaseClass database = (Domino.NotesDatabaseClass)session.GetDatabase("", DB_MATERIAL, false); for (int n = 0; n < E.Length; n++) { Domino.NotesDocumentCollectionClass docs = (Domino.NotesDocumentCollectionClass)database.Search("txtartsachnr = '" + Sap.shiftLeft(E[n].MATNR, "0") + "'", null, 99999); if (E[n].CHANGE_IND == "I" && (docs == null || docs.Count <= 0)) { doc = (Domino.NotesDocumentClass)database.CreateDocument(); doc.AppendItemValue("FORM", "frm_art"); doc.AppendItemValue("txtartsachnr", Sap.shiftLeft(E[n].MATNR, "0")); doc.AppendItemValue("numartme", E[n].MEINS); doc.AppendItemValue("txtartbenenn", E[n].MAKTX); doc.AppendItemValue("txtarterzeuggruppe", E[n].MATKL); doc.AppendItemValue("Bcrit", E[n].XCHPF == "X" ? "Yes" : "No"); doc.AppendItemValue("BodySymbol", 0); doc.AppendItemValue("SAPTerritory", SAP_TERRITORY); doc.AppendItemValue("txtartleihgeraet", "0"); doc.Save(false, false, false); } else if ((E[n].CHANGE_IND == "I" && (docs != null && docs.Count > 0)) || (E[n].CHANGE_IND == "U")) { for (int m = 0; m < docs.Count; m++) { doc = (Domino.NotesDocumentClass)docs.GetNthDocument(m); doc.ReplaceItemValue("FORM", "frm_art"); doc.ReplaceItemValue("txtartsachnr", Sap.shiftLeft(E[n].MATNR, "0")); doc.ReplaceItemValue("numartme", E[n].MEINS); doc.ReplaceItemValue("txtartbenenn", E[n].MAKTX); doc.ReplaceItemValue("txtarterzeuggruppe", E[n].MATKL); doc.ReplaceItemValue("Bcrit", E[n].XCHPF == "X" ? "Yes" : "No"); doc.ReplaceItemValue("BodySymbol", 0); doc.ReplaceItemValue("SAPTerritory", SAP_TERRITORY); doc.ReplaceItemValue("txtartleihgeraet", "0"); doc.Save(false, false, false); } } } }
public void setEquipments(SAPWS.ZFSS_S_EQUIPMENT[] E) { Domino.NotesDocumentClass doc; Domino.NotesDatabaseClass database = (Domino.NotesDatabaseClass)session.GetDatabase("", DB_EQUIPMENT, false); for (int n = 0; n < E.Length; n++) { //txtkdnr Domino.NotesDocumentCollectionClass docs = (Domino.NotesDocumentCollectionClass)database.Search("numeqnr = '" + Sap.shiftLeft(E[n].EQUNR, "0") + "'", null, 99999); if (E[n].CHANGE_IND == "I" && (docs == null || docs.Count <= 0)) { doc = (Domino.NotesDocumentClass)database.CreateDocument(); doc.AppendItemValue("FORM", "frm_eq"); //doc.AppendItemValue("KundenInfo", "KK KundenInfo"); doc.AppendItemValue("numeqicon", "78"); doc.AppendItemValue("numeqnr", Sap.shiftLeft(E[n].EQUNR, "0")); doc.AppendItemValue("numsort", "2"); doc.AppendItemValue("txtartbenenn", E[n].EQKTX); doc.AppendItemValue("txtkdnr", Sap.shiftLeft(E[n].PARNR, "0")); doc.AppendItemValue("txtfabriknr", Sap.shiftLeft(E[n].SERNR, "0")); doc.AppendItemValue("txtartsachnr", Sap.shiftLeft(E[n].MATNR, "0")); doc.AppendItemValue("txtartpkid", getMaterialPmsId(Sap.shiftLeft(E[n].MATNR, "0"))); doc.AppendItemValue("numsvnr", Sap.shiftLeft(E[n].ZZVBELN, "0")); doc.AppendItemValue("txtkdkrzbez", E[n].NAME1); doc.AppendItemValue("dateqinbetriebnahme", E[n].DRTBAS); doc.AppendItemValue("dateqgarantieende", E[n].DRTBTS); doc.AppendItemValue("txtsvstatus", parseSapDate(E[n].ZZVNDAT)); doc.AppendItemValue("dateqletztewartung", parseSapDate(E[n].ZZLASTDATE)); doc.AppendItemValue("txtkdinventarnr", E[n].ZZEXTWG); doc.AppendItemValue("txtBillingPartnerNo", E[n].Y2TEKNIK); doc.AppendItemValue("ReadAll", READ_ALL); doc.AppendItemValue("TeamReaderStandAlone", TEAM_READER_STAND_ALONE); doc.AppendItemValue("SalesOfficeTemp", SAP_TERRITORY); doc.Save(false, false, false); } else if ((E[n].CHANGE_IND == "I" && (docs != null && docs.Count > 0)) || (E[n].CHANGE_IND == "U")) { for (int m = 0; m < docs.Count; m++) { doc = (Domino.NotesDocumentClass)docs.GetNthDocument(m); doc.ReplaceItemValue("FORM", "frm_eq"); doc.ReplaceItemValue("numeqicon", "78"); doc.ReplaceItemValue("numsort", "2"); doc.ReplaceItemValue("numeqnr", Sap.shiftLeft(E[n].EQUNR, "0")); doc.ReplaceItemValue("txtartbenenn", E[n].EQKTX); doc.ReplaceItemValue("txtkdnr", Sap.shiftLeft(E[n].PARNR, "0")); doc.ReplaceItemValue("txtfabriknr", Sap.shiftLeft(E[n].SERNR, "0")); doc.ReplaceItemValue("txtartsachnr", Sap.shiftLeft(E[n].MATNR, "0")); doc.ReplaceItemValue("txtartpkid", getMaterialPmsId(Sap.shiftLeft(E[n].MATNR, "0"))); doc.ReplaceItemValue("numsvnr", Sap.shiftLeft(E[n].ZZVBELN, "0")); doc.ReplaceItemValue("dateqletztewartung", E[n].ZZLASTDATE); doc.ReplaceItemValue("dateqinbetriebnahme", E[n].DRTBAS); doc.ReplaceItemValue("dateqgarantieende", E[n].DRTBTS); doc.ReplaceItemValue("txtkdkrzbez", E[n].NAME1); doc.ReplaceItemValue("txtsvstatus", E[n].ZZVNDAT); doc.ReplaceItemValue("txtkdinventarnr", Sap.shiftLeft(E[n].ZZEXTWG, "0")); doc.ReplaceItemValue("txtBillingPartnerNo", Sap.shiftLeft(E[n].Y2TEKNIK, "0")); //doc.ReplaceItemValue("ReadAll", READ_ALL); //doc.ReplaceItemValue("TeamReaderStandAlone", TEAM_READER_STAND_ALONE); //doc.ReplaceItemValue("SalesOfficeTemp", SAP_TERRITORY); doc.Save(false, false, false); } } } }