if (Module1.action == "Add")
{
SqlCommand com = new SqlCommand();
com.CommandText = "insert into Customer values(@CNo,@CName,@Date,@CAddress,@Contact_No,@Deleted)";
com.Parameters.AddWithValue("@CNo", txtcustno.Text);
com.Parameters.AddWithValue("@CName", txtcustname.Text);
com.Parameters.AddWithValue("@Date", txtdate.Text);
com.Parameters.AddWithValue("@CAddress", txtcustaddress.Text);
com.Parameters.AddWithValue("@Contact_No", txtcontact.Text);
//com.Parameters.AddWithValue("@UNo", Module1.st);
com.Parameters.AddWithValue("@Deleted", "0");
com.Connection = Module1.con;
try
{
Module1.con.Open();
com.ExecuteNonQuery();
// Module1.con.Open();
//com.ExecuteNonQuery();
// MessageBox.Show("Record saved");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
Module1.con.Close();
fill();
binding();
Button(!Module1.b);
Locked(Module1.d);
MessageBox.Show("Record saved");
// Clientid = txtcustno.Text
return;
}
else if (Module1.action == "Update")