Exemplo n.º 1
0
        /// <summary>
        /// 保存信息
        /// </summary>
        /// <param name="dimension">六维图信息</param>
        public void Save(DimensionInfo dimension)
        {
            bool modify         = false;
            int  dimensionsSize = m_dimensions.Count;

            for (int i = 0; i < dimensionsSize; i++)
            {
                if (m_dimensions[i].m_jobID == dimension.m_jobID)
                {
                    m_dimensions[i] = dimension;
                    modify          = true;
                    break;
                }
            }
            if (!modify)
            {
                m_dimensions.Add(dimension);
            }
            Save();
        }
Exemplo n.º 2
0
 /// <summary>
 /// 单元格编辑结束事件
 /// </summary>
 /// <param name="sender">调用者</param>
 /// <param name="cell">单元格</param>
 private void GridCellEditEnd(object sender, GridCell cell)
 {
     if (cell != null)
     {
         DimensionService dimensionService = DataCenter.DimensionService;
         GridRow          row       = cell.Row;
         String           jobID     = row.GetCell("colF1").GetString();
         DimensionInfo    dimension = dimensionService.GetDimension(jobID);
         dimension.m_jobID      = jobID;
         dimension.m_business   = row.GetCell("colF3").GetInt();
         dimension.m_EQ         = row.GetCell("colF4").GetInt();
         dimension.m_knowledge  = row.GetCell("colF5").GetInt();
         dimension.m_IQ         = row.GetCell("colF6").GetInt();
         dimension.m_lead       = row.GetCell("colF7").GetInt();
         dimension.m_technology = row.GetCell("colF8").GetInt();
         int avg = (dimension.m_business + dimension.m_EQ + dimension.m_knowledge + dimension.m_IQ + dimension.m_lead
                    + dimension.m_technology) / 6;
         row.GetCell("colF9").SetInt(avg);
         dimensionService.Save(dimension);
         m_divDimemsion.Dimension = dimension;
         Native.Invalidate();
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// 绑定员工
        /// </summary>
        private void BindStaffs()
        {
            m_gridStaffs.CellEditMode = GridCellEditMode.DoubleClick;
            List <StaffInfo> staffs = DataCenter.StaffService.GetAliveStaffs();
            int staffsSize          = staffs.Count;
            Dictionary <String, DimensionInfo> dimensionsMap = new Dictionary <String, DimensionInfo>();
            List <DimensionInfo> dimensions = DataCenter.DimensionService.m_dimensions;
            int dimensionsSize = dimensions.Count;

            for (int i = 0; i < dimensionsSize; i++)
            {
                DimensionInfo dimension = dimensions[i];
                if (dimension.m_jobID != null && dimension.m_jobID.Length > 0)
                {
                    dimensionsMap[dimension.m_jobID] = dimension;
                }
            }
            m_gridStaffs.ClearRows();
            m_gridStaffs.BeginUpdate();
            for (int i = 0; i < staffsSize; i++)
            {
                StaffInfo     staff     = staffs[i];
                DimensionInfo dimension = null;
                if (dimensionsMap.ContainsKey(staff.m_jobID))
                {
                    dimension = dimensionsMap[staff.m_jobID];
                }
                else
                {
                    dimension              = new DimensionInfo();
                    dimension.m_business   = 100;
                    dimension.m_EQ         = 100;
                    dimension.m_IQ         = 100;
                    dimension.m_knowledge  = 100;
                    dimension.m_lead       = 100;
                    dimension.m_technology = 100;
                    dimension.m_jobID      = staff.m_jobID;
                }
                GridRow row = new GridRow();
                m_gridStaffs.AddRow(row);
                row.AddCell("colF1", new GridStringCell(staff.m_jobID));
                row.AddCell("colF2", new GridStringCell(staff.m_name));
                row.AddCell("colF3", new GridIntCell(dimension.m_business));
                row.AddCell("colF4", new GridIntCell(dimension.m_EQ));
                row.AddCell("colF5", new GridIntCell(dimension.m_knowledge));
                row.AddCell("colF6", new GridIntCell(dimension.m_IQ));
                row.AddCell("colF7", new GridIntCell(dimension.m_lead));
                row.AddCell("colF8", new GridIntCell(dimension.m_technology));
                int avg = (dimension.m_business + dimension.m_EQ + dimension.m_knowledge + dimension.m_IQ + dimension.m_lead
                           + dimension.m_technology) / 6;
                row.AddCell("colF9", new GridIntCell(avg));
                List <GridCell> cells     = row.GetCells();
                int             cellsSize = cells.Count;
                for (int j = 2; j < cellsSize - 1; j++)
                {
                    cells[j].AllowEdit = true;
                }
            }
            m_gridStaffs.EndUpdate();
            m_gridStaffs.Invalidate();
            dimensionsMap.Clear();
        }