To Download files click here..
Note: Connect your GSM(Mobile) Device with your system through PC suit before send sms.
private void barButtonItem55_ItemClick(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("http://web.whatsapp.com/");
}
private void barButtonItem36_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
using (DevExpress.XtraEditors.ColorWheel.ColorWheelForm f = new DevExpress.XtraEditors.ColorWheel.ColorWheelForm())
{
f.ShowDialog(this);
}
}
public string GetMACAddress()
{
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
String sMacAddress = string.Empty;
foreach (NetworkInterface adapter in nics)
{
if (sMacAddress == String.Empty)// only return MAC Address from first card
{
IPInterfaceProperties properties = adapter.GetIPProperties();
sMacAddress = adapter.GetPhysicalAddress().ToString();
}
}
return sMacAddress;
}
using System;
namespace CarShowRoom
{
public partial class frmSale : DevExpress.XtraEditors.XtraForm
{
SqlConnection con = CString.con;
MemoryStream ms;
byte[] photo_aray;
public frmSale()
{
InitializeComponent();
}
public void btnInsert()
{
string query;
if (pictureEdit1.Image != null)
{
query = "INSERT INTO Sale(ID,Image) VALUES (@txtID,@photo)";
}
else
{
"INSERT INTO Sale(ID) VALUES (@txtID)";
}
try
{
using (SqlCommand command = new SqlCommand(query, con))
{
command.Parameters.AddWithValue("@txtID", txtID.EditValue);
if (pictureEdit2.Image != null)
{
ms = new MemoryStream();
pictureEdit2.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] photo_aray = new byte[ms.Length];
ms.Position = 0;
ms.Read(photo_aray, 0, photo_aray.Length);
command.Parameters.AddWithValue("@photo", photo_aray);
}
con.Open();
int result = command.ExecuteNonQuery();
// Check Error
if (result < 0)
XtraMessageBox.Show("Error");
con.Close();
}
}
catch (Exception ex)
{
XtraMessageBox.Show("ITEM" + ex.Message);
}
}
}}
we can define transaction scope by using transaction library.
using (TransactionScope scope = new TransactionScope())
{
int a=5,b=10,sum=0;
sum=a+b;
scope.Complete();
XtraMessageBox.Show("Record Add");
}
private void LoadRecord()
{
string sql = "SELECT * FROM SaleInvoice";
SqlDataAdapter dataadapter = new SqlDataAdapter(sql, con);
DataSet ds = new DataSet();
con.Open();
dataadapter.Fill(ds, "Authors_table");
con.Close();
gridControl1.DataSource = ds;
gridControl1.DataMember = "Authors_table";
}