Beispiel #1
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            if (this.member_info == null)
            {
                DlgLogin login = new DlgLogin(this);
                if (login.ShowDialog() == DialogResult.OK)
                {
                    DlgCompanySelect comp = new DlgCompanySelect(login.member_info, login.user_info);
                    if (comp.ShowDialog() == DialogResult.OK)
                    {
                        this.member_info = login.member_info;
                        this.user_info   = login.user_info;
                        this.comp_info   = comp.selected_comp;

                        this.lblDbName.Text = this.comp_info.dbname + " [ " + this.comp_info.compname + " ]";

                        this.msg = MessageManager.LoadMessage(this.user_info.language);
                        this.SetMenuText(this.mainMenu);
                    }
                    else
                    {
                        this.Close();
                    }
                }
                else
                {
                    this.Close();
                }
            }
        }
Beispiel #2
0
        private void dgv_CurrentCellChanged(object sender, EventArgs e)
        {
            if (((DataGridView)sender).CurrentCell == null)
            {
                return;
            }

            this.selected_comp = (sccomp)((DataGridView)sender).Rows[((DataGridView)sender).CurrentCell.RowIndex].Cells["col_sccomp"].Value;
        }
Beispiel #3
0
        public static SccompVM ToViewModel(this sccomp sccomp)
        {
            if (sccomp == null)
            {
                return(null);
            }

            SccompVM vm = new SccompVM
            {
                sccomp    = sccomp,
                id        = sccomp.id,
                dbname    = sccomp.dbname,
                compgroup = sccomp.sccompgroup.groupname,
                compname  = sccomp.compname,
                credate   = sccomp.credate
            };

            return(vm);
        }