Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ((SiteSystemMaster)Master).InitMenu();
            ((SiteSystemMaster)Master).li2.Attributes.Add("class", "hover ccc");
            ((SiteSystemMaster)Master).b_hmenu1.Style.Add("display", "none");
            ((SiteSystemMaster)Master).b_hmenu2.Style.Clear();
            ((SiteSystemMaster)Master).b_hmenu3.Style.Add("display", "none");
            ((SiteSystemMaster)Master).s_menu2_1.Style.Add("COLOR", "#147ab8");
            ((SiteSystemMaster)Master).s_menu2_1.Style.Add("TEXT-DECORATION", "none");

            /*判断是否是管理员身份*/
            if (Session["username"] == null)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "PopupScript", "<script>alert('请先登录系统!');top.location.href='../System/Login.aspx';</script>");
                return;
            }
            else
            {
                if (!IsPostBack)
                {
                    PositionBLL temp = new PositionBLL();
                    DataSet ds = temp.GetPositionAll("");

                    grVPositionManage.DataSource = ds.Tables[0].DefaultView;
                    grVPositionManage.DataSourceID = null;
                    grVPositionManage.DataBind();
                    temp = null;
                }
            }
        }
Пример #2
0
        private void bind()
        {
            //if (string.IsNullOrEmpty(users_id))
            //{
            //    return;
            //}

            PositionBLL positionBll = new PositionBLL();
            DataSet dsPosition = positionBll.GetPositionAll("");
            ddlPosition.DataSource = dsPosition.Tables[0].DefaultView;
            ddlPosition.DataTextField = "position_name";
            ddlPosition.DataValueField = "position_id";

            ddlPosition.DataBind();
            //ActivityBLL temp = new ActivityBLL();
            //DataSet ds = temp.GetActivityByPositionId(ddlPosition.SelectedValue);
            CommentBLL temp = new CommentBLL();
            DataSet ds = temp.GetCommentByPosition(ddlPosition.SelectedValue);
            grVActivityManage.DataSource = ds.Tables[0].DefaultView;
            grVActivityManage.DataSourceID = null;
            grVActivityManage.DataBind();
            temp = null;
        }
Пример #3
0
        private bool ImportComment(string xlsFileNm)
        {
            try
            {
                if (!File.Exists(xlsFileNm)) return false;

                int posID = Int32.Parse(ddlPosition.SelectedItem.Value);
                Workbook book = Workbook.Load(xlsFileNm);

                PositionBLL posBLL = new PositionBLL();
                DimensionBLL dimBLL = new DimensionBLL();
                CommentBLL comBLL = new CommentBLL();
                Comment com = new Comment();

                DataSet dimDS = dimBLL.GetDimensionAll();
                DataSet posDS = posBLL.GetPositionAll(string.Empty);

                comBLL.DelAllComment(posID);//删除与此岗位相关的所有评语。

                foreach (Worksheet sheet in book.Worksheets)
                {
                    string sheetNm = sheet.Name.Trim();
                    int dimID = -1;//在这里加断点可以监视单个维度的导入情况

                    foreach (DataRow row in dimDS.Tables[0].Rows)
                    {
                        if (row["dimension_name"].ToString().Equals(sheetNm))
                        {
                            dimID = Int32.Parse(row["dimension_id"].ToString().Trim());
                            break;
                        }
                    }
                    for (int rowIndex = sheet.Cells.FirstRowIndex + 1;//忽略第一行(标题行)
                        rowIndex <= sheet.Cells.LastRowIndex; rowIndex++)
                    {
                        Row row = sheet.Cells.GetRow(rowIndex);
                        com.Posion_id = posID;
                        com.Dimension_id = dimID;

                        string score_region = row.GetCell(0).StringValue.Trim();
                        if (score_region.Equals("偏高"))
                        {
                            com.Region_id = 1;
                        }
                        else if (score_region.Equals("适配"))
                        {
                            com.Region_id = 2;
                        }
                        else if (score_region.Equals("稍低"))
                        {
                            com.Region_id = 3;
                        }
                        else if (score_region.Equals("偏低"))
                        {
                            com.Region_id = 4;
                        }

                        for (int i = 1; i < sheet.Cells.LastColIndex + 1; i++)
                        {
                            com.Report_part_id = i;
                            com.Comment_nm = row.GetCell(i).StringValue.Trim();
                            comBLL.Add(com);
                        }
                    }
                }

                return true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return false;
            }
        }
Пример #4
0
        private void bind()
        {
            if (string.IsNullOrEmpty(users_id))
            {
                return;
            }

            PositionBLL positionBll = new PositionBLL();
            DataSet dsPosition = positionBll.GetPositionAll("");
            ddlPosition.DataSource = dsPosition.Tables[0].DefaultView;
            ddlPosition.DataTextField = "position_name";
            ddlPosition.DataValueField = "position_id";

            ddlPosition.DataBind();
        }