update 20241127
This commit is contained in:
@@ -17,6 +17,8 @@ using System.Data.SqlClient;
|
||||
using Database;
|
||||
using System.Threading;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
|
||||
namespace OnDoc.Diverses
|
||||
{
|
||||
@@ -117,6 +119,8 @@ namespace OnDoc.Diverses
|
||||
db.Exec_SQL("Update profil set bezeichnung='" + txtbezeichnung.Text + "', unterschriftlinks=" + cbboxUnterschriftLinks.SelectedValue.ToString() + ", unterschriftrechts=" + cbboxUnterschriftRechts.SelectedValue.ToString() + ", team=" + cbboxTeam.SelectedValue.ToString() + " ,standard=1 where profilnr=" + lbprofile.SelectedValue.ToString());
|
||||
}
|
||||
db.Exec_SQL("Update profil set bezeichnung='" + txtbezeichnung.Text + "',unterschriftlinks=" + cbboxUnterschriftLinks.SelectedValue.ToString() + ", unterschriftrechts=" + cbboxUnterschriftRechts.SelectedValue.ToString() + ", team=" + cbboxTeam.SelectedValue.ToString() + " where profilnr=" + lbprofile.SelectedValue.ToString());
|
||||
//db.Exec_SQL("Update mitarbeiter set name='" + txtName.Text + "', vorname='" + txtVorname.Text + "', email='" + txtmail.Text + "', telefon='" + txttelefon.Text + "' where mitarbeiternr=" + AppParams.CurrentMitarbieter.ToString());
|
||||
//db.Exec_SQL("Update mitarbeiter set fax='" + txtfax.Text + "', unterschrift_text='" + txtunterschrift.Text + "', funktion='" + txtfunktion.Text + "', mutiert_am=getdate(), mutierer=" + AppParams.CurrentMitarbieter.ToString() + " where mitarbeiternr = " + AppParams.CurrentMitarbieter.ToString());
|
||||
db = null;
|
||||
refresh_profile();
|
||||
lbprofile.SelectedValue = saveselected;
|
||||
@@ -189,9 +193,65 @@ namespace OnDoc.Diverses
|
||||
GrpBoxDetails.Visible = false;
|
||||
GrpBoxMitarbeiter.Visible = true;
|
||||
GrpBoxMitarbeiter.Dock = DockStyle.Fill;
|
||||
System.Drawing.Image image = System.Drawing.Image.FromFile(@"E:\Software-Projekte\OnDoc\Images\download.png");
|
||||
this.pictureBox1.Image = image;
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
db.Get_Tabledata("select * from mitarbeiter where mitarbeiternr=" + AppParams.CurrentMitarbieter.ToString(), false, true);
|
||||
if (db.dsdaten.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
try {
|
||||
string unterschrift = get_unterschrift(db.dsdaten.Tables[0].Rows[0]["tgnummer"].ToString());
|
||||
string ss = Newtonsoft.Json.JsonConvert.DeserializeObject<string>(unterschrift);
|
||||
MemoryStream mssign = new MemoryStream(Convert.FromBase64String(ss));
|
||||
System.Drawing.Image img = System.Drawing.Image.FromStream(mssign);
|
||||
pictureBox1.Image = img;
|
||||
mssign.Close();
|
||||
mssign.Dispose();
|
||||
|
||||
|
||||
}
|
||||
catch { }
|
||||
txtName.Text = db.dsdaten.Tables[0].Rows[0]["name"].ToString();
|
||||
txtVorname.Text= db.dsdaten.Tables[0].Rows[0]["vorname"].ToString();
|
||||
txtmail.Text = db.dsdaten.Tables[0].Rows[0]["email"].ToString();
|
||||
txttelefon.Text = db.dsdaten.Tables[0].Rows[0]["telefon"].ToString();
|
||||
txtfax.Text = db.dsdaten.Tables[0].Rows[0]["fax"].ToString();
|
||||
txtunterschrift.Text = db.dsdaten.Tables[0].Rows[0]["unterschrift_text"].ToString();
|
||||
txtfunktion.Text = db.dsdaten.Tables[0].Rows[0]["funktion"].ToString();
|
||||
db = null;
|
||||
// System.Drawing.Image image = System.Drawing.Image.FromFile(@"E:\Software-Projekte\OnDoc\Images\download.png");
|
||||
//this.pictureBox1.Image = image;
|
||||
}
|
||||
}
|
||||
|
||||
private string get_unterschrift(string MaNr)
|
||||
{
|
||||
|
||||
string URL = AppParams.RESTURI + "API/GetUnterschriftAsBase64ByMitarbeiternr?MaNr=" + AppParams.CurrentMitarbieter.ToString()+ "&ImageWith=-1";
|
||||
|
||||
HttpWebRequest webRequest = HttpWebRequest.Create(URL) as HttpWebRequest;
|
||||
webRequest.Method = WebRequestMethods.Http.Get;
|
||||
webRequest.Headers["Authorization"] = "Bearer " + AppParams.apikey;
|
||||
try
|
||||
{
|
||||
using (HttpWebResponse response = webRequest.GetResponse() as HttpWebResponse)
|
||||
{
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
StreamReader reader = new StreamReader(response.GetResponseStream());
|
||||
string responseContent = reader.ReadToEnd();
|
||||
|
||||
return responseContent;
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.Error(URL + ": " + response.StatusCode.ToString() + " / " + response.StatusDescription, "Clinet - DokList GetDocument", "");
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
protected bool validData;
|
||||
string path;
|
||||
@@ -253,6 +313,15 @@ namespace OnDoc.Diverses
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RibbonMitarbeiterButtonSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
|
||||
db.Exec_SQL("Update mitarbeiter set name='" + txtName.Text + "', vorname='" + txtVorname.Text + "', email='" + txtmail.Text + "', telefon='" + txttelefon.Text + "' where mitarbeiternr=" + AppParams.CurrentMitarbieter.ToString());
|
||||
db.Exec_SQL("Update mitarbeiter set fax='" + txtfax.Text + "', unterschrift_text='" + txtunterschrift.Text + "', funktion='" + txtfunktion.Text + "', mutiert_am=getdate(), mutierer=" + AppParams.CurrentMitarbieter.ToString() + " where mitarbeiternr = " + AppParams.CurrentMitarbieter.ToString());
|
||||
db = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user