Exemplo n.º 1
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex != -1 && e.ColumnIndex != -1)
            {
                edit = 1;
                pictureBox1.Image = null;
                MainClass.disable(panel6);
                DataGridViewRow row = dataGridView1.Rows[e.RowIndex];
                staffID               = Convert.ToInt32(row.Cells["UserIDGV"].Value.ToString());
                nameTxt.Text          = row.Cells["nameGV"].Value.ToString();
                usernameTxt.Text      = row.Cells["UsernameGV"].Value.ToString();
                passwordTxt.Text      = row.Cells["PasswordGV"].Value.ToString();
                confirmPassTxt.Text   = row.Cells["PasswordGV"].Value.ToString();
                phone1Txt.Text        = row.Cells["phone1GV"].Value.ToString();
                phone2Txt.Text        = row.Cells["phone2GV"].Value.ToString();
                roleDD.SelectedValue  = row.Cells["roleIDGV"].Value.ToString();
                statusDD.SelectedItem = row.Cells["StatusGV"].Value.ToString();

                var im = (from x in obj.staffs where x.st_id == staffID select x.st_image).First();
                if (im == null)
                {
                }
                else
                {
                    byte[]       arr = im.ToArray();
                    MemoryStream ms  = new MemoryStream(arr);
                    i = Image.FromStream(ms);
                    pictureBox1.Image    = i;
                    pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
                }
            }
        }
Exemplo n.º 2
0
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex != -1 && e.ColumnIndex != -1)
     {
         edit = 1;
         MainClass.disable(panel6);
         DataGridViewRow row = dataGridView1.Rows[e.RowIndex];
         levelID           = Convert.ToInt32(row.Cells["levelIDGV"].Value.ToString());
         levelNameTxt.Text = row.Cells["levelNameGV"].Value.ToString();
     }
 }
Exemplo n.º 3
0
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex != -1 && e.ColumnIndex != -1)
     {
         edit = 1;
         MainClass.disable(panel6);
         DataGridViewRow row = dataGridView1.Rows[e.RowIndex];
         subjectID             = Convert.ToInt32(row.Cells["subjectIDGV"].Value.ToString());
         subjectTxt.Text       = row.Cells["subjectGV"].Value.ToString();
         classDD.SelectedValue = row.Cells["classidGV"].Value;
     }
 }
Exemplo n.º 4
0
 public override void editBtn_Click(object sender, EventArgs e)
 {
     if (operationTxt.Text != "Edit")
     {
         operationTxt.Text = "Edit";
         MainClass.enable(panel5);
     }
     else
     {
         operationTxt.Text = "View";
         MainClass.disable(panel5);
     }
 }
Exemplo n.º 5
0
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex != -1 && e.ColumnIndex != -1)
     {
         edit = 1;
         MainClass.disable(panel6);
         DataGridViewRow row = dataGridView1.Rows[e.RowIndex];
         classID               = Convert.ToInt32(row.Cells["classIDGV"].Value.ToString());
         classnameTxt.Text     = row.Cells["ClassNameGV"].Value.ToString();
         statusDD.SelectedItem = row.Cells["StatusGV"].Value.ToString();
         levelDD.SelectedValue = row.Cells["levelidGV"].Value;
     }
 }
Exemplo n.º 6
0
 public override void ViewBtn_Click(object sender, EventArgs e)
 {
     if (operationTxt.Text != "View")
     {
         operationTxt.Text = "View";
         MainClass.disable(panel5);
         userAddBtn.Visible = false;
     }
     else
     {
     }
     MainClass.disable_reset(panel5);
 }
Exemplo n.º 7
0
        public override void addBtn_Click(object sender, EventArgs e)
        {
            if (btnStatus == "add")
            {
                btnStatus = "view";

                MainClass.disable(panel5);
            }
            else
            {
                btnStatus = "add";
                MainClass.enable(panel5);
            }
        }
Exemplo n.º 8
0
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex != -1 && e.ColumnIndex != -1)
     {
         edit = 1;
         MainClass.disable(panel6);
         DataGridViewRow row = dataGridView1.Rows[e.RowIndex];
         shiftID              = Convert.ToInt32(row.Cells["shiftIDGV"].Value.ToString());
         startPicker.Value    = Convert.ToDateTime(row.Cells["startGV"].Value);
         endPicker.Value      = Convert.ToDateTime(row.Cells["endTimeGV"].Value);
         shiftDD.SelectedItem = row.Cells["shiftNumberGV"].Value.ToString();
         shiftNameTxt.Text    = row.Cells["shiftNameGV"].Value.ToString();
     }
 }
 public override void btnAdd_Click(object sender, EventArgs e)
 {
     if (btnStatus == "add")
     {
         btnStatus    = "view";
         lblMain.Text = "View";
         MainClass.disable(panel6);
     }
     else
     {
         btnStatus    = "add";
         lblMain.Text = "Add Reservation";
         MainClass.enable_reset(panel6);
     }
 }
 public override void btnUpdate_Click(object sender, EventArgs e)
 {
     if (btnStatus == "update")
     {
         btnStatus    = "view";
         lblMain.Text = "View";
         MainClass.disable(panel6);
     }
     else
     {
         btnStatus    = "update";
         lblMain.Text = "Update Reservation";
         MainClass.enable(panel6);
     }
 }
Exemplo n.º 11
0
 public override void addBtn_Click(object sender, EventArgs e)
 {
     if (btnStatus == "add")
     {
         btnStatus      = "view";
         operation.Text = "View Student";
         MainClass.disable(panel5);
     }
     else
     {
         btnStatus = "add";
         MainClass.enable_reset(panel5);
         operation.Text    = "Add Student";
         acceptBtn.Visible = true;
     }
 }
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex != -1 && e.ColumnIndex != -1)
            {
                edit = 1;
                MainClass.disable(panel6);
                DataGridViewRow row = dataGridView1.Rows[e.RowIndex];

                timingID                    = Convert.ToInt32(row.Cells["tIdGV"].Value.ToString());
                timingNameTxt.Text          = row.Cells["timingNameGV"].Value.ToString();
                fromTiming.Value            = Convert.ToDateTime(row.Cells["fromGV"].Value);
                toTiming.Value              = Convert.ToDateTime(row.Cells["toGV"].Value);
                timingDaysDD.SelectedItem   = row.Cells["DayGV"].Value.ToString();
                timingShiftDD.SelectedValue = row.Cells["shiftIdGV"].Value.ToString();
                levelDD1.SelectedValue      = row.Cells["levelIDGV"].Value.ToString();
            }
        }
Exemplo n.º 13
0
        private void usersGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (operationTxt.Text == "View" || operationTxt.Text == "Add")
            {
                MainClass.disable(panel5);
            }
            else
            {
                MainClass.enable(panel5);
            }

            if (e.RowIndex != -1 && e.ColumnIndex != -1)
            {
                DataGridViewRow row = usersGridView.Rows[e.RowIndex];
                userID             = Convert.ToInt32(row.Cells["userId"].Value.ToString());
                userNameTxt.Text   = row.Cells["userName"].Value.ToString();
                rolesDropDown.Text = row.Cells["roleId"].Value.ToString();
            }
        }
Exemplo n.º 14
0
        private void MemberGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (btnStatus == "view" || btnStatus == "add")
            {
                MainClass.disable(panel6);
            }
            else
            {
                MainClass.enable(panel6);
            }

            try
            {
                int i;
                i = Convert.ToInt32(MemberGridView.SelectedCells[0].Value.ToString());
                con.Open();
                SqlCommand cmd = con.CreateCommand();
                cmd.CommandType = CommandType.Text;
                cmd.CommandText = "select * from libraryMember where member_ID='" + i + "'";
                cmd.ExecuteNonQuery();
                DataTable      dt = new DataTable();
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(dt);

                foreach (DataRow dr in dt.Rows)
                {
                    txtMemberID.Text = dr["member_ID"].ToString();
                    txtFName.Text    = dr["FirstName"].ToString();
                    txtLName.Text    = dr["LastName"].ToString();
                    txtAddress.Text  = dr["address"].ToString();
                    txtContact.Text  = dr["contactNo"].ToString();
                    AddDate.Text     = dr["addDate"].ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error");
            }
            con.Close();
        }
Exemplo n.º 15
0
 public override void editBtn_Click(object sender, EventArgs e)
 {
     if (btnStatus == "edit")
     {
         btnStatus      = "view";
         operation.Text = "View Student";
         MainClass.disable(panel5);
     }
     else
     {
         if (firstName_txt.Text != "")
         {
             btnStatus      = "edit";
             operation.Text = "Edit Student";
             MainClass.enable(panel5);
         }
         else
         {
             MainClass.showMsg("Select a record first", "error", "error");
         }
     }
 }
        private void overdueGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (btnStatus == "view" || btnStatus == "add")
            {
                MainClass.disable(panel6);
            }
            else
            {
                MainClass.enable(panel6);
            }

            try
            {
                int i;
                i = Convert.ToInt32(overdueGridView.SelectedCells[0].Value.ToString());
                con.Open();
                SqlCommand cmd = con.CreateCommand();
                cmd.CommandType = CommandType.Text;
                cmd.CommandText = "select * from libraryOverDue where overdue_ID='" + i + "'";
                cmd.ExecuteNonQuery();
                DataTable dt = new DataTable();
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(dt);

                foreach (DataRow dr in dt.Rows)
                {
                    txtOverDueID.Text = dr["overdue_ID"].ToString();
                    txtMemberID.Text = dr["member_ID"].ToString();
                    DueDate.Text = dr["dueDate"].ToString();
                    txtDueDays.Text = dr["noOfDueDays"].ToString();
                    totalAmount.Text = dr["totalAmount"].ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error");
            }
            con.Close();
        }
Exemplo n.º 17
0
        private void studentGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            viewBtn.Enabled = true;
            if (advanceSearchPanel.Visible == true)
            {
                if (e.RowIndex != -1 && e.ColumnIndex != -1)
                {
                    DataGridViewRow row = studentGridView.Rows[e.RowIndex];
                    sid = Convert.ToInt32(row.Cells["id"].Value.ToString());

                    var im = (from x in obj.students where x.sid == sid select x.image).First();
                    if (im == null)
                    {
                    }
                    else
                    {
                        byte[]       arr = im.ToArray();
                        MemoryStream ms  = new MemoryStream(arr);
                        i = Image.FromStream(ms);
                        advSearchPicBox.Image    = i;
                        advSearchPicBox.SizeMode = PictureBoxSizeMode.StretchImage;
                    }
                }
            }

            if (btnStatus == "view" || btnStatus == "add")
            {
                MainClass.disable(panel5);
            }
            else
            {
                MainClass.enable(panel5);
            }

            if (e.RowIndex != -1 && e.ColumnIndex != -1)
            {
                DataGridViewRow row = studentGridView.Rows[e.RowIndex];
                sid                         = Convert.ToInt32(row.Cells["id"].Value.ToString());
                NIC_txt.Text                = row.Cells["nicId"].Value.ToString();
                firstName_txt.Text          = row.Cells["fName"].Value.ToString();
                lastName_txt.Text           = row.Cells["lName"].Value.ToString();
                birthDay_txt.Text           = row.Cells["birthDate"].Value.ToString();
                address_txt.Text            = row.Cells["address"].Value.ToString();
                telephone_txt.Text          = row.Cells["telephone"].Value.ToString();
                genderDropDown.SelectedItem = row.Cells["gender"].Value.ToString();
                gradeDropDown.SelectedItem  = row.Cells["grade"].Value.ToString();
                classDropDown.SelectedItem  = row.Cells["cls"].Value;
                imageExist                  = true;

                var im = (from x in obj.students where x.sid == sid select x.image).First();
                if (im == null)
                {
                    studentImage.Image = Properties.Resources.user1;
                }
                else
                {
                    byte[]       arr = im.ToArray();
                    MemoryStream ms  = new MemoryStream(arr);
                    i = Image.FromStream(ms);
                    studentImage.Image    = i;
                    studentImage.SizeMode = PictureBoxSizeMode.StretchImage;
                }
            }
        }