コード例 #1
0
        private void deleteButton_Click(object sender, EventArgs e)
        {
            AllotmentInfo ob = new AllotmentInfo()
            {
                allot_Id = allotIdTextBox.Text,
                aRoom_No = roomNoTextBox.Text,
            };

            if (studentIdTextBox.Text == "")
            {
                ob.ast_Id = -1;
            }
            else
            {
                ob.ast_Id = Convert.ToInt32(studentIdTextBox.Text);
            }

            DeleteAllotmentCheck obj = new DeleteAllotmentCheck();

            obj.deleteallot(ob);


            studentIdTextBox.Text = "";
            allotIdTextBox.Text   = "";
            roomNoTextBox.Text    = "";

            AllotmentInfoDataAccess dataAccess = new AllotmentInfoDataAccess();
            List <AllotmentInfo>    stu        = dataAccess.viewAllotStudentInfo();

            AllotedStudentDeleteDataGridView.AutoGenerateColumns = false;
            AllotedStudentDeleteDataGridView.DataSource          = stu;
        }
コード例 #2
0
      public void viewButton_Click(object sender, EventArgs e)
      {
          //AllotmentInfoDataAccess dataAccess = new AllotmentInfoDataAccess();
          //DataTable tbl = dataAccess.viewAllotStudentInfo();
          //AllotedStudentDataGridView.AutoGenerateColumns = false;
          //AllotedStudentDataGridView.DataSource = tbl;
          AllotmentInfoDataAccess dataAccess = new AllotmentInfoDataAccess();
          List <AllotmentInfo>    stu        = dataAccess.viewAllotStudentInfo();

          AllotedStudentDataGridView.AutoGenerateColumns          = false;
          AllotedStudentDataGridView.DataSource                   = stu;
          AllotedStudentDataGridView.Columns[0].DataPropertyName  = "ast_Id";
          AllotedStudentDataGridView.Columns[2].DataPropertyName  = "ast_Name";
          AllotedStudentDataGridView.Columns[3].DataPropertyName  = "ast_FatherName";
          AllotedStudentDataGridView.Columns[4].DataPropertyName  = "ast_MotherName";
          AllotedStudentDataGridView.Columns[5].DataPropertyName  = "ast_Address";
          AllotedStudentDataGridView.Columns[6].DataPropertyName  = "ast_Phone";
          AllotedStudentDataGridView.Columns[7].DataPropertyName  = "ast_Email";
          AllotedStudentDataGridView.Columns[8].DataPropertyName  = "ast_Dept";
          AllotedStudentDataGridView.Columns[9].DataPropertyName  = "ast_Roll";
          AllotedStudentDataGridView.Columns[10].DataPropertyName = "ast_Cgpa";
          AllotedStudentDataGridView.Columns[11].DataPropertyName = "ast_Session";
          AllotedStudentDataGridView.Columns[12].DataPropertyName = "ast_Blood";

          AllotedStudentDataGridView.Columns[1].DataPropertyName  = "allot_Id";
          AllotedStudentDataGridView.Columns[13].DataPropertyName = "aRoom_No";
          AllotedStudentDataGridView.Columns[14].DataPropertyName = "aInDate";
      }
コード例 #3
0
      private void searchByRollButton_Click(object sender, EventArgs e)
      {
          AllotmentInfo Obj = new AllotmentInfo()
          {
              ast_Roll = allotSearchByRollTextBox.Text
          };
          AllotmentInfoDataAccess dataAccess = new AllotmentInfoDataAccess();
          List <AllotmentInfo>    students   = dataAccess.searchByRoll(Obj);

          AllotedStudentDataGridView.DataSource = students;
      }
コード例 #4
0
      private void searchByAllotIdButton_Click(object sender, EventArgs e)
      {
          //deleteIdtextBox.Text = "";
          AllotmentInfo Obj = new AllotmentInfo();

          if (allotSearchByAllotIdTextBox.Text == "")
          {
              MessageBox.Show("please fill up \"the TextBox\"");
          }
          else
          {
              Obj.allot_Id = allotSearchByAllotIdTextBox.Text;

              AllotmentInfoDataAccess dataAccess = new AllotmentInfoDataAccess();
              List <AllotmentInfo>    students   = dataAccess.searchByAllotId(Obj);
              AllotedStudentDataGridView.DataSource = students;
          }
          //AllotmentInfoCheck Cobj=new AllotmentInfoCheck();
          // List<AllotmentInfo> students=Cobj.searchByAllotIdCheck(Obj);
      }
コード例 #5
0
 public void deleteallot(AllotmentInfo aOb)
 {
     if (aOb.aRoom_No == "" || aOb.ast_Id == -1 || aOb.allot_Id == "")
     {
         MessageBox.Show("please click on the row.");
     }
     else
     {
         DialogResult dr = MessageBox.Show("Are you want to delete Allot ID :" + aOb.allot_Id, "continue", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dr == DialogResult.Yes)
         {
             AllotmentInfoDataAccess dObj = new AllotmentInfoDataAccess();
             dObj.updateAvailableSeat(aOb);
             dObj.deleteInfo(aOb);
             MessageBox.Show("deleted ");
         }
         else if (dr == DialogResult.No)
         {
             MessageBox.Show("not deleted.");
         }
     }
 }