[feat:] csv export (no adpac)
This commit is contained in:
@@ -33,6 +33,35 @@ public class KasAddressList //Address-Set
|
||||
this.owner_id = owner_id;
|
||||
}
|
||||
|
||||
public async Task<string> GenerateCSV()
|
||||
{
|
||||
var customer = Customer.GetCustomerByID(owner_id);
|
||||
// using adpac
|
||||
string result = "";
|
||||
string sep = customer.separator + " ";
|
||||
if(customer.patch == null)
|
||||
{
|
||||
result = $"refsid{sep} anrede{sep} titel{sep} vorname{sep} adel{sep} name{sep} namezus{sep} anredzus{sep} strasse{sep} strasse2{sep} plz{sep} ort{sep} land{sep} pplz{sep} postfach{sep} name1{sep} name2{sep} name3{sep} name4{sep} name5{sep} funktion{sep} funktion2{sep} abteilung{sep} funktionad{sep} lastupdate\n";
|
||||
}
|
||||
foreach(var item in KasPersons)
|
||||
{
|
||||
|
||||
if(customer.patch != null) // Fall 1: adpac
|
||||
{
|
||||
// Fall 1: adpac
|
||||
} else // Fall 2: kein adpac:
|
||||
{
|
||||
// refsid anrede titel vorname adel name namezus anredzus strasse strasse2 plz ort land pplz postfach name1 name2 name3 name4 name5 funktion funktion2 abteilung funktionad lastupdate
|
||||
result += item.refsid + sep + item.anrede+ sep + item.titel+ sep + item.vorname+ sep + item.adel+ sep + item.name+ sep + item.namezus+ sep + item.anredzus+ sep + item.strasse+ sep + item.strasse2+ sep + item.plz+ sep + item.ort+ sep + item.land+ sep + item.pplz+ sep + item.postfach+ sep + item.name1+ sep + item.name2+ sep + item.name3+ sep + item.name4+ sep + item.name5+ sep + item.funktion+ sep + item.funktion2+ sep + item.abteilung+ sep + item.funktionad+ sep + "null\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async Task<string> GenerateName(string basic_type, bool? is_rest = false)
|
||||
{
|
||||
string pre = "";
|
||||
|
||||
Reference in New Issue
Block a user