Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(txtMenuName.Text))
            {
                int?id = null;  //Nullable type of int


                if (!string.IsNullOrWhiteSpace(txtParentId.Text))
                {
                    id = Convert.ToInt32(txtParentId.Text);
                }
                var dataset = StoredProcedureCalls.CreateMenu(txtMenuName.Text, id);


                if (dataset != null)
                {
                    dataGridView1.DataSource = dataset.Tables[0];
                    dataGridView2.DataSource = dataset.Tables[1];
                    dataGridView3.DataSource = dataset.Tables[2];

                    dataGridView1.Refresh();
                    dataGridView2.Refresh();
                    dataGridView3.Refresh();
                }
            }
            else
            {
                MessageBox.Show("Menu Name is Empty");
                toolStripStatusLabel1.Text = "Menu Name is Empty";
            }
        }
Beispiel #2
0
 public AccountController()
 {
     userApp    = new UserApplication();
     context    = new SessionContext();
     sprocs     = new StoredProcedureCalls();
     encryption = new PasswordEncryption();
 }
Beispiel #3
0
        // GET: ServerWarning
        public ActionResult Index(int serverID)
        {
            StoredProcedureCalls sprocs   = new StoredProcedureCalls();
            List <ServerWarning> warnings = sprocs.ReturnWarnings(serverID);

            ViewBag.Server = sprocs.ReturnServer(serverID).ServerName;
            return(View(warnings));
        }
Beispiel #4
0
 public SendWarning()
 {
     sprocs = new StoredProcedureCalls();
 }