コード例 #1
0
        public AlterTemplateForm()
        {
            InitializeComponent();
            db.Connect();
            var obj    = db.GetRows("event_template", "*", "");
            var events = new List <Event>();

            foreach (var row in obj)
            {
                events.Add(EventTemplateMapper.Map(row));
            }
            templatesLB.Items.AddRange(events.ToArray());


            var res       = db.GetRows("resource", "*", "");
            var resources = new List <Resource>();

            foreach (var row in res)
            {
                resources.Add(ResourceMapper.Map(row));
            }
            resourcesLB.Items.AddRange(resources.ToArray());

            db.Disconnect();
        }
コード例 #2
0
        private void PlannedEventsForm_Load(object sender, EventArgs e)
        {
            db.Connect();
            var obj    = db.GetRows("event_template", "*", "");
            var events = new List <Event>();

            foreach (var row in obj)
            {
                events.Add(EventTemplateMapper.Map(row));
            }


            eventsLB.Items.AddRange(events.ToArray());


            issuesCB.Items.Clear();
            var iss    = db.GetRows("issues", "*", "");
            var issues = new List <Issue>();

            foreach (var row in iss)
            {
                issues.Add(IssueMapper.Map(row));
            }

            issuesCB.Items.AddRange(issues.ToArray());
            issuesCB.SelectedIndex = 0;

            var res       = db.GetRows("resource", "*", "");
            var resources = new List <Resource>();

            foreach (var row in res)
            {
                resources.Add(ResourceMapper.Map(row));
            }
            resLB.Items.AddRange(resources.ToArray());

            db.Disconnect();
        }
コード例 #3
0
        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (onlyExpCB.Checked)
            {
                eventsLB.Items.Clear();
                db.Connect();
                var obj    = db.GetRows("event_template", "*", "expert_id=" + user);
                var events = new List <Event>();
                foreach (var row in obj)
                {
                    events.Add(EventTemplateMapper.Map(row));
                }


                eventsLB.Items.AddRange(events.ToArray());
                db.Disconnect();
            }
            else
            {
                eventsLB.Items.Clear();
                PlannedEventsForm_Load(this, e);
            }
        }