private void AddNewUserUI_Load(object sender, EventArgs e)
        {   // Set the defaut combobox select item
            radioButtonNo.Checked = true;
            var department = (departmentId > 0) ? departmentController.GetAllDepartment(departmentId, "").FirstOrDefault() : null;

            if (department != null)
            {
                textBoxDepartmentName.Text = Comon.GetPropertyValue(department, "department_name").ToString().Trim();
                radioButtonYes.Checked     = Comon.GetPropertyValue(department, "isWorkshop").ToString() == "True" ? true : false;
            }
        }
示例#2
0
        private void AddNewRevenueUI_Load(object sender, EventArgs e)
        {
            comboBoxMonth.DataSource    = Comon.GetMonths();
            comboBoxMonth.DisplayMember = "label";
            comboBoxMonth.ValueMember   = "value";
            comboBoxYear.DataSource     = Comon.GetYears();
            comboBoxYear.DisplayMember  = "label";
            comboBoxYear.ValueMember    = "value";

            var revenue = revenueController.GetAllRevenue(revenueId, null, null).FirstOrDefault();

            if (revenue != null)
            {
                // Bind data
                textBoxRevenueNumber.Text   = Convert.ToString(Comon.GetPropertyValue(revenue, "number"));
                comboBoxMonth.SelectedValue = Comon.GetPropertyValue(revenue, "month");
                comboBoxYear.SelectedValue  = Comon.GetPropertyValue(revenue, "year");
            }
        }