public FrmNewCollection(FrmHomepage parent)
        {
            InitializeComponent();

            this.parent = parent;
            tableLayoutPanel2.SetColumnSpan(txt_address, 3);
            tableLayoutPanel2.SetColumnSpan(ckBox_newOrg, 2);

            db            = new SignChatDB();
            organisations = db.GetOrganisationList();

            // set organisation cbBox
            cbBox_organisation.TabIndex = 0;
            foreach (organisation o in organisations)
            {
                String item = String.Format("{0,-10}{1}", o.id, o.name);
                cbBox_organisation.Items.Add(item);
            }
            // set organisation txt
            txt_organisation          = new TextBox();
            txt_organisation.Anchor   = (AnchorStyles.Left | AnchorStyles.Right);
            txt_organisation.TabIndex = 0;

            txt_orgEmail.ReadOnly = true;
            txt_orgTel.ReadOnly   = true;
            txt_address.ReadOnly  = true;
        }
        public FrmOrganisationList(FrmHomepage parent)
        {
            InitializeComponent();

            this.parent = parent;

            db = new SignChatDB();
            organisationList = db.GetOrganisationList();
            UpdateList(organisationList);
        }
        public FrmCollectionList(FrmHomepage parent)
        {
            InitializeComponent();

            this.parent = parent;

            db = new SignChatDB();
            signcollectionsList = db.GetCollectionList();
            UpdateList(signcollectionsList);
        }
        private FrmOrganisationDetails(FrmHomepage parent)
        {
            InitializeComponent();

            this.parent = parent;
            db          = new SignChatDB();
            editMode    = false;
            txt_organisation.ReadOnly = true;
            txt_orgEmail.ReadOnly     = true;
            txt_address.ReadOnly      = true;
            txt_orgTel.ReadOnly       = true;
            txt_orgId.ReadOnly        = true;
        }
Beispiel #5
0
        public FrmCollectionDetails(FrmHomepage parent, String collectionId)
        {
            InitializeComponent();

            this.parent = parent;
            tableLayoutPanel2.SetColumnSpan(txt_address, 3);

            db = new SignChatDB();
            mySignCollection = db.GetSignCollection(collectionId);
            mySigns          = db.GetSigns(collectionId);
            myOrganisation   = db.GetOrganisation(mySignCollection.organisationId);

            SetForm();
            editMode = false;
        }
        private void Login()
        {
            SignChatDB db       = new SignChatDB();
            String     username = txt_username.Text;
            String     password = txt_password.Text;
            bool       validate = db.LoginValidation(username, password);

            if (validate)
            {
                FrmHomepage frm = new FrmHomepage(username);
                frm.StartPosition = FormStartPosition.Manual;
                frm.Location      = this.Location;
                this.Visible      = false;
                frm.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("Sorry. Invalid Login.", "Login failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 public FrmOrganisationDetails(FrmHomepage parent, organisation org) : this(parent)
 {
     myOrganisation      = org;
     signcollectionsList = db.GetCollectionList(org.id);
     SetData();
 }
 public FrmOrganisationDetails(FrmHomepage parent, int organisationId) : this(parent)
 {
     myOrganisation      = db.GetOrganisation(organisationId);
     signcollectionsList = db.GetCollectionList(organisationId);
     SetData();
 }
 public FrmNewCollection(FrmHomepage parent, int organisationId) : this(parent)
 {
     organisation selectedOrg = organisations.FirstOrDefault(i => i.id == organisationId);
     int          sIndex      = organisations.IndexOf(selectedOrg);
     cbBox_organisation.SelectedIndex = sIndex;
 }