Masraf Talep SAP Connector

try {
	SapElements seq = null;
	SapFunction spFunction = sapHelper.GetElement("ZFIASB_MASTLM_GET_ONAYHIER");
	seq = spFunction.GetElement("PBUKRS");
	if (seq != null) seq.Value = (string) FormData.Get("SIRKET");
	seq = spFunction.GetElement("PMASTLD");
	seq.Detail.Clear();
	int i = 0;
	foreach(ITypes row in (System.Collections.IList) FormData.Get("KALEMLER")) 
	{
		SapTables spTable = new SapTables();
		SapFields s = seq.GetDetail("ONYDVZ");
		s.Value = (string) row.Get("DOVIZ_TURU");
		SapTableFields t = new SapTableFields(i++, s);
		spTable.Detail.Add(t);
		s = seq.GetDetail("KTOGR");
		s.Value = (string) row.Get("HESAP_BELIRLEME");
		t = new SapTableFields(i++, s);
		spTable.Detail.Add(t);
		s = seq.GetDetail("KOSTL");
		s.Value = (string) row.Get("MASRAF_YERI_KODU");
		t = new SapTableFields(i++, s);
		spTable.Detail.Add(t);
		s = seq.GetDetail("ONYDVZTUT");
		s.Value = (string) row.Get("KDV_DAHIL_TUTAR");
		t = new SapTableFields(i++, s);
		spTable.Detail.Add(t);
		s = seq.GetDetail("WRBTR");
		s.Value = (string) row.Get("KDV_HARIC_TUTARI");
		t = new SapTableFields(i++, s);
		spTable.Detail.Add(t);
		seq.Tables.Add(spTable);
	}
	seq = spFunction.GetElement("PTDATE");
	if (seq != null) seq.Value = (string) FormData.Get("TALEP_TARIHI_SAP");
	seq = spFunction.GetElement("PODMLOK");
	if (seq != null) seq.Value = (string) FormData.Get("LOKASYON");
	seq = spFunction.GetElement("PMASSBT");
	if (seq != null) seq.Value = (string) FormData.Get("TALEP_TURU");
	seq = spFunction.GetElement("PUSNAM");
	if (seq != null) seq.Value = (string) FormData.Get("TALEP_EDEN_USER");
	SapFunction sf = sapHelper.CallFunction(spFunction.ToXml());
	seq = sf.GetElement("PMASTLD");
	//((List < object > ) FormData.Get("ONAY_KULLANICILARI")).Clear();
	FormData.DeleteAllRow("ONAY_KULLANICILARI");
	int posout = seq.Tables.Count();
	for (int j = 0; j < posout; j++) {
	ITypes row = FormData.getNewRow("ONAY_KULLANICILARI");
	SapTables spTable = seq.Tables[i];
	foreach(SapFields s in seq.Detail) {
	object value = null;
	value = spTable.GetValue("USNAM1");
	if (value != null) row.Set("ONAY_1", value);
	value = spTable.GetValue("USNAM2");
	if (value != null) row.Set("ONAY_2", value);
	value = spTable.GetValue("USNAM3");
	if (value != null) row.Set("ONAY_3", value);
	value = spTable.GetValue("USNAM4");
	if (value != null) row.Set("ONAY_4", value);
	value = spTable.GetValue("USNAM5");
	if (value != null) row.Set("ONAY_5", value);
	value = spTable.GetValue("USNAM6");
	if (value != null) row.Set("ONAY_6", value);
	FormData.AddRepRow("ONAY_KULLANICILARI", row);
	}
	}
	FormData.Set("SAPCONNRESULT", "");
} catch (Exception ex) {
 FormData.Set("SAPCONNRESULT", "");
 Log(ex.Message);
 throw ex;
}

 

No comment

Bir cevap yazın

E-posta hesabınız yayımlanmayacak.