protected void gvList_DataBound(object sender, EventArgs e) { LinkButton btnView; //// btnDisdimission, btnDimission; Label labDimission; ImageButton ibtnEdit, ibtnAddChild; UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.PersonEditUrl); if (!(this.gvList.Rows.Count == 1 && (this.gvList.Rows[0].Cells[0].Text == SalaryConst.EmptyText || this.gvList.DataKeys[0].Value == null))) { for (Int32 i = 0; i < this.gvList.Rows.Count; i++) { btnView = this.gvList.Rows[i].FindControl("btnView") as LinkButton; ibtnEdit = this.gvList.Rows[i].FindControl("ibtnEdit") as ImageButton; ibtnAddChild = this.gvList.Rows[i].FindControl("ibtnAddChild") as ImageButton; labDimission = this.gvList.Rows[i].FindControl("labDimission") as Label; labDimission.Text = bool.Parse(this.gvList.DataKeys[i][PersonInfoConst.Dimission].ToString()) ? "离职" : "在职"; labDimission.ForeColor = bool.Parse(this.gvList.DataKeys[i][PersonInfoConst.Dimission].ToString()) ? System.Drawing.Color.Red : System.Drawing.Color.Black; ////btnDisdimission = this.gvList.Rows[i].FindControl("btnDisdimission") as LinkButton; ////btnDimission = this.gvList.Rows[i].FindControl("btnDimission") as LinkButton; urlEdit.AppendItem(PersonInfoConst.PersonID, this.gvList.DataKeys[i].Values[PersonInfoConst.PersonID]); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit); base.ControlClientClickBindOpen(btnView, 800, 500, urlEdit.ToUrlString()); urlEdit.RemoveAt(1); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit); base.ControlClientClickBindOpen(ibtnEdit, 800, 500, urlEdit.ToUrlString()); urlEdit.Clear(); if (String.IsNullOrEmpty(this.gvList.DataKeys[i].Values[PersonInfoConst.ParentID].ToString())) { urlEdit.AppendItem(PersonInfoConst.ParentID, this.gvList.DataKeys[i].Values[PersonInfoConst.PersonID]); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add); base.ControlClientClickBindOpen(ibtnAddChild, 800, 500, urlEdit.ToUrlString()); urlEdit.Clear(); } else { this.gvList.Rows[i].Cells[0].Text = ""; this.gvList.Rows[i].Cells[1].Text = ""; ibtnAddChild.Visible = false; } ////if (bool.Parse(this.gvList.DataKeys[i][PersonInfoConst.Dimission].ToString())) ////{ //// btnDimission.Enabled = false; //// btnDisdimission.Attributes.Add("OnClick", String.Format(@"return confirm('您确认要入职该用户?')")); ////} ////else ////{ //// btnDisdimission.Enabled = false; //// btnDimission.Attributes.Add("OnClick", String.Format(@"return confirm('您确认要离职该用户?')")); ////} } } ImageButton ibtnAdd = this.gvList.HeaderRow.FindControl("ibtnAdd") as ImageButton; urlEdit = new UrlParamBuilder(SalaryConst.PersonEditUrl); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add); base.ControlClientClickBindOpen(ibtnAdd, 600, 400, urlEdit.ToUrlString()); }
protected void gvList_DataBound(object sender, EventArgs e) { LinkButton btnView, btnUse, btnLogout; ImageButton ibtnEdit, ibtnAddChild; UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.DeparmentEditUrl); if (!(this.gvList.Rows.Count == 1 && (this.gvList.Rows[0].Cells[0].Text == SalaryConst.EmptyText || this.gvList.DataKeys[0].Value == null))) { for (Int32 i = 0; i < this.gvList.Rows.Count; i++) { String strDeptID = this.gvList.DataKeys[i].Values[DepartmentInfoConst.DepartmentID].ToString(); String strDeptCode = this.gvList.DataKeys[i].Values[DepartmentInfoConst.DepartmentCode].ToString(); btnView = this.gvList.Rows[i].FindControl("btnView") as LinkButton; ibtnEdit = this.gvList.Rows[i].FindControl("ibtnEdit") as ImageButton; ibtnAddChild = this.gvList.Rows[i].FindControl("ibtnAddChild") as ImageButton; btnUse = this.gvList.Rows[i].FindControl("btnUse") as LinkButton; btnLogout = this.gvList.Rows[i].FindControl("btnLogout") as LinkButton; //缩进 btnView.Text = SalaryAppAdapter.Instance.AddSpaceInFrontOfDeptName(strDeptCode) + btnView.Text; urlEdit.AppendItem(DepartmentInfoConst.DepartmentID, strDeptID); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit); base.ControlClientClickBindShow(btnView, 380, 310, urlEdit.ToUrlString()); urlEdit.RemoveAt(1); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit); base.ControlClientClickBindShow(ibtnEdit, 380, 310, urlEdit.ToUrlString()); urlEdit.Clear(); urlEdit.AppendItem(DepartmentInfoConst.ParentID, strDeptID); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add); base.ControlClientClickBindShow(ibtnAddChild, 380, 310, urlEdit.ToUrlString()); urlEdit.Clear(); btnUse.Text = EnumHelper.GetDescription(Status.True); btnLogout.Text = EnumHelper.GetDescription(Status.False); if (bool.Parse(this.gvList.DataKeys[i][DepartmentInfoConst.UseFlag].ToString())) { btnLogout.Enabled = false; btnUse.Attributes.Add("OnClick", String.Format(@"return confirm('您确认要{0}该部门?')", btnUse.Text)); } else { btnUse.Enabled = false; btnLogout.Attributes.Add("OnClick", String.Format(@"return confirm('您确认要{0}该部门?')", btnLogout.Text)); } } } ImageButton ibtnAdd = this.gvList.HeaderRow.FindControl("ibtnAdd") as ImageButton; urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add); base.ControlClientClickBindShow(ibtnAdd, 380, 310, urlEdit.ToUrlString()); }
protected void gvList_DataBound(object sender, EventArgs e) { LinkButton btnView, btnUse, btnLogout; ImageButton ibtnEdit, ibtnAddChild; UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.DeparmentEditUrl); if (!(this.gvList.Rows.Count == 1 && (this.gvList.Rows[0].Cells[0].Text == SalaryConst.EmptyText || this.gvList.DataKeys[0].Value == null))) { for (Int32 i = 0; i < this.gvList.Rows.Count; i++) { String strDeptID=this.gvList.DataKeys[i].Values[DepartmentInfoConst.DepartmentID].ToString(); String strDeptCode = this.gvList.DataKeys[i].Values[DepartmentInfoConst.DepartmentCode].ToString(); btnView = this.gvList.Rows[i].FindControl("btnView") as LinkButton; ibtnEdit = this.gvList.Rows[i].FindControl("ibtnEdit") as ImageButton; ibtnAddChild = this.gvList.Rows[i].FindControl("ibtnAddChild") as ImageButton; btnUse = this.gvList.Rows[i].FindControl("btnUse") as LinkButton; btnLogout = this.gvList.Rows[i].FindControl("btnLogout") as LinkButton; //缩进 btnView.Text = SalaryAppAdapter.Instance.AddSpaceInFrontOfDeptName(strDeptCode) + btnView.Text; urlEdit.AppendItem(DepartmentInfoConst.DepartmentID, strDeptID); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit); base.ControlClientClickBindShow(btnView, 380, 310, urlEdit.ToUrlString()); urlEdit.RemoveAt(1); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit); base.ControlClientClickBindShow(ibtnEdit, 380, 310, urlEdit.ToUrlString()); urlEdit.Clear(); urlEdit.AppendItem(DepartmentInfoConst.ParentID, strDeptID); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add); base.ControlClientClickBindShow(ibtnAddChild, 380, 310, urlEdit.ToUrlString()); urlEdit.Clear(); btnUse.Text = EnumHelper.GetDescription(Status.True); btnLogout.Text = EnumHelper.GetDescription(Status.False); if (bool.Parse(this.gvList.DataKeys[i][DepartmentInfoConst.UseFlag].ToString())) { btnLogout.Enabled = false; btnUse.Attributes.Add("OnClick", String.Format(@"return confirm('您确认要{0}该部门?')", btnUse.Text)); } else { btnUse.Enabled = false; btnLogout.Attributes.Add("OnClick", String.Format(@"return confirm('您确认要{0}该部门?')", btnLogout.Text)); } } } ImageButton ibtnAdd = this.gvList.HeaderRow.FindControl("ibtnAdd") as ImageButton; urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add); base.ControlClientClickBindShow(ibtnAdd, 380, 310, urlEdit.ToUrlString()); }
protected void gvSelectedFeeList_DataBound(object sender, EventArgs e) { GridView gv = (GridView)sender; LinkButton btnView; UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.FeeEditUrl); if (!(gv.Rows.Count == 1 && (gv.Rows[0].Cells[0].Text == SalaryConst.EmptyText || gv.DataKeys[0].Value == null))) { for (Int32 i = 0; i < gv.Rows.Count; i++) { String strFeeID = gv.DataKeys[i].Values[ReportFeeConst.FeeID].ToString(); //TextBox tb = this.gvSelectedFeeList.Rows[i].FindControl("tbOrderNo") as TextBox; //tb.Style.Add("direction", "rtl"); btnView = gv.Rows[i].FindControl("btnView") as LinkButton; String ParentFeeName = FeeInfoAdapter.Instance.LoadFeeInfo(null, strFeeID).ParentName; btnView.Text = (String.IsNullOrEmpty(ParentFeeName) ? String.Empty : String.Concat("{", ParentFeeName, "}")) + btnView.Text;//缩进 urlEdit.AppendItem(FeeInfoConst.FeeID, strFeeID); urlEdit.AppendItem(FeeInfoConst.FeeType, this.gvSelectedFeeList.DataKeys[i].Values[FeeInfoConst.FeeType]); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.View); base.ControlClientClickBindOpen(btnView, 700, 500, urlEdit.ToUrlString()); urlEdit.Clear(); } } }
/* * protected void btnSaveFeeClick(Object sender, EventArgs e) * { * List<ReportFee> select = new List<ReportFee>(); * for (Int32 i = 0; i < this.gvFeeList.Rows.Count; i++) * { * CheckBox ckb = (CheckBox)this.gvFeeList.Rows[i].FindControl("ckbSelect"); * TextBox tbOrderNo = (TextBox)this.gvFeeList.Rows[i].FindControl("tbOrderNo"); * String orderNo = tbOrderNo.Text.Trim(); * if (String.IsNullOrEmpty(orderNo) || !StrHelper.IsValidInt(orderNo)) * { * base.MessageBox("排序字段必须为整数!"); * tbOrderNo.Focus(); * return; * } * * if (ckb.Checked) * { * ReportFee info = new ReportFee(); * info.ReportID = reportID; * info.FeeID = this.gvFeeList.DataKeys[i].Values[FeeInfoConst.FeeID].ToString(); * info.FeeName = this.gvFeeList.DataKeys[i].Values[FeeInfoConst.FeeName].ToString(); * info.OrderNo = Int32.Parse(orderNo); * select.Add(info); * } * } * ReportAdapter.Instance.InsertReportFee(select); * this.GridViewDataBind(); * base.MessageBox("报表工资项目保存成功!"); * } */ protected void gvFeeList_DataBound(object sender, EventArgs e) { GridView gv = (GridView)sender; LinkButton btnView; UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.FeeEditUrl); if (!(gv.Rows.Count == 1 && (gv.Rows[0].Cells[0].Text == SalaryConst.EmptyText || gv.DataKeys[0].Value == null))) { for (Int32 i = 0; i < gv.Rows.Count; i++) { String strFeeID = gv.DataKeys[i].Values[FeeInfoConst.FeeID].ToString(); String strFeeCode = gv.DataKeys[i].Values[FeeInfoConst.FeeCode].ToString(); TextBox tb = gv.Rows[i].FindControl("tbOrderNo") as TextBox; tb.Style.Add("direction", "rtl"); btnView = gv.Rows[i].FindControl("btnView") as LinkButton; btnView.Text = SalaryAppAdapter.Instance.AddSpaceInFrontOfFeeName(strFeeCode) + btnView.Text;//缩进 urlEdit.AppendItem(FeeInfoConst.FeeID, strFeeID); urlEdit.AppendItem(FeeInfoConst.FeeType, gv.DataKeys[i].Values[FeeInfoConst.FeeType]); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.View); base.ControlClientClickBindOpen(btnView, 700, 500, urlEdit.ToUrlString()); urlEdit.Clear(); } } }
protected void gvList_DataBound(object sender, EventArgs e) { LinkButton btnView, btnUse, btnLogout; ImageButton ibtnEdit; UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.ReportEditUrl); if (!(this.gvList.Rows.Count == 1 && (this.gvList.Rows[0].Cells[0].Text == SalaryConst.EmptyText || this.gvList.DataKeys[0].Value == null))) { for (Int32 i = 0; i < this.gvList.Rows.Count; i++) { btnView = this.gvList.Rows[i].FindControl("btnView") as LinkButton; //btnEdit = this.gvList.Rows[i].FindControl("btnEdit") as LinkButton; btnUse = this.gvList.Rows[i].FindControl("btnUse") as LinkButton; btnLogout = this.gvList.Rows[i].FindControl("btnLogout") as LinkButton; ibtnEdit = this.gvList.Rows[i].FindControl("ibtnEdit") as ImageButton; ////if (btnView.Text == "薪资表") ////{ //// LinkButton btnDelete = this.gvList.Rows[i].FindControl("btnDelete") as LinkButton; //// btnDelete.Style.Add("display", "none"); //// btnEdit.Style.Add("display", "none"); //// continue; ////} urlEdit.AppendItem(ReportInfoConst.ReportID, this.gvList.DataKeys[i].Values[ReportInfoConst.ReportID]); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit); base.ControlClientClickBindOpen(btnView, 800, 500, urlEdit.ToUrlString()); urlEdit.RemoveAt(1); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit); //base.ControlClientClickBindOpen(btnEdit, 370, 300, urlEdit.ToUrlString()); base.ControlClientClickBindOpen(ibtnEdit, 800, 500, urlEdit.ToUrlString()); urlEdit.Clear(); btnUse.Text = EnumHelper.GetDescription(Status.True); btnLogout.Text = EnumHelper.GetDescription(Status.False); if (bool.Parse(this.gvList.DataKeys[i][ProjectInfoConst.UseFlag].ToString())) { btnLogout.Enabled = false; btnUse.Attributes.Add("OnClick", String.Format(@"return confirm('您确认要{0}该报表?')", btnUse.Text)); } else { btnUse.Enabled = false; btnLogout.Attributes.Add("OnClick", String.Format(@"return confirm('您确认要{0}该报表?')", btnLogout.Text)); } } } ImageButton ibtnAdd = this.gvList.HeaderRow.FindControl("ibtnAdd") as ImageButton; urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add); base.ControlClientClickBindOpen(ibtnAdd, 800, 500, urlEdit.ToUrlString()); }
protected void gvList_DataBound(object sender, EventArgs e) { ImageButton ibtnEdit; UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.PersonEditUrl); Double[] dobSum = new Double[this.gvList.FooterRow.Cells.Count]; //Array.Clear(dobSum, 0, dobSum.Length); //for (Int32 i = 0; i < dobSum.Length; i++) //{ // dobSum[i] = 0; //} if (!(this.gvList.Rows.Count == 1 && (this.gvList.Rows[0].Cells[0].Text == SalaryConst.EmptyText || this.gvList.DataKeys[0].Value.ToString() == ""))) { for (Int32 i = 0; i < this.gvList.Rows.Count; i++) { for (Int32 j = 0; j < this.gvList.HeaderRow.Cells.Count; j++) { if (this.gvList.HeaderRow.Cells[j].Text != "姓名" && this.gvList.HeaderRow.Cells[j].Text != "部门" && this.gvList.HeaderRow.Cells[j].Text != "操作" && this.gvList.HeaderRow.Cells[j].Visible) { String text = Server.HtmlDecode(this.gvList.Rows[i].Cells[j].Text.Trim()); dobSum[j] += text.Trim().Length > 0 ? Double.Parse(text) : 0; } } ibtnEdit = this.gvList.Rows[i].FindControl("ibtnEdit") as ImageButton; if (!String.IsNullOrEmpty(yearMonth)) { urlEdit.AppendItem(PayMonthInfoConst.YearMonth, yearMonth); } urlEdit.AppendItem(PayMonthInfoConst.PersonID, this.gvList.DataKeys[i].Values[PersonInfoConst.PersonID]); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit); base.ControlClientClickBindOpen(ibtnEdit, 460, 800, urlEdit.ToUrlString()); urlEdit.Clear(); } for (Int32 i = 0; i < this.gvList.FooterRow.Cells.Count; i++) { if (this.gvList.HeaderRow.Cells[i].Text == "姓名" || this.gvList.HeaderRow.Cells[i].Text == "部门") { this.gvList.FooterRow.Cells[i].Text = "合计:"; } if (this.gvList.HeaderRow.Cells[i].Text != "姓名" && this.gvList.HeaderRow.Cells[i].Text != "部门" && this.gvList.HeaderRow.Cells[i].Text != "操作" && this.gvList.HeaderRow.Cells[i].Visible) { this.gvList.FooterRow.Cells[i].Text = dobSum[i].ToString("#,##0.00"); } } } }
protected void gvList_DataBound(object sender, EventArgs e) { LinkButton btnView, btnResetPassword, btnUse, btnLogout; ImageButton ibtnEdit; UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.UserEditUrl); if (!(this.gvList.Rows.Count == 1 && (this.gvList.Rows[0].Cells[0].Text == SalaryConst.EmptyText || this.gvList.DataKeys[0].Value == null))) { for (Int32 i = 0; i < this.gvList.Rows.Count; i++) { btnView = this.gvList.Rows[i].FindControl("btnView") as LinkButton; ibtnEdit = this.gvList.Rows[i].FindControl("ibtnEdit") as ImageButton; btnResetPassword = this.gvList.Rows[i].FindControl("btnResetPassword") as LinkButton; btnUse = this.gvList.Rows[i].FindControl("btnUse") as LinkButton; btnLogout = this.gvList.Rows[i].FindControl("btnLogout") as LinkButton; urlEdit.AppendItem(UserInfoConst.UserId, this.gvList.DataKeys[i].Values[UserInfoConst.UserId]); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit); //ActionType.View base.ControlClientClickBindShow(btnView, 370, 200, urlEdit.ToUrlString()); urlEdit.RemoveAt(1); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit); base.ControlClientClickBindShow(ibtnEdit, 370, 200, urlEdit.ToUrlString()); urlEdit.Clear(); //btnResetPassword.Attributes.Add("OnClick", String.Format(@"return confirm('您确认要重置该用户的密码为{0}?')", SalaryConst.DefaultPassword)); btnUse.Text = EnumHelper.GetDescription(Status.True); btnLogout.Text = EnumHelper.GetDescription(Status.False); if (this.gvList.DataKeys[i][UserInfoConst.Logout].ToString() == (Status.True.ToString("D")).ToString()) { btnUse.Enabled = false; btnLogout.Attributes.Add("OnClick", String.Format(@"return confirm('您确认要{0}该用户?')", btnLogout.Text)); } else { btnLogout.Enabled = false; btnUse.Attributes.Add("OnClick", String.Format(@"return confirm('您确认要{0}该用户?')", btnUse.Text)); } } } ImageButton ibtnAdd = this.gvList.HeaderRow.FindControl("ibtnAdd") as ImageButton; urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add); base.ControlClientClickBindShow(ibtnAdd, 370, 200, urlEdit.ToUrlString()); }
protected void gvList_DataBound(object sender, EventArgs e) { LinkButton btnView; ImageButton ibtnEdit, ibtnFeeMonth; UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.SalaryEditUrl); UrlParamBuilder urlFeeMonthList = new UrlParamBuilder(SalaryConst.FeeListUrl); String yearMonth = ""; if (!(this.gvList.Rows.Count == 1 && (this.gvList.Rows[0].Cells[0].Text == SalaryConst.EmptyText || this.gvList.DataKeys[0].Value.ToString() == ""))) { for (Int32 i = 0; i < this.gvList.Rows.Count; i++) { if (this.gvList.EditIndex != i) { btnView = this.gvList.Rows[i].FindControl("btnView") as LinkButton; ibtnEdit = this.gvList.Rows[i].FindControl("ibtnEdit") as ImageButton; ibtnFeeMonth = this.gvList.Rows[i].FindControl("ibtnFeeMonth") as ImageButton; yearMonth = this.gvList.DataKeys[i].Values[PayMonthInfoConst.YearMonth].ToString().Replace("年", "").Replace("月", ""); urlFeeMonthList.AppendItem(FeeMonthInfoConst.YearMonth, yearMonth); base.ControlClientClickBindOpen(ibtnFeeMonth, 480, 600, urlFeeMonthList.ToUrlString()); urlEdit.AppendItem(PayMonthInfoConst.YearMonth, yearMonth); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit); base.ControlClientClickBindOpen(btnView, 900, 700, urlEdit.ToUrlString()); urlEdit.RemoveAt(1); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit); base.ControlClientClickBindOpen(ibtnEdit, 900, 700, urlEdit.ToUrlString()); urlEdit.Clear(); urlFeeMonthList.Clear(); } } } //ImageButton ibtnAdd = this.gvList.HeaderRow.FindControl("ibtnAdd") as ImageButton; //urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add); //base.ControlClientClickBindOpen(ibtnAdd, 370, 300, urlEdit.ToUrlString()); }
protected void gvList_DataBound(object sender, EventArgs e) { LinkButton btnView; ImageButton ibtnEdit, ibtnFeeMonth; UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.SalaryEditUrl); UrlParamBuilder urlFeeMonthList = new UrlParamBuilder(SalaryConst.FeeListUrl); String yearMonth=""; if (!(this.gvList.Rows.Count == 1 && (this.gvList.Rows[0].Cells[0].Text == SalaryConst.EmptyText || this.gvList.DataKeys[0].Value.ToString() == ""))) { for (Int32 i = 0; i < this.gvList.Rows.Count; i++) { if (this.gvList.EditIndex != i) { btnView = this.gvList.Rows[i].FindControl("btnView") as LinkButton; ibtnEdit = this.gvList.Rows[i].FindControl("ibtnEdit") as ImageButton; ibtnFeeMonth = this.gvList.Rows[i].FindControl("ibtnFeeMonth") as ImageButton; yearMonth = this.gvList.DataKeys[i].Values[PayMonthInfoConst.YearMonth].ToString().Replace("年", "").Replace("月", ""); urlFeeMonthList.AppendItem(FeeMonthInfoConst.YearMonth, yearMonth); base.ControlClientClickBindOpen(ibtnFeeMonth, 480, 600, urlFeeMonthList.ToUrlString()); urlEdit.AppendItem(PayMonthInfoConst.YearMonth, yearMonth); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit); base.ControlClientClickBindOpen(btnView, 900, 700, urlEdit.ToUrlString()); urlEdit.RemoveAt(1); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit); base.ControlClientClickBindOpen(ibtnEdit, 900,700, urlEdit.ToUrlString()); urlEdit.Clear(); urlFeeMonthList.Clear(); } } } //ImageButton ibtnAdd = this.gvList.HeaderRow.FindControl("ibtnAdd") as ImageButton; //urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add); //base.ControlClientClickBindOpen(ibtnAdd, 370, 300, urlEdit.ToUrlString()); }
/* protected void btnSaveFeeClick(Object sender, EventArgs e) { List<ReportFee> select = new List<ReportFee>(); for (Int32 i = 0; i < this.gvFeeList.Rows.Count; i++) { CheckBox ckb = (CheckBox)this.gvFeeList.Rows[i].FindControl("ckbSelect"); TextBox tbOrderNo = (TextBox)this.gvFeeList.Rows[i].FindControl("tbOrderNo"); String orderNo = tbOrderNo.Text.Trim(); if (String.IsNullOrEmpty(orderNo) || !StrHelper.IsValidInt(orderNo)) { base.MessageBox("排序字段必须为整数!"); tbOrderNo.Focus(); return; } if (ckb.Checked) { ReportFee info = new ReportFee(); info.ReportID = reportID; info.FeeID = this.gvFeeList.DataKeys[i].Values[FeeInfoConst.FeeID].ToString(); info.FeeName = this.gvFeeList.DataKeys[i].Values[FeeInfoConst.FeeName].ToString(); info.OrderNo = Int32.Parse(orderNo); select.Add(info); } } ReportAdapter.Instance.InsertReportFee(select); this.GridViewDataBind(); base.MessageBox("报表工资项目保存成功!"); } */ protected void gvFeeList_DataBound(object sender, EventArgs e) { GridView gv = (GridView)sender; LinkButton btnView; UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.FeeEditUrl); if (!(gv.Rows.Count == 1 && (gv.Rows[0].Cells[0].Text == SalaryConst.EmptyText || gv.DataKeys[0].Value == null))) { for (Int32 i = 0; i < gv.Rows.Count; i++) { String strFeeID = gv.DataKeys[i].Values[FeeInfoConst.FeeID].ToString(); String strFeeCode = gv.DataKeys[i].Values[FeeInfoConst.FeeCode].ToString(); TextBox tb = gv.Rows[i].FindControl("tbOrderNo") as TextBox; tb.Style.Add("direction", "rtl"); btnView = gv.Rows[i].FindControl("btnView") as LinkButton; btnView.Text = SalaryAppAdapter.Instance.AddSpaceInFrontOfFeeName(strFeeCode) + btnView.Text;//缩进 urlEdit.AppendItem(FeeInfoConst.FeeID, strFeeID); urlEdit.AppendItem(FeeInfoConst.FeeType, gv.DataKeys[i].Values[FeeInfoConst.FeeType]); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.View); base.ControlClientClickBindOpen(btnView, 700, 500, urlEdit.ToUrlString()); urlEdit.Clear(); } } }
protected void gvList_DataBound(object sender, EventArgs e) { LinkButton btnView, btnUse, btnLogout; ImageButton ibtnEdit, ibtnAddChild; UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.FeeEditUrl); if (!(this.gvList.Rows.Count == 1 && (this.gvList.Rows[0].Cells[0].Text == SalaryConst.EmptyText || this.gvList.DataKeys[0].Value == null))) { String strAddSpace = String.Empty; for (Int32 i = 0; i < this.gvList.Rows.Count; i++) { String strFeeCode = this.gvList.DataKeys[i].Values[FeeInfoConst.FeeCode].ToString(); String strFeeID = this.gvList.DataKeys[i].Values[FeeInfoConst.FeeID].ToString(); btnView = this.gvList.Rows[i].FindControl("btnView") as LinkButton; ibtnEdit = this.gvList.Rows[i].FindControl("ibtnEdit") as ImageButton; ibtnAddChild = this.gvList.Rows[i].FindControl("ibtnAddChild") as ImageButton; btnUse = this.gvList.Rows[i].FindControl("btnUse") as LinkButton; btnLogout = this.gvList.Rows[i].FindControl("btnLogout") as LinkButton; //缩进 strAddSpace = SalaryAppAdapter.Instance.AddSpaceInFrontOfFeeName(strFeeCode); btnView.Text = strAddSpace + btnView.Text; if (!String.IsNullOrEmpty(yearMonth)) { urlEdit.AppendItem(FeeMonthInfoConst.YearMonth, yearMonth); } urlEdit.AppendItem(FeeInfoConst.FeeID, strFeeID); urlEdit.AppendItem(FeeInfoConst.FeeType, this.enumFeeType.ToString()); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit); base.ControlClientClickBindOpen(btnView, 620, 510, urlEdit.ToUrlString()); urlEdit.RemoveAt(2); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit); base.ControlClientClickBindOpen(ibtnEdit, 620, 510, urlEdit.ToUrlString()); urlEdit.Clear(); if ((this.enumFeeType.Equals(FeeType.Tax) || this.enumFeeType.Equals(FeeType.Parameter)) && strAddSpace.Length > 0) { btnView.Visible = false; ibtnAddChild.Visible = false; this.gvList.Rows[i].Cells[0].Text = ""; } else { urlEdit.AppendItem(FeeInfoConst.FeeType, this.enumFeeType.ToString()); //urlEdit.AppendItem(FeeInfoConst.CommonFeeType, this.enumCommonFeeType.ToString());//NOT urlEdit.AppendItem(FeeInfoConst.ParentID, strFeeID); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add); base.ControlClientClickBindOpen(ibtnAddChild, 620, 510, urlEdit.ToUrlString()); urlEdit.Clear(); } btnUse.Text = EnumHelper.GetDescription(Status.True); btnLogout.Text = EnumHelper.GetDescription(Status.False); if (bool.Parse(this.gvList.DataKeys[i][FeeInfoConst.UseFlag].ToString())) { btnLogout.Enabled = false; btnUse.Attributes.Add("OnClick", String.Format(@"return confirm('您确认要{0}该工资项目?')", btnUse.Text)); } else { btnUse.Enabled = false; btnLogout.Attributes.Add("OnClick", String.Format(@"return confirm('您确认要{0}该工资项目?')", btnLogout.Text)); } #region 未完成 /** * //验证工资项目的完整性 * FeeType feeType = EnumHelper.Parse<FeeType>(this.gvList.DataKeys[i].Values[FeeInfoConst.FeeType].ToString()); * switch (feeType) * { * case FeeType.BaseCoefficient: * if (FeeInfoAdapter.Instance.GetFeeDetailList(this.gvList.DataKeys[i].Values[FeeInfoConst.FeeCode].ToString()).Count < 2) * { * btnView.ForeColor = Color.Red; * } * break; * case FeeType.Sum: * if (FeeInfoAdapter.Instance.GetFeeDetailList(this.gvList.DataKeys[i].Values[FeeInfoConst.FeeCode].ToString()).Count <= 0) * { * btnView.ForeColor = Color.Red; * } * break; * case FeeType.Tax: * if (FeeInfoAdapter.Instance.GetFeeDetailList(this.gvList.DataKeys[i].Values[FeeInfoConst.FeeCode].ToString()).Count <= 0 || TaxInfoAdapter.Instance.GetTaxInfoList(this.gvList.DataKeys[i].Values[FeeInfoConst.FeeCode].ToString()).Count <= 0) * { * btnView.ForeColor = Color.Red; * } * break; * } **/ #endregion } } ImageButton ibtnAdd = this.gvList.HeaderRow.FindControl("ibtnAdd") as ImageButton; urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add); if (!this.enumFeeType.Equals(0)) { urlEdit.AppendItem(FeeInfoConst.FeeType, this.enumFeeType.ToString("D")); } base.ControlClientClickBindOpen(ibtnAdd, 700, 500, urlEdit.ToUrlString()); }
protected void gvList_DataBound(object sender, EventArgs e) { LinkButton btnView, btnUse, btnLogout; ImageButton ibtnEdit, ibtnAddChild; UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.FeeEditUrl); if (!(this.gvList.Rows.Count == 1 && (this.gvList.Rows[0].Cells[0].Text == SalaryConst.EmptyText || this.gvList.DataKeys[0].Value == null))) { String strAddSpace = String.Empty; for (Int32 i = 0; i < this.gvList.Rows.Count; i++) { String strFeeCode = this.gvList.DataKeys[i].Values[FeeInfoConst.FeeCode].ToString(); String strFeeID = this.gvList.DataKeys[i].Values[FeeInfoConst.FeeID].ToString(); btnView = this.gvList.Rows[i].FindControl("btnView") as LinkButton; ibtnEdit = this.gvList.Rows[i].FindControl("ibtnEdit") as ImageButton; ibtnAddChild = this.gvList.Rows[i].FindControl("ibtnAddChild") as ImageButton; btnUse = this.gvList.Rows[i].FindControl("btnUse") as LinkButton; btnLogout = this.gvList.Rows[i].FindControl("btnLogout") as LinkButton; //缩进 strAddSpace = SalaryAppAdapter.Instance.AddSpaceInFrontOfFeeName(strFeeCode); btnView.Text = strAddSpace + btnView.Text; if (!String.IsNullOrEmpty(yearMonth)) { urlEdit.AppendItem(FeeMonthInfoConst.YearMonth, yearMonth); } urlEdit.AppendItem(FeeInfoConst.FeeID, strFeeID); urlEdit.AppendItem(FeeInfoConst.FeeType, this.enumFeeType.ToString()); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit); base.ControlClientClickBindOpen(btnView, 620, 510, urlEdit.ToUrlString()); urlEdit.RemoveAt(2); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit); base.ControlClientClickBindOpen(ibtnEdit, 620, 510, urlEdit.ToUrlString()); urlEdit.Clear(); if ((this.enumFeeType.Equals(FeeType.Tax) || this.enumFeeType.Equals(FeeType.Parameter)) && strAddSpace.Length > 0) { btnView.Visible = false; ibtnAddChild.Visible = false; this.gvList.Rows[i].Cells[0].Text = ""; } else { urlEdit.AppendItem(FeeInfoConst.FeeType, this.enumFeeType.ToString()); //urlEdit.AppendItem(FeeInfoConst.CommonFeeType, this.enumCommonFeeType.ToString());//NOT urlEdit.AppendItem(FeeInfoConst.ParentID, strFeeID); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add); base.ControlClientClickBindOpen(ibtnAddChild, 620, 510, urlEdit.ToUrlString()); urlEdit.Clear(); } btnUse.Text = EnumHelper.GetDescription(Status.True); btnLogout.Text = EnumHelper.GetDescription(Status.False); if (bool.Parse(this.gvList.DataKeys[i][FeeInfoConst.UseFlag].ToString())) { btnLogout.Enabled = false; btnUse.Attributes.Add("OnClick", String.Format(@"return confirm('您确认要{0}该工资项目?')", btnUse.Text)); } else { btnUse.Enabled = false; btnLogout.Attributes.Add("OnClick", String.Format(@"return confirm('您确认要{0}该工资项目?')", btnLogout.Text)); } #region 未完成 /** //验证工资项目的完整性 FeeType feeType = EnumHelper.Parse<FeeType>(this.gvList.DataKeys[i].Values[FeeInfoConst.FeeType].ToString()); switch (feeType) { case FeeType.BaseCoefficient: if (FeeInfoAdapter.Instance.GetFeeDetailList(this.gvList.DataKeys[i].Values[FeeInfoConst.FeeCode].ToString()).Count < 2) { btnView.ForeColor = Color.Red; } break; case FeeType.Sum: if (FeeInfoAdapter.Instance.GetFeeDetailList(this.gvList.DataKeys[i].Values[FeeInfoConst.FeeCode].ToString()).Count <= 0) { btnView.ForeColor = Color.Red; } break; case FeeType.Tax: if (FeeInfoAdapter.Instance.GetFeeDetailList(this.gvList.DataKeys[i].Values[FeeInfoConst.FeeCode].ToString()).Count <= 0 || TaxInfoAdapter.Instance.GetTaxInfoList(this.gvList.DataKeys[i].Values[FeeInfoConst.FeeCode].ToString()).Count <= 0) { btnView.ForeColor = Color.Red; } break; } **/ #endregion } } ImageButton ibtnAdd = this.gvList.HeaderRow.FindControl("ibtnAdd") as ImageButton; urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add); if (!this.enumFeeType.Equals(0)) { urlEdit.AppendItem(FeeInfoConst.FeeType, this.enumFeeType.ToString("D")); } base.ControlClientClickBindOpen(ibtnAdd, 700, 500, urlEdit.ToUrlString()); }
protected void gvSelectedFeeList_DataBound(object sender, EventArgs e) { GridView gv = (GridView)sender; LinkButton btnView; UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.FeeEditUrl); if (!(gv.Rows.Count == 1 && (gv.Rows[0].Cells[0].Text == SalaryConst.EmptyText || gv.DataKeys[0].Value == null))) { for (Int32 i = 0; i < gv.Rows.Count; i++) { String strFeeID = gv.DataKeys[i].Values[ReportFeeConst.FeeID].ToString(); //TextBox tb = this.gvSelectedFeeList.Rows[i].FindControl("tbOrderNo") as TextBox; //tb.Style.Add("direction", "rtl"); btnView = gv.Rows[i].FindControl("btnView") as LinkButton; String ParentFeeName = FeeInfoAdapter.Instance.LoadFeeInfo(null, strFeeID).ParentName; btnView.Text =(String.IsNullOrEmpty(ParentFeeName) ? String.Empty : String.Concat("{", ParentFeeName, "}")) + btnView.Text;//缩进 urlEdit.AppendItem(FeeInfoConst.FeeID, strFeeID); urlEdit.AppendItem(FeeInfoConst.FeeType, this.gvSelectedFeeList.DataKeys[i].Values[FeeInfoConst.FeeType]); urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.View); base.ControlClientClickBindOpen(btnView, 700, 500, urlEdit.ToUrlString()); urlEdit.Clear(); } } }