Sap ABAP Başlangıç kurulum
Asp.net Tabloların eşleme User aktiviteSap , Tablolar
#region ZBY_RFC_USER_AKTIVITE_TO_SAP
// Güncelleme işlemlerinde kullanılır
//Hata Kodu, Mesaj, ID
public Tuple
{
try
{
ZBY_S_DATA[] IT_DATA_NEW = new ZBY_S_DATA[dtIT_DATA_NEW.Rows.Count];
for (int i = 0; i < dtIT_DATA_NEW.Rows.Count; i++)
{
IT_DATA_NEW[i] = new ZBY_S_DATA();
IT_DATA_NEW[i].TABNAME = dtIT_DATA_NEW.Rows[i]["TABNAME"].ToString();
IT_DATA_NEW[i].FIELDNAME = dtIT_DATA_NEW.Rows[i]["FIELDNAME"].ToString();
IT_DATA_NEW[i].VALUE = dtIT_DATA_NEW.Rows[i]["VALUE"].ToString();
if (dtIT_DATA_NEW.Rows[i]["ROW"].ToString() != null)
IT_DATA_NEW[i].ROW = dtIT_DATA_NEW.Rows[i]["ROW"].ToString();
}
SERVICE srv = new SERVICE();
ZBY_RFC_USER_AKTIVITE ws = new ZBY_RFC_USER_AKTIVITE();
ZBY_RFC_USER_AKTIVITEResponse wsres = new ZBY_RFC_USER_AKTIVITEResponse();
ws.I_IP_NUMBER = I_IP_NUMBER;
ws.I_LINK = I_LINK;
ws.I_MENU_ID = I_MENU_ID;
ws.I_PROJE_NO = I_PROJE_NO;
ws.I_TO_SAP = "X";
ws.I_USER = I_USER;
ws.IT_DATA = IT_DATA;
ws.IT_DATA_NEW = IT_DATA_NEW;
ws.ET_RETURN = new ZBY_S_RETURN[0];
wsres = srv.ZBY_RFC_USER_AKTIVITE(ws);
string str = "";
for (int i = 0; i < wsres.ET_RETURN.Length; i++)
{
str += wsres.ET_RETURN[i].MESSAGETXT + "
";
}
if (Convert.ToInt32(wsres.E_HATA) > 0)
{
return new Tuple
}
else
{
return new Tuple
}
}
catch (Exception ex)
{
return new Tuple
}
}
#endregion
#region ZBY_RFC_USER_AKTIVITE_TO_SAP_ET
// Güncelleme işlemlerinde kullanılır
//Hata Kodu, Mesaj, ID
public Tuple
{
try
{
ZBY_S_DATA[] IT_DATA_NEW = new ZBY_S_DATA[dtIT_DATA_NEW.Rows.Count];
for (int i = 0; i < dtIT_DATA_NEW.Rows.Count; i++)
{
IT_DATA_NEW[i] = new ZBY_S_DATA();
IT_DATA_NEW[i].TABNAME = dtIT_DATA_NEW.Rows[i]["TABNAME"].ToString();
IT_DATA_NEW[i].FIELDNAME = dtIT_DATA_NEW.Rows[i]["FIELDNAME"].ToString();
IT_DATA_NEW[i].VALUE = dtIT_DATA_NEW.Rows[i]["VALUE"].ToString();
if (dtIT_DATA_NEW.Rows[i]["ROW"].ToString() != null)
IT_DATA_NEW[i].ROW = dtIT_DATA_NEW.Rows[i]["ROW"].ToString();
}
SERVICE srv = new SERVICE();
ZBY_RFC_USER_AKTIVITE ws = new ZBY_RFC_USER_AKTIVITE();
ZBY_RFC_USER_AKTIVITEResponse wsres = new ZBY_RFC_USER_AKTIVITEResponse();
ws.I_IP_NUMBER = I_IP_NUMBER;
ws.I_LINK = I_LINK;
ws.I_MENU_ID = I_MENU_ID;
ws.I_PROJE_NO = I_PROJE_NO;
ws.I_TO_SAP = "X";
ws.I_USER = I_USER;
ws.IT_DATA = IT_DATA;
ws.IT_DATA_NEW = IT_DATA_NEW;
ws.ET_DATA = new ZBY_S_DATA[0];
ws.ET_DATA_FK = new ZBY_S_DATA[0];
ws.ET_RETURN = new ZBY_S_RETURN[0];
wsres = srv.ZBY_RFC_USER_AKTIVITE(ws);
string str = "";
for (int i = 0; i < wsres.ET_RETURN.Length; i++)
{
str += wsres.ET_RETURN[i].MESSAGETXT + "
";
}
if (Convert.ToInt32(wsres.E_HATA) > 0)
{
return new Tuple
}
else
{
DataTable dtET_DATA = ZBY_SAP_DATA_ET_DATA(wsres);
DataTable dtET_DATA_FK = ZBY_SAP_DATA_ET_DATA_FK(wsres);
return new Tuple
}
}
catch (Exception ex)
{
return new Tuple
}
}
#endregion
#region ZBY_SAP_BINDDDL
// Gönderilen DropDownList kontrolüne değerleri bağlar
public void ZBY_SAP_BINDDDL(DataTable dtDefinitions, DataTable dtValues, DropDownList ddl, string KEY_VALUE, Page pg)
{
try
{
DataTable dt = new DataTable();
string TABNAME = "";
string FIELDNAME = "";
string SORT = "";
string ADDFIRSTROW = "";
DataRow[] dr = dtDefinitions.Select("KEY_VALUE = '" + KEY_VALUE + "'");
for (int i = 0; i < dr.Length; i++)
{
TABNAME = dr[i]["TABNAME"].ToString();
FIELDNAME = dr[i]["FIELDNAME"].ToString();
SORT = dr[i]["SORT"].ToString();
ADDFIRSTROW = dr[i]["ADDFIRSTROW"].ToString();
if (dtValues.Select("TABNAME = '" + TABNAME + "' AND FIELDNAME = '" + FIELDNAME + "' AND VALUE <> ''").Length > 0)
{
//TABNAME, KEY_VALUE, FIELDNAME, VALUE
dt = dtValues.Select("TABNAME = '" + TABNAME + "' AND FIELDNAME = '" + FIELDNAME + "' AND VALUE <> ''").CopyToDataTable();
break;
}
}
if (ADDFIRSTROW == "true")
dt.Rows.Add("", "", "", "--- Seçenekler ---");
dt.DefaultView.Sort = SORT;
ddl.DataSource = dt;
ddl.DataTextField = dt.Columns["VALUE"].ToString();
ddl.DataValueField = dt.Columns["KEY_VALUE"].ToString();
ddl.DataBind();
ddl.Enabled = true;
//ZBY_KAMPUS - KAMPUS_NO
if (KEY_VALUE == "KAMPUS_NO")
{
if (ddl.Items.Count == 2)
{
ddl.SelectedIndex = 1;
if (((DropDownList)pg.FindControl("ctl00$ContentPlaceHolder1$ddlBINA_NO")) != null)
{
DropDownList ddlBINA_NO = ((DropDownList)pg.FindControl("ctl00$ContentPlaceHolder1$ddlBINA_NO"));
if (ddlBINA_NO != null)
ZBY_SAP_BINDDDL(dtDefinitions, dtValues, ddlBINA_NO, "BINA_NO", pg);
}
else if (((DropDownList)pg.FindControl("ctl00$ContentPlaceHolder1$tc1$tp1$ddlBINA_NO")) != null)
{
DropDownList ddlBINA_NO = ((DropDownList)pg.FindControl("ctl00$ContentPlaceHolder1$tc1$tp1$ddlBINA_NO"));
if (ddlBINA_NO != null)
ZBY_SAP_BINDDDL(dtDefinitions, dtValues, ddlBINA_NO, "BINA_NO", pg);
}
// 13.12.2012
// SH'deki dropdownlar için konuldu
else if (((DropDownList)pg.FindControl("ddlBINA_NO")) != null)
{
DropDownList ddlBINA_NO = ((DropDownList)pg.FindControl("ddlBINA_NO"));
if (ddlBINA_NO != null)
ZBY_SAP_BINDDDL(dtDefinitions, dtValues, ddlBINA_NO, "BINA_NO", pg);
}
}
}
else if (KEY_VALUE == "BINA_NO")
{
if (ddl.Items.Count == 2)
{
ddl.SelectedIndex = 1;
if (((DropDownList)pg.FindControl("ctl00$ContentPlaceHolder1$ddlBLOK_NO")) != null)
{
DropDownList ddlBLOK_NO = ((DropDownList)pg.FindControl("ctl00$ContentPlaceHolder1$ddlBLOK_NO"));
if (ddlBLOK_NO != null)
ZBY_SAP_BINDDDL(dtDefinitions, dtValues, ddlBLOK_NO, "BLOK_NO", pg);
}
else if (((DropDownList)pg.FindControl("ctl00$ContentPlaceHolder1$tc1$tp1$ddlBLOK_NO")) != null)
{
DropDownList ddlBLOK_NO = ((DropDownList)pg.FindControl("ctl00$ContentPlaceHolder1$tc1$tp1$ddlBLOK_NO"));
if (ddlBLOK_NO != null)
ZBY_SAP_BINDDDL(dtDefinitions, dtValues, ddlBLOK_NO, "BLOK_NO", pg);
}
// 13.12.2012
// SH'deki dropdownlar için konuldu
else if (((DropDownList)pg.FindControl("ddlBLOK_NO")) != null)
{
DropDownList ddlBLOK_NO = ((DropDownList)pg.FindControl("ddlBLOK_NO"));
if (ddlBLOK_NO != null)
ZBY_SAP_BINDDDL(dtDefinitions, dtValues, ddlBLOK_NO, "BLOK_NO", pg);
}
}
}
//WAERS
else if (KEY_VALUE == "WAERS")
{
ddl.SelectedValue = "TRY";
}
}
catch
{
ddl.Items.Clear();
ddl.Enabled = false;
}
}
#endregion
#region ZBY_SAP_DATA_ET_DATA
// return ET_DATA as DataTable
public DataTable ZBY_SAP_DATA_ET_DATA(ZBY_RFC_USER_AKTIVITEResponse wsres)
{
try
{
DataTable dt = new DataTable();
DataRow row;
dt = ZBY_DATATABLE_ADDCOLUMN("TABNAME, KEY_VALUE, FIELDNAME, VALUE, CHECKTABLE, KEYFLAG, ROW", ",");
for (int i = 0; i < wsres.ET_DATA.Length; i++)
{
if (ZBY_TRIMSTARTZERO(wsres.ET_DATA[i].KEY_VALUE) != "")
{
row = dt.NewRow();
row["TABNAME"] = wsres.ET_DATA[i].TABNAME;
row["KEY_VALUE"] = ZBY_TRIMSTARTZERO(wsres.ET_DATA[i].KEY_VALUE);
row["FIELDNAME"] = wsres.ET_DATA[i].FIELDNAME;
row["VALUE"] = wsres.ET_DATA[i].VALUE;
row["CHECKTABLE"] = wsres.ET_DATA[i].CHECKTABLE;
row["KEYFLAG"] = wsres.ET_DATA[i].KEYFLAG;
row["ROW"] = wsres.ET_DATA[i].ROW;
//WEB tarafındaki tablolar için
if (row["FIELDNAME"].ToString() == "SPRAS")
row["CHECKTABLE"] = "dtSPRAS";
else if (row["FIELDNAME"].ToString() == "ISE_GIRIS")
row["CHECKTABLE"] = "dtISE_GIRIS";
else if (row["FIELDNAME"].ToString() == "MEDENI_DURUM")
row["CHECKTABLE"] = "dtMEDENI_DURUM";
else if (row["FIELDNAME"].ToString() == "SGR_BRK_ZMN_BRM")
row["CHECKTABLE"] = "dtZMN_BRM";
else if (row["FIELDNAME"].ToString() == "SGR_ICM_SRS_BRM")
row["CHECKTABLE"] = "dtZMN_BRM";
else if (row["FIELDNAME"].ToString() == "SIGORTA_TIPI")
row["CHECKTABLE"] = "dtSIGORTA_TIPI";
else if (row["FIELDNAME"].ToString() == "SOZLESME_TIPI")
row["CHECKTABLE"] = "dtSOZLESME_TIPI";
dt.Rows.Add(row);
}
}
return dt;
}
catch
{
DataTable dt = new DataTable();
return dt;
}
}
#endregion
#region ZBY_SAP_DATA_ET_DATA_FK
// return ET_DATA_FK as DataTable
public DataTable ZBY_SAP_DATA_ET_DATA_FK(ZBY_RFC_USER_AKTIVITEResponse wsres)
{
try
{
DataTable dt = new DataTable();
DataRow row;
dt = ZBY_DATATABLE_ADDCOLUMN("TABNAME, KEY_VALUE, FIELDNAME, VALUE, CHECKTABLE, KEYFLAG, ROW", ",");
for (int i = 0; i < wsres.ET_DATA_FK.Length; i++)
{
if (ZBY_TRIMSTARTZERO(wsres.ET_DATA_FK[i].KEY_VALUE) != "")
{
row = dt.NewRow();
row["TABNAME"] = wsres.ET_DATA_FK[i].TABNAME;
row["KEY_VALUE"] = ZBY_TRIMSTARTZERO(wsres.ET_DATA_FK[i].KEY_VALUE);
row["FIELDNAME"] = wsres.ET_DATA_FK[i].FIELDNAME;
row["VALUE"] = wsres.ET_DATA_FK[i].VALUE;
row["CHECKTABLE"] = wsres.ET_DATA_FK[i].CHECKTABLE;
row["KEYFLAG"] = wsres.ET_DATA_FK[i].KEYFLAG;
row["ROW"] = wsres.ET_DATA_FK[i].ROW;
dt.Rows.Add(row);
}
}
return dt;
}
catch
{
DataTable dt = new DataTable();
return dt;
}
}
#endregion
#region ZBY_SAP_DATA_ET_DATA_FORMAT
// return ET_DATA_FORMAT table
public DataTable ZBY_SAP_DATA_ET_DATA_FORMAT()
{
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("TABNAME", typeof(string)));
dt.Columns.Add(new DataColumn("FIELDNAME", typeof(string)));
dt.Columns.Add(new DataColumn("FIELDTYPE", typeof(string)));
dt.Columns.Add(new DataColumn("FIELDREPLACE", typeof(string)));
dt.Columns.Add(new DataColumn("FIELDCOPY", typeof(string)));
return dt;
}
#endregion
#region ZBY_SAP_DATA_GET_ET_DATA
public DataTable ZBY_SAP_DATA_GET_ET_DATA(DataTable dtET_DATA_FORMAT, DataTable dtET_DATA, DataTable dtET_DATA_FK, Boolean ISALLFIELDNAME)
{
DataTable dt = new DataTable();
DataRow dr = null;
#region SETTING TABLE COLUMNS
//ALL FIELDS
if (ISALLFIELDNAME)
{
foreach (DataRow drET_DATA in dtET_DATA.Rows)
{
if (drET_DATA["ROW"].ToString() == "0000")
{
if (!dt.Columns.Contains(drET_DATA["FIELDNAME"].ToString()))
dt.Columns.Add(new DataColumn(drET_DATA["FIELDNAME"].ToString(), typeof(string)));
else
break;
if (dtET_DATA_FORMAT != null)
{
DataRow[] drTEMP = dtET_DATA_FORMAT.Select("TABNAME = '" + drET_DATA["TABNAME"].ToString() + "' AND FIELDNAME = '" + drET_DATA["FIELDNAME"].ToString() + "'");
if (drTEMP.Length > 0)
{
if (drTEMP[0]["FIELDCOPY"].ToString() == "true")
{
dt.Columns.Add(new DataColumn("_" + drET_DATA["FIELDNAME"].ToString(), typeof(string)));
}
}
}
}
else
{
break;
}
}
}
//SELECTED FIELDS
else
{
foreach (DataRow row in dtET_DATA_FORMAT.Rows)
{
dt.Columns.Add(new DataColumn(row["FIELDNAME"].ToString(), typeof(string)));
if (row["FIELDCOPY"].ToString() == "true")
{
dt.Columns.Add(new DataColumn("_" + row["FIELDNAME"].ToString(), typeof(string)));
}
}
}
#endregion
#region FILL DATATABLE WITH FORMAT
int col = 0;
string KEY_VALUE = "";
try
{
KEY_VALUE = dtET_DATA.Rows[0]["KEY_VALUE"].ToString();
}
catch
{
return dt;
}
for (int i = 0; i < dtET_DATA.Rows.Count; i++)
{
if (col == 0)
{
dr = dt.NewRow();
}
if (KEY_VALUE == dtET_DATA.Rows[i]["KEY_VALUE"].ToString())
{
//ALL FIELDS
if (ISALLFIELDNAME)
{
if (dtET_DATA_FORMAT == null)
{
dtET_DATA_FORMAT = ZBY_SAP_DATA_ET_DATA_FORMAT();
}
DataRow[] drET_DATA_FORMAT = dtET_DATA_FORMAT.Select("TABNAME = '" + dtET_DATA.Rows[i]["TABNAME"].ToString() + "' AND FIELDNAME = '" + dtET_DATA.Rows[i]["FIELDNAME"].ToString() + "'");
if (drET_DATA_FORMAT.Length > 0)
{
if (drET_DATA_FORMAT[0]["FIELDREPLACE"].ToString() == "true")
{
if (ZBY_TRIMSTARTZERO(dtET_DATA.Rows[i]["VALUE"].ToString()) == "")
{
dr[dtET_DATA.Rows[i]["FIELDNAME"].ToString()] = ZBY_TRIMSTARTZERO(dtET_DATA.Rows[i]["VALUE"].ToString());
}
else
{
try
{
dr[dtET_DATA.Rows[i]["FIELDNAME"].ToString()] = dtET_DATA_FK.Select("TABNAME = '" + dtET_DATA.Rows[i]["CHECKTABLE"].ToString() + "' AND KEY_VALUE = '" + ZBY_TRIMSTARTZERO(dtET_DATA.Rows[i]["VALUE"].ToString()) + "'")[0]["VALUE"].ToString();
}
catch
{
dr[dtET_DATA.Rows[i]["FIELDNAME"].ToString()] = "SİLİNDİ - " + ZBY_TRIMSTARTZERO(dtET_DATA.Rows[i]["VALUE"].ToString()) + "";
}
}
}
else if (drET_DATA_FORMAT[0]["FIELDCOPY"].ToString() == "true")
{
if (drET_DATA_FORMAT[0]["FIELDTYPE"].ToString() == "date")
{
dr[dtET_DATA.Rows[i]["FIELDNAME"].ToString()] = ZBY_CONVERT_DATETOSTRING(dtET_DATA.Rows[i]["VALUE"].ToString());
dr["_" + dtET_DATA.Rows[i]["FIELDNAME"].ToString()] = dtET_DATA.Rows[i]["VALUE"].ToString();
}
else if (drET_DATA_FORMAT[0]["FIELDTYPE"].ToString() == "time")
{
dr[dtET_DATA.Rows[i]["FIELDNAME"].ToString()] = ZBY_CONVERT_TIMETOSTRING(dtET_DATA.Rows[i]["VALUE"].ToString());
dr["_" + dtET_DATA.Rows[i]["FIELDNAME"].ToString()] = dtET_DATA.Rows[i]["VALUE"].ToString();
}
else
{
dr[dtET_DATA.Rows[i]["FIELDNAME"].ToString()] = ZBY_TRIMSTARTZERO(dtET_DATA.Rows[i]["VALUE"].ToString());
if (ZBY_TRIMSTARTZERO(dtET_DATA.Rows[i]["VALUE"].ToString()) == "")
{
dr["_" + dtET_DATA.Rows[i]["FIELDNAME"].ToString()] = ZBY_TRIMSTARTZERO(dtET_DATA.Rows[i]["VALUE"].ToString());
}
else
{
try
{
dr["_" + dtET_DATA.Rows[i]["FIELDNAME"].ToString()] = dtET_DATA_FK.Select("TABNAME = '" + dtET_DATA.Rows[i]["CHECKTABLE"].ToString() + "' AND KEY_VALUE = '" + ZBY_TRIMSTARTZERO(dtET_DATA.Rows[i]["VALUE"].ToString()) + "'")[0]["VALUE"].ToString();
}
catch
{
dr["_" + dtET_DATA.Rows[i]["FIELDNAME"].ToString()] = "SİLİNDİ - " + ZBY_TRIMSTARTZERO(dtET_DATA.Rows[i]["VALUE"].ToString()) + "";
}
}
}
}
else
{
if (drET_DATA_FORMAT[0]["FIELDTYPE"].ToString() == "date")
{
dr[dtET_DATA.Rows[i]["FIELDNAME"].ToString()] = ZBY_CONVERT_DATETOSTRING(dtET_DATA.Rows[i]["VALUE"].ToString());
}
else if (drET_DATA_FORMAT[0]["FIELDTYPE"].ToString() == "time")
{
dr[dtET_DATA.Rows[i]["FIELDNAME"].ToString()] = ZBY_CONVERT_TIMETOSTRING(dtET_DATA.Rows[i]["VALUE"].ToString());
}
else
{
dr[dtET_DATA.Rows[i]["FIELDNAME"].ToString()] = ZBY_TRIMSTARTZERO(dtET_DATA.Rows[i]["VALUE"].ToString());
}
}
}
else
{
dr[dtET_DATA.Rows[i]["FIELDNAME"].ToString()] = ZBY_TRIMSTARTZERO(dtET_DATA.Rows[i]["VALUE"].ToString());
}
col++;
}
//SELECTED FIELDS
else
{
foreach (DataRow row in dtET_DATA_FORMAT.Rows)
{
if (dtET_DATA.Rows[i]["FIELDNAME"].ToString() == row["FIELDNAME"].ToString())
{
if (col == 0)
{
dr = dt.NewRow();
}
if (row["FIELDREPLACE"].ToString() == "true")
{
if (ZBY_TRIMSTARTZERO(dtET_DATA.Rows[i]["VALUE"].ToString()) == "")
{
dr[row["FIELDNAME"].ToString()] = "";
}
else
{
try
{
dr[row["FIELDNAME"].ToString()] = dtET_DATA_FK.Select("TABNAME = '" + dtET_DATA.Rows[i]["CHECKTABLE"].ToString() + "' AND KEY_VALUE = '" + ZBY_TRIMSTARTZERO(dtET_DATA.Rows[i]["VALUE"].ToString()) + "'")[0]["VALUE"].ToString();
}
catch
{
dr[row["FIELDNAME"].ToString()] = "SİLİNDİ - " + ZBY_TRIMSTARTZERO(dtET_DATA.Rows[i]["VALUE"].ToString()) + "";
}
}
}
else if (row["FIELDCOPY"].ToString() == "true")
{
if (row["FIELDTYPE"].ToString() == "date")
{
dr[row["FIELDNAME"].ToString()] = ZBY_CONVERT_DATETOSTRING(dtET_DATA.Rows[i]["VALUE"].ToString());
dr["_" + row["FIELDNAME"].ToString()] = dtET_DATA.Rows[i]["VALUE"].ToString();
}
else if (row["FIELDTYPE"].ToString() == "time")
{
dr[row["FIELDNAME"].ToString()] = ZBY_CONVERT_TIMETOSTRING(dtET_DATA.Rows[i]["VALUE"].ToString());
dr["_" + row["FIELDNAME"].ToString()] = dtET_DATA.Rows[i]["VALUE"].ToString();
}
else
{
dr[row["FIELDNAME"].ToString()] = ZBY_TRIMSTARTZERO(dtET_DATA.Rows[i]["VALUE"].ToString());
if (ZBY_TRIMSTARTZERO(dtET_DATA.Rows[i]["VALUE"].ToString()) == "")
{
dr["_" + row["FIELDNAME"].ToString()] = "";
}
else
{
try
{
dr["_" + row["FIELDNAME"].ToString()] = dtET_DATA_FK.Select("TABNAME = '" + dtET_DATA.Rows[i]["CHECKTABLE"].ToString() + "' AND KEY_VALUE = '" + ZBY_TRIMSTARTZERO(dtET_DATA.Rows[i]["VALUE"].ToString()) + "'")[0]["VALUE"].ToString();
}
catch
{
dr["_" + row["FIELDNAME"].ToString()] = "SİLİNDİ - " + ZBY_TRIMSTARTZERO(dtET_DATA.Rows[i]["VALUE"].ToString()) + "";
}
}
}
}
else
{
if (row["FIELDTYPE"].ToString() == "date")
{
dr[row["FIELDNAME"].ToString()] = ZBY_CONVERT_DATETOSTRING(dtET_DATA.Rows[i]["VALUE"].ToString());
}
else if (row["FIELDTYPE"].ToString() == "time")
{
dr[row["FIELDNAME"].ToString()] = ZBY_CONVERT_TIMETOSTRING(dtET_DATA.Rows[i]["VALUE"].ToString());
}
else
{
dr[row["FIELDNAME"].ToString()] = ZBY_TRIMSTARTZERO(dtET_DATA.Rows[i]["VALUE"].ToString());
}
//2013.09.12 Gazete Yayın Miktar alanı 0 problem
dr[row["FIELDNAME"].ToString()] = dr[row["FIELDNAME"].ToString()].ToString().TrimStart().TrimEnd();
}
col++;
}
}
}
}
else
{
dt.Rows.Add(dr);
KEY_VALUE = dtET_DATA.Rows[i]["KEY_VALUE"].ToString();
col = 0;
i--;
}
}
dt.Rows.Add(dr);
#endregion
return dt;
}
#endregion
#region ZBY_SAP_DATA_IT_DATA_NEW
// return IT_DATA_NEW as DataTable
public DataTable ZBY_SAP_DATA_IT_DATA_NEW()
{
try
{
DataTable dt = new DataTable();
dt = ZBY_DATATABLE_ADDCOLUMN("TABNAME, FIELDNAME, VALUE, ROW", ",");
return dt;
}
catch
{
DataTable dt = new DataTable();
return dt;
}
}
#endregion
#region ZBY_SAP_SITEMAP
public string ZBY_SAP_SITEMAP(DataTable dtMENU, string MENU_ID)
{
try
{
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("MENU_ID", typeof(string)));
dt.Columns.Add(new DataColumn("ADI", typeof(string)));
dt.Columns.Add(new DataColumn("MENU_URL", typeof(string)));
dt.Columns.Add(new DataColumn("PARENT_ID", typeof(string)));
DataTable dtTEMP = new DataTable();
dtTEMP.Columns.Add(new DataColumn("MENU_ID", typeof(string)));
dtTEMP.Columns.Add(new DataColumn("ADI", typeof(string)));
dtTEMP.Columns.Add(new DataColumn("MENU_URL", typeof(string)));
dtTEMP.Columns.Add(new DataColumn("PARENT_ID", typeof(string)));
int t = 0;
while (MENU_ID != "0000000001" && t < 10)
{
if (dtMENU.Select("MENU_ID = '" + MENU_ID + "'").Length > 0)
{
dtTEMP = dtMENU.Select("MENU_ID = '" + MENU_ID + "'").CopyToDataTable();
DataRow dr = dt.NewRow();
dr["MENU_ID"] = dtTEMP.Rows[0]["MENU_ID"].ToString();
dr["MENU_URL"] = dtTEMP.Rows[0]["MENU_URL"].ToString();
dr["ADI"] = dtTEMP.Rows[0]["ADI"].ToString();
dt.Rows.Add(dr);
MENU_ID = dtTEMP.Rows[0]["PARENT_ID"].ToString();
}
t++;
}
if (dt.Rows.Count > 1)
{
dt = dt.Select("", "MENU_ID").CopyToDataTable();
if (dt.Rows[0]["MENU_ID"].ToString() == "1000000000")
{
string strSITEMAP = "";
for (int i = 0; i < dt.Rows.Count - 1; i++)
{
strSITEMAP += "" + dt.Rows[i]["ADI"] + "";
}
strSITEMAP += "" + dt.Rows[dt.Rows.Count - 1]["ADI"] + "";
return strSITEMAP;
}
else
{
return "";
}
}
else
{
return "";
}
}
catch
{
return "";
}
}
#endregion
-------------------Sap Kayıt Ve Örnek Basit Proje Resim Arşiv---------------------------
Hiç yorum yok:
Yorum Gönder