예제 #1
0
        public CounterForm()
        {
            InitializeComponent();

            LoginForm form = new LoginForm();

            toolStripStatusLabel_UserName.Text = form.GetUserName();
            toolStripStatusLabel_UserType.Text = form.GetUserType();
            toolStripStatusLabel_Date.Text = DateTime.Today.ToLongDateString();

            ds = new DataSet();
            rentDAL = new Renting_Management_System.DAL.RentDAL();

            ds = rentDAL.GetAll();
            bindingSource = new BindingSource();
            bindingSource.DataSource = ds;
            bindingSource.DataMember = ds.Tables[0].TableName;
            bindingSource.Sort = ds.Tables[0].Columns[0].ColumnName + " ASC";
            dataGridView1.DataSource = bindingSource;
            bindingNavigator1.BindingSource = bindingSource;
            dataGridView1.Columns[0].ReadOnly = true;
            dataGridView1.Columns[1].ReadOnly = true;
            dataGridView1.Columns[2].ReadOnly = true;
            bindingNavigatorAddNewItem.Enabled = false;
            bindingNavigatorDeleteItem.Enabled = false;
            if (ds.HasChanges())
            {
                toolStripButton_Save.Enabled = true;
                changed = true;
            }
        }
예제 #2
0
        public StoreForm()
        {
            InitializeComponent();

            LoginForm form = new LoginForm();

            toolStripStatusLabel_UserName.Text = form.GetUserName();
            toolStripStatusLabel_UserType.Text = form.GetUserType();
            toolStripStatusLabel_Date.Text = DateTime.Now.ToShortDateString();
        }