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; //// 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());
    }
Exemple #3
0
    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;
        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)
    {
        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;
        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());
    }
Exemple #7
0
    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 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());
    }
Exemple #11
0
    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());
    }