Exemplo n.º 1
0
        //void ckb_Click(object sender, EventArgs e)
        //{
        //    CheckBox ckb = (CheckBox)sender;

        //    Boatcrew b = (Boatcrew)(ckb.Tag);

        //    string name = b.name;
        //    string shift = b.shift;

        //    foreach (Control c in tlpVessel.Controls)
        //    {
        //        ucVessel uc = (ucVessel)c;

        //        ComboBox cbxItem = (ComboBox)(uc.Controls.Find("cbxItems", false)[0]);
        //        ComboBox cbxShift = (ComboBox)(uc.Controls.Find("cbxShift", false)[0]);

        //        cbxItem.Text = name;
        //        cbxShift.Text = shift;

        //        cbxItem.Enabled = false;
        //    }

        //    //for (int i = 0; i < tlpCrew.RowCount; i++)
        //    //{
        //    //    ucStat uc = (ucStat)tlpCrew.GetControlFromPosition(0, i);
        //    //    uc.RefreshShift((Boatcrew)(tbx.Tag));
        //    //}
        //}


        void ckb_Click(object sender, EventArgs e)
        {
            CheckBox ckb = (CheckBox)sender;

            tlpVessel.Controls.Clear();

            List <Boat> bl = _nboats.GetList(ckb.Tag.ToString());

            for (int i = 1; i < bl.Count; i++)  // Skip first one - it is a summary
            {
                ucVessel uc = new ucVessel(RefWeek, _ds_vessels, bl[i]);
                tlpVessel.Controls.Add(uc);
            }

            if (ckb.Checked)
            {
                foreach (Control c in tlpVessel.Controls)
                {
                    ucVessel uc = (ucVessel)c;
                    uc.RefreshVessel();
                }


                foreach (CheckBox c in flpVessels.Controls)
                {
                    c.Checked = false;
                }
                ckb.Checked = true;
            }
        }
Exemplo n.º 2
0
        //void ckb_Click(object sender, EventArgs e)
        //{
        //    CheckBox ckb = (CheckBox)sender;

        //    Boatcrew b = (Boatcrew)(ckb.Tag);

        //    string name = b.name;
        //    string shift = b.shift;

        //    foreach (Control c in tlpVessel.Controls)
        //    {
        //        ucVessel uc = (ucVessel)c;

        //        ComboBox cbxItem = (ComboBox)(uc.Controls.Find("cbxItems", false)[0]);
        //        ComboBox cbxShift = (ComboBox)(uc.Controls.Find("cbxShift", false)[0]);

        //        cbxItem.Text = name;
        //        cbxShift.Text = shift;

        //        cbxItem.Enabled = false;
        //    }

        //    //for (int i = 0; i < tlpCrew.RowCount; i++)
        //    //{
        //    //    ucStat uc = (ucStat)tlpCrew.GetControlFromPosition(0, i);
        //    //    uc.RefreshShift((Boatcrew)(tbx.Tag));
        //    //}
        //}


        void ckb_Click(object sender, EventArgs e)
        {
            CheckBox ckb = (CheckBox)sender;

            tlpVessel.Controls.Clear();
            List <Boat> bl = _nboats.GetList(ckb.Tag.ToString());

            for (int i = 1; i < bl.Count; i++)  // Skip first one
            {
                ucVessel uc = new ucVessel(RefWeek, _ds_vessels, bl[i]);
                tlpVessel.Controls.Add(uc);
            }

            //Boatcrew bc = (_oboats[ckb.Text])[0];
            //int shift = 0;


            if (ckb.Checked)
            {
                foreach (Control c in tlpVessel.Controls)
                {
                    ucVessel uc = (ucVessel)c;
                    //uc.RefreshShift(bc, shift++);
                    uc.RefreshVessel();
                }
            }
        }
Exemplo n.º 3
0
        private void btnPlus_Click(object sender, EventArgs e)
        {
            string bc = "";
            string bn = "";

            foreach (CheckBox c in flpVessels.Controls)
            {
                if (c.Checked)
                {
                    bc = c.Tag.ToString(); bn = c.Text;
                }
            }

            //Boat b = _nboats.FindBoat(bc);
            //Boat b = _nboats.Get(bc);
            //if (b != null)  bn = b.boatname;


            ucVessel uc = new ucVessel(RefWeek, _ds_vessels, bc, bn);

            tlpVessel.Controls.Add(uc);
        }