private void createMatter(soti.Sapservice.ZLAW_S_MATTERI M) { try { manager.CreateMatter(M.MATNO, M.MATNM, M.KUNNR); } catch (Exception ex) { if (isMatterDuplicate(ex)) { updateMatter(M); return; } if (isClientMissing(ex)) { createClient(extractClientFromMatter(M)); createMatter(M); return; } appendErrorObjectToLog(M, "Update"); throw ex; } }
private soti.Sapservice.ZLAW_S_CUSTOMERI extractClientFromMatter(soti.Sapservice.ZLAW_S_MATTERI M) { soti.Sapservice.ZLAW_S_CUSTOMERI c = new soti.Sapservice.ZLAW_S_CUSTOMERI(); c.ACTIO = "I"; c.KUNNR = M.KUNNR; c.NAME1 = M.NAME1; c.ONAM1 = M.ONAM1; c.ONAM2 = M.ONAM2; return(c); }
private void deleteMatter(soti.Sapservice.ZLAW_S_MATTERI M) { try { manager.DeleteMatter(M.MATNO); } catch (Exception ex) { appendErrorObjectToLog(M, "Delete"); } }
private void updateMatter(soti.Sapservice.ZLAW_S_MATTERI M) { try { manager.UpdateClientOfMatter(M.MATNO, M.KUNNR); } catch (Mind2Biz.DM.ClientMatter.DuplicatedRecordException) { // Buraya düþtüysek, aslýnda herþey yolundadýr } catch (Exception ex) { if (isMatterMissing(ex)) { createMatter(M); } else if (isClientMissing(ex)) { createClient(extractClientFromMatter(M)); updateMatter(M); } else { appendErrorObjectToLog(M, "Update"); throw ex; } } try { manager.UpdateMatterName(M.MATNO, M.MATNM); } catch (Exception ex) { if (isMatterMissing(ex)) { createMatter(M); } else if (isClientMissing(ex)) { createClient(extractClientFromMatter(M)); updateMatter(M); } else { appendErrorObjectToLog(M, "Update"); throw ex; } } }
private void appendErrorObjectToLog(soti.Sapservice.ZLAW_S_MATTERI M, string Operation) { appendErrorObjectToLog("Matter", M.MATNO, M.MATNM, Operation); }