Exemplo n.º 1
0
        private void submitButton_Click(object sender, EventArgs e)
        {
            ComplainInfo obj = new ComplainInfo()
            {
                cName = nameTextBox.Text,

                cRoll    = rollTextBox.Text,
                cMb      = mbTextbox.Text,
                cDate    = dateTextBox.Text,
                complain = complainRichTextBox.Text
            };

            if (cAllotIdTextBox.Text == "")
            {
                obj.cAllot_id = -1;
            }
            else
            {
                obj.cAllot_id = Convert.ToInt32(cAllotIdTextBox.Text);
            }

            ComplainChek ob = new ComplainChek();

            ob.submitChek(obj);

            ComplainDataAccess  dataAccess = new ComplainDataAccess();
            List <ComplainInfo> complains  = dataAccess.viewComplain();

            complainDataGridView.AutoGenerateColumns = false;
            complainDataGridView.DataSource          = complains;
        }
Exemplo n.º 2
0
        public void viewButton_Click(object sender, EventArgs e)
        {
            ComplainDataAccess  dataAccess = new ComplainDataAccess();
            List <ComplainInfo> complains  = dataAccess.viewComplain();

            complainDataGridView.AutoGenerateColumns         = false;
            complainDataGridView.DataSource                  = complains;
            complainDataGridView.Columns[0].DataPropertyName = "cId";
            complainDataGridView.Columns[1].DataPropertyName = "cAllot_id";
            complainDataGridView.Columns[2].DataPropertyName = "cName";
            complainDataGridView.Columns[3].DataPropertyName = "cRoll";
            complainDataGridView.Columns[4].DataPropertyName = "cMb";
            complainDataGridView.Columns[5].DataPropertyName = "cDate";
            complainDataGridView.Columns[6].DataPropertyName = "complain";
        }
Exemplo n.º 3
0
        private void deleteButton_Click(object sender, EventArgs e)
        {
            ComplainInfo ob = new ComplainInfo();

            if (deleteComplainIdTextBox.Text == "")
            {
                ob.cId = 0;
            }

            else
            {
                ob.cId = Convert.ToInt32(deleteComplainIdTextBox.Text);
            }

            ComplainChek obj = new ComplainChek();

            obj.deleteComplainCheck(ob);

            ComplainDataAccess  dataAccess = new ComplainDataAccess();
            List <ComplainInfo> complains  = dataAccess.viewComplain();

            complainDataGridView.AutoGenerateColumns = false;
            complainDataGridView.DataSource          = complains;
        }