Esempio n. 1
0
        private void btnadd_Click(object sender, EventArgs e)
        {
            People p = new People();

            DetailRequiredfields d = new DetailRequiredfields();

            d.ShowDialog();
            if (d.OK)
            {
                p = d.newPeople;
                DetailForm df = new DetailForm(p);
                df.Show();
                df.FormClosed += Df_FormClosed;
            }
            else
            {
                d = null;
            }
        }
Esempio n. 2
0
        private void OpenDetails(int id, bool show = true)
        {
            FormCollection fc = Application.OpenForms;

            foreach (Form frm in fc)
            {
                if (frm is DetailForm)
                {
                    ((DetailForm)frm).btnceratehtml.Enabled = false;
                    ((DetailForm)frm).btnconfirm.Enabled    = false;
                    //((DetailForm)frm).btnshowinfo.Enabled = false;
                }
            }
            if (id == 0)
            {
                return;
            }
            SqlDataReader reader;
            People        p = new People();

            p.ID   = id;
            reader = People.ReadById(p.ID);
            while (reader.Read())
            {
                PeopleManipulations.ReaderToPeople(ref p, ref reader, true, true);
            }
            reader.Close();
            DBFunction.CloseConnections();
            if (GLOBALVARS.MyUser.Control == User.TypeControl.User && p.Show == (int)People.ShowTypes.Personal)
            {
                p.OpenForPersonalEdit = true;
            }
            DetailForm detail = new DetailForm(p);

            if (show)
            {
                detail.Show(this);
            }
        }