This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected static String ByteArrayToString(byte[] inArray) | |
{ | |
StringBuilder outString = new StringBuilder(""); | |
for (int i = 0; i < inArray.Length; i++) | |
{ | |
outString.Append(inArray[i].ToString("X2")); | |
} | |
return outString.ToString(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected static String SHA1Encrypt(String phrase) | |
{ | |
UTF8Encoding encoder = new UTF8Encoding(); | |
SHA1CryptoServiceProvider sha1 = new SHA1CryptoServiceProvider(); | |
byte[] hashedDataBytes = sha1.ComputeHash(encoder.GetBytes(phrase)); | |
return ByteArrayToString(hashedDataBytes); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string sqlInsert = "INSERT INTO users (name, surname) VALUES (:name, :surname) RETURNING id_user INTO :LASTID"; | |
OracleParameter lastId = new OracleParameter(":LASTID", OracleDbType.Int32); | |
lastId.Direction = ParameterDirection.Output; | |
... | |
cmdInsert.Parameters.Add(lastId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<system.diagnostics> | |
<sources> | |
<source name="System.ServiceModel" | |
switchValue="Information, ActivityTracing" | |
propagateActivity="true"> | |
<listeners> | |
<add name="traceListener" | |
type="System.Diagnostics.XmlWriterTraceListener" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Style x:Key="btnCustom" TargetType="{x:Type Button}"> | |
<Setter Property="Height" Value="50"/> | |
<Setter Property="Width" Value="80"/> | |
<Setter Property="Margin" Value="5,2,0,5"/> | |
<Style.Resources> | |
<Style TargetType="Image"> | |
<Style.Triggers> | |
<Trigger Property="IsEnabled" Value="False"> | |
<Setter Property="Opacity" Value="0.5" /> | |
</Trigger> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Style TargetType="{x:Type DataGrid}"> | |
<Setter Property="Background" Value="#FFF" /> | |
<Setter Property="AlternationCount" Value="2" /> | |
</Style> | |
<Style TargetType="{x:Type DataGridRow}"> | |
<Style.Triggers> | |
<Trigger Property="ItemsControl.AlternationIndex" Value="0"> | |
<Setter Property="Background" Value="#EFEFEF"></Setter> | |
</Trigger> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ListBox.ItemContainerStyle> | |
<Style TargetType="ListBoxItem"> | |
<Style.Triggers> | |
<Trigger Property="IsSelected" Value="True" > | |
<Setter Property="Background" Value="Transparent" /> | |
<Setter Property="Foreground" Value="Black" /> | |
</Trigger> | |
</Style.Triggers> | |
<Style.Resources> | |
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NuGet installation | |
PM> Install-Package System.Windows.Interactivity.WPF | |
Must be installed in Main project also!!! | |
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" | |
<i:Interaction.Triggers> | |
<i:EventTrigger EventName="MouseDoubleClick"> | |
<i:InvokeCommandAction Command="{Binding SetUserCommand}"/> | |
</i:EventTrigger> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Style x:Key="NormalTextBox" TargetType="{x:Type TextBox}"> | |
<Style.Triggers> | |
<DataTrigger Binding="{Binding IsFocused}" Value="True"> | |
<Setter Property="FocusManager.FocusedElement" | |
Value="{Binding RelativeSource={RelativeSource Self}}" /> | |
</DataTrigger> | |
</Style.Triggers> | |
</Style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim conn As New OracleConnection(oradb) | |
conn.Open() | |
Dim cmd As New OracleCommand | |
cmd.Connection = conn | |
cmd.CommandText = "procedure1" | |
cmd.CommandType = CommandType.StoredProcedure | |
cmd.Parameters.Add("p1", OracleDbType.Varchar2).Value = "Test 123" | |
cmd.Parameters.Add("p2", OracleDbType.Date).Value = System.DateTime.Now |
NewerOlder