private void qg_button_small1_Click(object sender, EventArgs e) { try { //if (monaaabegin.Text.IsNullOrEmpty()) //{ // MessageBox.Show("请选择月份"); // return; //} string pro3begin = monaaabegin.Text.ToString(); string pro3end = monaaaend.Text.ToString(); if (pro3begin.Trim() != "" && pro3end.Trim() != "") { if (pro3begin.ToInt() > pro3end.ToInt()) { string temp1 = pro3begin; pro3begin = pro3end; pro3end = temp1; //MessageBox.Show("开始月份不能大于结束月份!"); //return; } } string perid = ""; if (!string.IsNullOrEmpty(peraaa.Text)) { perid = peraaa.SelectedValue.ToString(); } permoney_one permoney = new permoney_one(); DataTable dt = permoney.permoneyone(pro3begin, pro3end, "", perid); if (dt == null || dt.Rows.Count <= 0) { MessageBox.Show("没有找到相应的工资记录!"); return; } qg_grid1.DataSource = dt; qg_grid1.AutoGenerateColumns = true; } catch (Exception ex) { ex.errormess(); } }
private void qg_button_small1_Click(object sender, EventArgs e) { string pro3begin = monaaabegin.Text.ToString(); string pro3end = monaaaend.Text.ToString(); if (pro3begin.Trim() != "" && pro3end.Trim() != "") { if (pro3begin.ToInt() > pro3end.ToInt()) { string temp1 = pro3begin; pro3begin = pro3end; pro3end = temp1; //MessageBox.Show("开始月份不能大于结束月份!"); //return; } } string bmid = ""; if (!string.IsNullOrEmpty(bmaaa.Text)) { bmid = bmaaa.SelectedValue.ToString(); } permoney_one permoney = new permoney_one(); DataTable dt_permoney_bm = permoney.permoneyonebm(pro3begin, pro3end, bmid, ""); qg_grid_tree1.DataSource = dt_permoney_bm; qg_grid_tree1.AutoGenerateColumns = true; foreach (DataGridViewColumn col in qg_grid_tree1.Columns) { if (col.Name == "部门ID" || col.Name == "员工ID" || col.Name == "排序" || col.Name == "ID" || col.Name == "上级ID" || col.Name == "显示" || col.Name == "展开" || col.Name == "编码") { col.Visible = false; } } }