namespace Zeus_Private_Limited
{
public partial class Form4 : Form
{
public Form4(string access)
{
InitializeComponent();
//get the accessibility value to label
label9.Text = access;
}
SqlConnection conn = new SqlConnection("Data Source=(LocalDB)\\v11.0;AttachDbFilename=\"E:\\HND\\Semester 2\\Programming With C#\\Assignment\\System\\Zeus Private Limited\\Zeus Private Limited\\ZeusDB.mdf\";Integrated Security=True");
//Employee class is the sub class of Form4 class
public class Employee : Form4
{
//All Employees can Register and Search products
private void Register_Product()
{
if (textBox1.Text != "" || textBox2.Text != "" || textBox3.Text != "" || textBox4.Text != "" || textBox5.Text != "")
{
DialogResult dr = MessageBox.Show("Add one product to products list?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (dr == DialogResult.Yes)
{
答案 0 :(得分:0)
你没有提出问题,但为了打电话给你的表格,你需要这样的话:
var frm = Zeus_Private_Limited.Form4("ReadOnly");
frm.Show();
这是因为您构建了需要"访问"作为字符串参数:
public Form4(string access)