Beispiel #1
0
        private void UpdateRecord()
        {
            using (new WaitCursor())
            {
                Parish oclsParish = new Parish();
                Parish clsParish  = new Parish();

                oclsParish.Parish_ID = System.Convert.ToInt16((Grid.SelectedCells[0].Column.GetCellContent(Grid.SelectedItem) as TextBlock).Text);
                oclsParish           = ParishData.Select_Record(oclsParish);

                if (VerifyData() == true)
                {
                    SetData(clsParish);
                    Boolean bSucess = new Boolean();
                    bSucess = ParishData.Update(oclsParish, clsParish);
                    if (bSucess == true)
                    {
                        GoBack_To_Grid();
                    }
                    else
                    {
                        MessageBox.Show("Update failed.", "Error");
                    }
                }
            }
        }
Beispiel #2
0
        private void GetData()
        {
            using (new WaitCursor())
            {
                ClearRecord();

                Parish clsParish = new Parish();
                clsParish.Parish_ID = System.Convert.ToInt16((Grid.SelectedCells[0].Column.GetCellContent(Grid.SelectedItem) as TextBlock).Text);
                clsParish           = ParishData.Select_Record(clsParish);

                if ((clsParish != null))
                {
                    try
                    {
                        nudParish_ID.Text       = System.Convert.ToInt16(clsParish.Parish_ID).ToString();
                        tbParishName.Text       = Convert.ToString(clsParish.ParishName);
                        cbKCSJDiocese.IsChecked = System.Convert.ToBoolean(clsParish.KCSJDiocese);
                    }
                    catch
                    {
                    }
                }
            }
        }