Ejemplo n.º 1
0
 public DetailsForm(string Parent)  // Add Form
 {
     InitializeComponent();
     if (Parent == "MembersForm")
     {
         Query             = "INSERT INTO Familia_MembersData VALUES(@CNIC, @Password, @Name, @Gender, @Email, @Phone, @Address, CURRENT_TIMESTAMP, NULL, NULL);";
         HeadingLabel.Text = "Add Member";
     }
     else
     {
         HeadingLabel.Text = "Add Reference";
         Query             = "INSERT INTO Familia_MembersData VALUES(@CNIC, @Name, @Email, @Phone, @Address, @Gender, CURRENT_TIMESTAMP, NULL);";
         Passlabel.Hide();
         PasswordBox.Hide();
     }
 }
Ejemplo n.º 2
0
        public void LoadForm(string Parent, DataGridViewRow SelectedRow)
        {
            Passlabel.Hide();
            PasswordBox.Hide();
            IconButton.Text = "Update";
            PopulateBoxes(SelectedRow);    // Populate Text Boxes

            if (Parent == "MembersForm")
            {
                HeadingLabel.Text = "Update Member";
                Query             = "UPDATE Familia_MembersData SET Familia_Member_Name = @Name, Familia_Member_Gender = @Gender, Familia_Member_Email = @Email, Familia_Member_Phone = @Phone, Familia_Member_Address = @Address, Familia_Member_CNIC = @CNIC WHERE Familia_Member_CNIC = @CNIC;";
            }
            else
            {
                HeadingLabel.Text = "Update Reference";
                Query             = "UPDATE Familia_ReferencesData SET Familia_Reference_Name = @Name, Familia_Reference_Gender = @Gender, Familia_Reference_Email = @Email, Familia_Reference_Phone = @Phone, Familia_Reference_Address = @Address, Familia_Reference_CNIC = @CNIC WHERE Familia_Reference_CNIC = @CNIC;";
            }
        }