Update 1.5.0.10

This commit is contained in:
2022-03-10 14:22:04 +01:00
parent d9895bdfad
commit f37abea441
38 changed files with 619186 additions and 98 deletions

View File

@@ -69,8 +69,8 @@ public class clsDB
}
}
public DataSet Get_Tabledata(int sqlscriptnumber, string vereinnr, int userid)
{
Get_Tabledata("Select sqlscript from sqlqueries where sqlscriptnumber=" + sqlscriptnumber.ToString(),false,true);
{
Get_Tabledata("Select sqlscript from sqlqueries where sqlscriptnumber=" + sqlscriptnumber.ToString(), false, true);
string sql = dsdaten.Tables[0].Rows[0][0].ToString();
dsdaten.Tables.Clear();
sql = sql.Replace("@vereinnr", vereinnr);
@@ -199,7 +199,7 @@ public class clsDB
// Menutype = 3 Then
// sqlcmd.CommandText = "Select * from web_menu where mandanttype>=" + mandanttyp.ToString + " and aktiv=1 and menutext<>'Schüler' and ( menutype=10 or menutype=1 or menutype = " + Menutype.ToString + ") order by menutype, sort"
// Else
if (loggedoffmenu==true)
if (loggedoffmenu == true)
{
sqlcmd.CommandText = "Select * from web_menu where aktiv=1 and ( menutype=100 or menutype=1 or menutype = " + Menutype.ToString() + ") order by menutype, sort";
@@ -412,14 +412,14 @@ public class clsDB
}
catch (Exception ex)
{
}
finally
{
if (myConnection.State == ConnectionState.Open)
myConnection.Close();
}
}
public void truncate_table(string tablename)
@@ -449,7 +449,7 @@ public class clsDB
{
SqlConnection myConnection = new SqlConnection(this.Connectionstring);
SqlCommand myCommand = new SqlCommand("[dbo].[Migrate_TAF_Import]", myConnection);
// if (deldata == "False") ortnr = "0";
// if (deldata == "False") ortnr = "0";
myCommand.Parameters.Add(new SqlParameter("@ortnr", SqlDbType.Int, 3, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, ortnr));
myCommand.Parameters.Add(new SqlParameter("@return", SqlDbType.Int, 3, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, 0));
myCommand.Parameters.Add(new SqlParameter("@statistics", SqlDbType.VarChar, 8096, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, ""));
@@ -463,7 +463,7 @@ public class clsDB
}
catch (Exception ex)
{
return "Fehler:"+ex.Message;
return "Fehler:" + ex.Message;
}
finally
{
@@ -477,7 +477,7 @@ public class clsDB
truncate_table("base_account_import");
String Filter = ConfigurationSettings.AppSettings["VereinFilter"];
string[] filters = Filter.Split(',');
Get_Tabeldata_for_Update ("Select * from base_account_import",false,true);
Get_Tabeldata_for_Update("Select * from base_account_import", false, true);
DataSet verein = new DataSet();
verein.ReadXml(targetfolder + "\\verein.xml");
foreach (DataRow r in verein.Tables[0].Rows)
@@ -485,7 +485,7 @@ public class clsDB
DataRow rn = dsdaten.Tables[0].NewRow();
Boolean useit;
useit = false;
foreach(var filt in filters)
foreach (var filt in filters)
{
if (r["accountcode"].ToString().IndexOf(filt) > 0) useit = true;
@@ -493,12 +493,12 @@ public class clsDB
if (useit == true)
{
rn["account_code"] = r["accountCode"];
rn["account_name"] = r["accountName"];
rn["account_short"] = r["accountShort"];
rn["account_type"] = r["accountType"];
rn["lg"] = r["lg"];
dsdaten.Tables[0].Rows.Add(rn);
rn["account_code"] = r["accountCode"];
rn["account_name"] = r["accountName"];
rn["account_short"] = r["accountShort"];
rn["account_type"] = r["accountType"];
rn["lg"] = r["lg"];
dsdaten.Tables[0].Rows.Add(rn);
}
}
@@ -518,15 +518,15 @@ public class clsDB
foreach (DataRow r in unicodes.Rows)
{
int ascii = (int)c;
if (ascii == Convert.ToInt32(r[0]))
{
res1 = r[1].ToString();
}
}
if (res1=="")
{
if (res1 == "")
{
res = res + c.ToString();
}
else
@@ -561,7 +561,7 @@ public class clsDB
}
if (useit == true)
{
Get_Tabeldata_for_Update("Select * from base_athlete where license=" + r["license"].ToString(), false, true);
if (dsdaten.Tables[0].Rows.Count == 0)
{
@@ -576,11 +576,11 @@ public class clsDB
// r["Lastname"] = decoded;
//}
r["lastname"] = get_unicode(r["lastname"].ToString(),unicodes);
r["firstname"] = get_unicode(r["firstname"].ToString(),unicodes);
r["lastname"] = get_unicode(r["lastname"].ToString(), unicodes);
r["firstname"] = get_unicode(r["firstname"].ToString(), unicodes);
rn["lastname"] = r["lastname"];
rn["firstname"] = r["firstname"];
rn["birth_date"] = r["birthdate"].ToString().Substring(3,2)+"."+ r["birthdate"].ToString().Substring(0, 2) + "."+r["birthdate"].ToString().Substring(6, 4);
rn["birth_date"] = r["birthdate"].ToString().Substring(3, 2) + "." + r["birthdate"].ToString().Substring(0, 2) + "." + r["birthdate"].ToString().Substring(6, 4);
rn["sex"] = r["sex"];
rn["nationality"] = r["nationality"];
rn["account_code"] = r["accountcode"];
@@ -595,25 +595,25 @@ public class clsDB
else
{
DataRow rn = dsdaten.Tables[0].NewRow();
//string a = "";
//ASCIIEncoding ascii = new ASCIIEncoding();
//Byte[] bytes = ascii.GetBytes(r["Lastname"].ToString());
//String decoded = ascii.GetString(bytes);
//if (decoded.IndexOf("o?in")>-1)
//{
// decoded = decoded.Replace("o?in", "ošin");
// r["Lastname"] = decoded;
//}
//string a = "";
//ASCIIEncoding ascii = new ASCIIEncoding();
//Byte[] bytes = ascii.GetBytes(r["Lastname"].ToString());
//String decoded = ascii.GetString(bytes);
//if (decoded.IndexOf("o?in")>-1)
//{
// decoded = decoded.Replace("o?in", "ošin");
// r["Lastname"] = decoded;
//}
if (r["License"].ToString() == "173471")
{
string a = "";
}
r["lastname"] = get_unicode(r["lastname"].ToString(),unicodes);
r["firstname"] = get_unicode(r["firstname"].ToString(),unicodes);
r["lastname"] = get_unicode(r["lastname"].ToString(), unicodes);
r["firstname"] = get_unicode(r["firstname"].ToString(), unicodes);
dsdaten.Tables[0].Rows[0]["lastname"] = r["lastname"];
dsdaten.Tables[0].Rows[0]["firstname"] = r["firstname"];
dsdaten.Tables[0].Rows[0]["birth_date"] = r["birthdate"].ToString().Substring(3, 2) + "." + r["birthdate"].ToString().Substring(0, 2) + "." + r["birthdate"].ToString().Substring(6, 4); ;
dsdaten.Tables[0].Rows[0]["sex"] = r["sex"];
@@ -717,4 +717,43 @@ public class clsDB
return dsdaten.Tables[0].Rows[0][0].ToString();
}
public void merge_athlete(int id_athlete, int teilnehmernr, string lizenz)
{
Get_Tabeldata_for_Update("Select * from teilnehmer where teilnehmernr=" + teilnehmernr.ToString(), false, true);
DataRow r = dsdaten.Tables[0].Rows[0];
r["base_lizenz"] = lizenz;
Update_Tabeldata();
}
public int zusammenlegung(string verein)
{
SqlConnection myConnection = new SqlConnection(this.Connectionstring);
SqlCommand myCommand = new SqlCommand("dbo.sp_mergeathleten", myConnection);
myCommand.Parameters.Add("@fnkt", SqlDbType.Int, 4);
myCommand.Parameters.Add("@Verein", SqlDbType.VarChar, 255);
myCommand.Parameters[0].Value = 0;
myCommand.Parameters[1].Value = verein;
myCommand.CommandType = CommandType.StoredProcedure;
myCommand.CommandTimeout = 600;
SqlDataAdapter da = new SqlDataAdapter(myCommand);
dsdaten.Tables.Clear();
try
{
myConnection.Open();
da.Fill(dsdaten, "Daten");
//myCommand.ExecuteNonQuery();
}
catch (Exception ex)
{
return 0;
}
finally
{
if (myConnection.State == ConnectionState.Open)
myConnection.Close();
}
return dsdaten.Tables[0].Rows.Count;
}
}