public void ConfigFloor(int floorCount)
        {
            this.floorCount = floorCount;

            CarbinetFloor cf = new CarbinetFloor(this, 1, this.controlArray);

            //int top = cf.floor_height * this.floors.Count;
            cf.Top          = 0;
            cf.Height       = 130;
            cf.Left         = this.left;
            cf.maxDocNumber = 9;
            this.floors.Add(cf);
            cf              = new CarbinetFloor(this, 2, this.controlArray);
            cf.Top          = 130;
            cf.Height       = 110;
            cf.Left         = this.left;
            cf.maxDocNumber = 9;
            this.floors.Add(cf);
            //for (int i = 1; i <= floorCount; i++)
            //{
            //    CarbinetFloor cf = new CarbinetFloor(i, this.controlArray);
            //    int top = cf.floor_height * this.floors.Count;
            //    cf.top = top;
            //    this.floors.Add(cf);
            //}
        }
Esempio n. 2
0
        CarbinetFloor initialFloor(Carbinet group, int irow, int _rowWidth, int _rowHeight, int _rowTop)
        {
            CarbinetFloor row = new CarbinetFloor(group, irow, this.Controls);

            row.Width        = _rowWidth;
            row.Height       = _rowHeight;
            row.relativeTop  = _rowTop;
            row.relativeLeft = 0;

            return(row);
        }
Esempio n. 3
0
 public DocumentChair(DocumentFile df, CarbinetFloor cf)
 {
     this.docmentFile   = df;
     this.carbinetFloor = cf;
 }
Esempio n. 4
0
        private void InitialClassRoom()
        {
            if (this.dtRoomConfig == null)
            {
                return;
            }
            this.cmbSelectedRow.SelectedIndexChanged -= this.cmbSelectedRow_SelectedIndexChanged;
            this.numCountofRow.ValueChanged          -= this.numCountofRow_ValueChanged;
            this.numCountofColumn.ValueChanged       -= this.numCountofColumn_ValueChanged;


            this.pictureBox1.Controls.Clear();

            //获取设备和位置的对应数据
            DataTable dt = this.ctl.getAllMapConfigs();

            int numberOfGroup = dtRoomConfig.Rows.Count;
            int widthOfRoom   = this.pictureBox1.Width;
            int heightOfRow   = 38;

            int totalColumns = numberOfGroup;

            DataRow[] rows4Sum = dtRoomConfig.Select("IGROUP=1");
            if (rows4Sum.Length > 0)
            {
                totalColumns = int.Parse(rows4Sum[0]["totalColumn"].ToString());
            }
            int numberOfUnit     = totalColumns + numberOfGroup - 1;
            int widthOfUnit      = widthOfRoom / numberOfUnit;
            int groupInitialLeft = 0;

            for (int i = 0; i < numberOfGroup; i++)
            {
                int numberofColumn = 1;
                int numberOfRow    = 1;

                DataRow[] rows = dtRoomConfig.Select(string.Format("IGROUP={0}", i + 1));
                if (rows.Length > 0)
                {
                    numberofColumn = int.Parse(rows[0]["ICOLUMN"].ToString());
                    numberOfRow    = int.Parse(rows[0]["IROW"].ToString());
                }
                int groupWidth = numberofColumn * widthOfUnit;

                Carbinet group = new Carbinet(this.pictureBox1.Controls);
                group.Left = groupInitialLeft;
                group.Top  = 67;
                //this.groups.Add(group);
                //初始化每一排的行
                int initialTop = 0;
                for (int irow = 1; irow <= numberOfRow; irow++, initialTop = initialTop + (int)(1.7 * heightOfRow))
                {
                    CarbinetFloor row = new CarbinetFloor(group, irow, this.pictureBox1.Controls);
                    row.Width        = groupWidth;
                    row.Height       = heightOfRow;
                    row.relativeTop  = initialTop;
                    row.relativeLeft = 0;

                    group.AddFloor(row);

                    for (int k = 1; k <= numberofColumn; k++)
                    {
                        string       _equipmentID = i.ToString() + "," + irow.ToString() + "," + k.ToString();
                        DocumentFile df           = new DocumentFile(_equipmentID, irow);
                        df.Width  = widthOfUnit;
                        df.Height = heightOfRow;
                        DataRow[] rowsMap = dt.Select(
                            string.Format("IGROUP = {0} and IROW = {1} and ICOLUMN = {2}",
                                          i.ToString(), irow.ToString(), k.ToString()));
                        if (rowsMap.Length > 0)
                        {
                            df.Text = (string)rowsMap[0]["EQUIPEMNTID"];
                        }
                        else
                        {
                            df.Text = "";
                        }
                        df.carbinetIndex = i;
                        df.floorNumber   = irow;
                        df.columnNumber  = k;
                        df.indexBase     = k.ToString();
                        //df.doc.Click += new EventHandler(doc_Click);
                        df.Click += new EventHandler(doc_Click);
                        group.AddDocFile(df);
                    }
                }
                groupInitialLeft += groupWidth + widthOfUnit;
            }
            DataRow[] rows2 = dtRoomConfig.Select("IGROUP=1");
            if (rows2.Length > 0)
            {
                int column = int.Parse(rows2[0]["ICOLUMN"].ToString());
                int row    = int.Parse(rows2[0]["IROW"].ToString());
                this.numCountofColumn.Value = (decimal)column;
                this.numCountofRow.Value    = (decimal)row;
            }

            this.cmbSelectedRow.SelectedIndexChanged += new System.EventHandler(this.cmbSelectedRow_SelectedIndexChanged);
            this.numCountofRow.ValueChanged          += new System.EventHandler(this.numCountofRow_ValueChanged);
            this.numCountofColumn.ValueChanged       += new System.EventHandler(this.numCountofColumn_ValueChanged);

            return;
            //int numberOfGroup = (int)this.numCountofGroup.Value;
            //int numberofColumn = (int)this.numCountofColumn.Value;
            //int numberOfRow = (int)this.numCountofRow.Value;


            //int numberOfUnit = numberOfGroup * numberofColumn + numberOfGroup - 1;
            //int widthOfUnit = widthOfRoom / numberOfUnit;
            //int groupInitialLeft = 0;
            //int groupWidth = numberofColumn * widthOfUnit;

            //for (int i = 0; i < numberOfGroup; i++)
            //{
            //    Carbinet group = new Carbinet(this.pictureBox1.Controls);
            //    group.Left = groupInitialLeft;
            //    group.Top = 67;
            //    //this.groups.Add(group);
            //    //初始化每一排的行
            //    int initialTop = 0;
            //    for (int irow = 1; irow <= numberOfRow; irow++, initialTop = initialTop + (int)(1.7 * heightOfRow))
            //    {
            //        CarbinetFloor row = new CarbinetFloor(group, irow, this.pictureBox1.Controls);
            //        row.Width = groupWidth;
            //        row.Height = heightOfRow;
            //        row.relativeTop = initialTop;
            //        row.relativeLeft = 0;

            //        group.AddFloor(row);

            //        for (int k = 1; k <= numberofColumn; k++)
            //        {
            //            string _equipmentID = i.ToString() + "," + irow.ToString() + "," + k.ToString();
            //            DocumentFile df = new DocumentFile(_equipmentID, irow);
            //            df.Width = widthOfUnit;
            //            df.Height = heightOfRow;
            //            DataRow[] rows = dt.Select(
            //                string.Format("IGROUP = {0} and IROW = {1} and ICOLUMN = {2}",
            //                                i.ToString(), irow.ToString(), k.ToString()));
            //            if (rows.Length > 0)
            //            {
            //                df.Text = (string)rows[0]["EQUIPEMNTID"];
            //            }
            //            else
            //            {
            //                df.Text = "";
            //            }
            //            df.carbinetIndex = i;
            //            df.floorNumber = irow;
            //            df.columnNumber = k;
            //            df.indexBase = k.ToString();
            //            //df.doc.Click += new EventHandler(doc_Click);
            //            df.Click += new EventHandler(doc_Click);
            //            group.AddDocFile(df);
            //        }

            //    }
            //    groupInitialLeft += groupWidth + widthOfUnit;
            //}
        }
Esempio n. 5
0
        private void InitialClassRoom()
        {
            this.button6.Left = (this.pictureBox1.Width - this.button6.Width) / 2 + this.pictureBox1.Left;

            int numberOfGroup = dtRoomConfig.Rows.Count;
            int widthOfRoom   = this.pictureBox1.Width;
            int heightOfRow   = 38;

            int totalColumns = numberOfGroup;

            DataRow[] rows4Sum = dtRoomConfig.Select("IGROUP=1");
            if (rows4Sum.Length > 0)
            {
                totalColumns = int.Parse(rows4Sum[0]["totalColumn"].ToString());
            }
            int numberOfUnit     = totalColumns + numberOfGroup - 1;
            int widthOfUnit      = widthOfRoom / numberOfUnit;
            int groupInitialLeft = 0;

            for (int i = 0; i < numberOfGroup; i++)
            {
                int numberofColumn = 1;
                int numberOfRow    = 1;

                DataRow[] rows = dtRoomConfig.Select(string.Format("IGROUP={0}", i + 1));
                if (rows.Length > 0)
                {
                    numberofColumn = int.Parse(rows[0]["ICOLUMN"].ToString());
                    numberOfRow    = int.Parse(rows[0]["IROW"].ToString());
                }
                int groupWidth = numberofColumn * widthOfUnit;

                Carbinet group = new Carbinet(this.pictureBox1.Controls);
                group.Left = groupInitialLeft;
                group.Top  = 67;
                this.groups.Add(group);
                //初始化每一排的行
                int initialTop = 0;
                for (int irow = 1; irow <= numberOfRow; irow++, initialTop = initialTop + (int)(1.7 * heightOfRow))
                {
                    CarbinetFloor row = new CarbinetFloor(group, irow, this.pictureBox1.Controls);
                    row.Width        = groupWidth;
                    row.Height       = heightOfRow;
                    row.relativeTop  = initialTop;
                    row.relativeLeft = 0;

                    group.AddFloor(row);

                    for (int k = 1; k <= numberofColumn; k++)
                    {
                        // 如果座位与设备已经设置绑定的话,则在此处将座位与设备ID相挂钩
                        DataRow[] rowsMap = mapConfigsTable.Select(
                            string.Format("IGROUP = {0} and IROW = {1} and ICOLUMN = {2}",
                                          i.ToString(), irow.ToString(), k.ToString()));

                        string _equipmentID = i.ToString() + "," + irow.ToString() + "," + k.ToString();
                        if (rowsMap.Length > 0)
                        {
                            _equipmentID = (string)rowsMap[0]["EQUIPEMNTID"];
                        }
                        DocumentFile df = new DocumentFile(_equipmentID, irow);
                        df.Width         = widthOfUnit;
                        df.Height        = heightOfRow;
                        df.carbinetIndex = i;
                        df.floorNumber   = irow;
                        df.columnNumber  = k;
                        df.indexBase     = k.ToString();
                        df.Click        += new EventHandler(df_Click);
                        group.AddDocFile(df);
                    }
                }
                groupInitialLeft += groupWidth + widthOfUnit;
            }
        }
        /// <summary>
        /// 配置档案柜的层,每层的高度和放置档案的最大数量
        /// </summary>
        /// <param name="floorIndex"></param>
        /// <param name="height"></param>
        /// <param name="maxDoc"></param>
        public void ConfigFloor(int floorIndex, int height, int maxDoc)
        {
            CarbinetFloor floor = null;

            if (floorIndex <= 0)
            {
#if _debug_carbinet
                Debug.WriteLine("floor index error,start from 1");
#endif
                return;
            }
            if (floorIndex == 1)
            {
                if (this.floors.Count >= 1)
                {
                    floor = this.floors[0];
                }
                else
                {
                    floor = new CarbinetFloor(this, 1, this.controlArray);
                    this.floors.Add(floor);
                }
            }
            else
            {
                if (floorIndex - 1 > this.floors.Count)// 越层初始化,即初始化2层的时候1层尚未初始化
                {
#if _debug_carbinet
                    Debug.WriteLine(string.Format("initial floor error ->  floor index = {0}", floorIndex));
#endif
                    return;
                }
                if (floorIndex <= this.floors.Count)
                {
                    floor = this.floors[floorIndex - 1];
                }
                else
                {
                    floor = new CarbinetFloor(this, floorIndex, this.controlArray);
                    this.floors.Add(floor);
                }
            }
            if (floor != null)
            {
                floor.Height       = height;
                floor.maxDocNumber = maxDoc;
            }
            // 每层的空间配置
            if (floor.floorNumber == 1)
            {
                floor.Top  = 24;
                floor.Left = this.leftPading;
            }

            if (floor.floorNumber == 2)
            {
                floor.Top  = 137;
                floor.Left = this.leftPading;
            }
            if (floor.floorNumber == 3)
            {
                floor.Top  = 220;
                floor.Left = this.leftPading;
            }
        }
 public void AddFloor(CarbinetFloor cf)
 {
     cf.Left = this.left + cf.relativeLeft;
     cf.Top  = this.top + cf.relativeTop;
     this.floors.Add(cf);
 }