예제 #1
0
    protected void btnSaveClick(Object sender, EventArgs e)
    {
        FeeInfo info = this.GetInfoFromPageControl();

        if (FeeInfoAdapter.Instance.IsFeeCodeUsed(info, action == ActionType.Add))
        {
            base.MessageBox(this.name + "编码冲突,请重新定义!");
            this.tbFeeCode.Focus();
            return;
        }
        if (action == ActionType.Add)
        {
            FeeInfoAdapter.Instance.InsertFeeInfo(info);
            UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.FeeEditUrl);
            if (!String.IsNullOrEmpty(yearMonth))
            {
                urlEdit.AppendItem(FeeMonthInfoConst.YearMonth, yearMonth);
            }
            urlEdit.AppendItem(FeeInfoConst.FeeID, info.FeeID);
            urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit);
            Redirect(urlEdit.ToUrlString());
        }
        else
        {
            FeeInfoAdapter.Instance.UpdateFeeInfo(info);
        }
        if (info.FeeType.Equals(FeeType.Tax))
        {
            base.MessageAndRefreshParentByCurrHref(this.name + "保存成功!");
        }
        else
        {
            base.MessageAndRefreshParentByCurrHrefAndClose(this.name + "保存成功!");
        }
    }
예제 #2
0
    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();
            }
        }
    }
예제 #3
0
    protected void btnSaveClick(Object sender, EventArgs e)
    {
        ReportInfo info = this.GetInfoFromPageControl();

        if (ReportInfoAdapter.Instance.IsReportCodeUsed(info, action == ActionType.Add))
        {
            base.MessageBox("报表编码冲突,请重新定义!");
            this.tbReportCode.Focus();
            return;
        }
        if (ReportInfoAdapter.Instance.IsReportNameUsed(info, action == ActionType.Add))
        {
            base.MessageBox("报表名称冲突,请重新定义!");
            this.tbReportName.Focus();
            return;
        }
        if (action == ActionType.Add)
        {
            ReportInfoAdapter.Instance.InsertReportInfo(info);
            UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.ReportEditUrl);
            urlEdit.AppendItem(ReportInfoConst.ReportID, info.ReportID);
            urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit);
            Redirect(urlEdit.ToUrlString());
        }
        else
        {
            ReportInfoAdapter.Instance.UpdateReportInfo(info);
        }
        base.MessageAndRefreshParentByCurrHref("报表保存成功!");
    }
예제 #4
0
    protected void trvDeparment_SelectedNodeChanged(object sender, EventArgs e)
    {
        this.GridViewDataBind();
        String          value   = this.trvDeparment.SelectedNode.Value;
        UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.PersonEditUrl);
        ImageButton     ibtnAdd = this.gvList.HeaderRow.FindControl("ibtnAdd") as ImageButton;

        urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add);
        urlEdit.AppendItem(PersonInfoConst.DepartmentID, value);
        base.ControlClientClickBindOpen(ibtnAdd, 670, 600, urlEdit.ToUrlString());
        //urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add);
        //urlEdit.AppendItem(PersonInfoConst.DepartmentId, value);
        //base.ControlClientClickBindOpen(this.btnAdd, 700, 500, urlEdit.ToUrlString());

        urlEdit = new UrlParamBuilder(SalaryConst.DeparmentEditUrl);
        urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add);
        urlEdit.AppendItem(DepartmentInfoConst.ParentID, value);
        base.ControlClientClickBindShow(this.btnAddDepartment, 670, 300, urlEdit.ToUrlString());

        if (!String.IsNullOrEmpty(value))
        {
            this.btnModifyDepartment.Enabled = true;
            urlEdit = new UrlParamBuilder(SalaryConst.DeparmentEditUrl);
            urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit);
            urlEdit.AppendItem(DepartmentInfoConst.DepartmentID, value);
            base.ControlClientClickBindShow(this.btnModifyDepartment, 670, 300, urlEdit.ToUrlString());
        }
    }
예제 #5
0
    /*
     * 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();
            }
        }
    }
예제 #6
0
    protected void trvProjectClass_SelectedNodeChanged(object sender, EventArgs e)
    {
        this.GridViewDataBind();
        String          value   = this.trvProjectClass.SelectedNode.Value;
        UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.ProjectEditUrl);
        ImageButton     ibtnAdd = this.gvList.HeaderRow.FindControl("ibtnAdd") as ImageButton;

        urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add);
        urlEdit.AppendItem(ProjectInfoConst.ProjectClassID, value);
        base.ControlClientClickBindShow(ibtnAdd, 370, 300, urlEdit.ToUrlString());

        urlEdit = new UrlParamBuilder(SalaryConst.ProjectClassEditUrl);
        urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add);
        urlEdit.AppendItem(ProjectClassInfoConst.ParentClassID, value);
        base.ControlClientClickBindShow(this.btnAddProjectClass, 370, 300, urlEdit.ToUrlString());

        if (!String.IsNullOrEmpty(value))
        {
            this.btnEditProjectClass.Enabled = true;
            urlEdit = new UrlParamBuilder(SalaryConst.ProjectClassEditUrl);
            urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit);
            urlEdit.AppendItem(ProjectClassInfoConst.ProjectClassID, value);
            base.ControlClientClickBindShow(this.btnEditProjectClass, 370, 300, urlEdit.ToUrlString());
        }
    }
예제 #7
0
    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());
    }
예제 #8
0
    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());
    }
예제 #9
0
    protected void btnSaveClick(Object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(yearMonth))
        {
            return;
        }
        PersonInfo info = this.GetInfoFromPageControl();

        if (PersonInfoAdapter.Instance.IsPersonCodeUsed(info, action == ActionType.Add))
        {
            base.MessageBox("人员编码冲突,请重新定义!");
            this.tbPersonCode.Focus();
            return;
        }
        if (PersonInfoAdapter.Instance.IsPersonNameUsed(info, action == ActionType.Add))
        {
            base.MessageBox("姓名冲突,请重新定义!");
            this.tbPersonName.Focus();
            return;
        }
        if (action == ActionType.Add)
        {
            PersonInfoAdapter.Instance.InsertPersonInfo(info);
            personID = info.PersonID;
            if (!String.IsNullOrEmpty(this.parentID)) //复制工资、分摊信息
            {                                         //not
                List <PersonBaseFeeInfo> PersonBaseFeeInfoList = PersonBaseFeeInfoAdapter.Instance.GetPersonBaseFeeInfoList(PersonBaseFeeTarget.PersonBaseFee, this.yearMonth);
                foreach (PersonBaseFeeInfo personBaseFee in PersonBaseFeeInfoList.Where(baseFee => baseFee.FeeID == this.parentID).ToList())
                {
                    if (personBaseFee.FeeValue > 0)
                    {
                        personBaseFee.PersonID = this.personID;
                        PersonBaseFeeInfoAdapter.Instance.InsertPersonBaseFeeInfo(personBaseFee);
                    }
                }
                WhereSqlClauseBuilder builder = new WhereSqlClauseBuilder();
                builder.AppendItem(PersonBaseFeeDepartmentProjectInfoDBConst.PersonID, this.parentID);
                List <PersonBaseFeeDepartmentProjectInfo> personBaseFeeDPList = PersonBaseFeeDepartmentProjectInfoAdapter.Instance.GetPersonBaseFeeDepartmentProjectInfoList(null, builder);
                foreach (PersonBaseFeeDepartmentProjectInfo personBaseFeeDP in personBaseFeeDPList)
                {
                    personBaseFeeDP.PersonID = this.personID;//personBaseFeeDP.PbfdpId = Guid.NewGuid().ToString();
                    PersonBaseFeeDepartmentProjectInfoAdapter.Instance.InsertPersonBaseFeeDepartmentProjectInfo(personBaseFeeDP);
                }
            }

            UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.PersonEditUrl);
            urlEdit.AppendItem(PersonInfoConst.PersonID, personID);
            urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit);
            Redirect(urlEdit.ToUrlString());
        }
        else
        {
            PersonInfoAdapter.Instance.UpdatePersonInfo(info);
        }
        base.MessageAndRefreshParentByCurrHrefAndClose("员工保存成功!");
    }
예제 #10
0
    protected void btnSaveClick(Object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(yearMonth))
        {
            return;
        }
        PersonInfo info = this.GetInfoFromPageControl();
        if (PersonInfoAdapter.Instance.IsPersonCodeUsed(info, action == ActionType.Add))
        {
            base.MessageBox("人员编码冲突,请重新定义!");
            this.tbPersonCode.Focus();
            return;
        }
        if (PersonInfoAdapter.Instance.IsPersonNameUsed(info, action == ActionType.Add))
        {
            base.MessageBox("姓名冲突,请重新定义!");
            this.tbPersonName.Focus();
            return;
        }
        if (action == ActionType.Add)
        {
            PersonInfoAdapter.Instance.InsertPersonInfo(info);
            personID = info.PersonID;
            if (!String.IsNullOrEmpty(this.parentID))//复制工资、分摊信息
            {//not
                List<PersonBaseFeeInfo> PersonBaseFeeInfoList = PersonBaseFeeInfoAdapter.Instance.GetPersonBaseFeeInfoList(PersonBaseFeeTarget.PersonBaseFee, this.yearMonth);
                foreach (PersonBaseFeeInfo personBaseFee in PersonBaseFeeInfoList.Where(baseFee => baseFee.FeeID == this.parentID).ToList())
                {
                    if (personBaseFee.FeeValue > 0)
                    {
                        personBaseFee.PersonID = this.personID;
                        PersonBaseFeeInfoAdapter.Instance.InsertPersonBaseFeeInfo(personBaseFee);
                    }
                }
                WhereSqlClauseBuilder builder = new WhereSqlClauseBuilder();
                builder.AppendItem(PersonBaseFeeDepartmentProjectInfoDBConst.PersonID, this.parentID);
                List<PersonBaseFeeDepartmentProjectInfo> personBaseFeeDPList = PersonBaseFeeDepartmentProjectInfoAdapter.Instance.GetPersonBaseFeeDepartmentProjectInfoList(null, builder);
                foreach (PersonBaseFeeDepartmentProjectInfo personBaseFeeDP in personBaseFeeDPList)
                {
                    personBaseFeeDP.PersonID = this.personID;//personBaseFeeDP.PbfdpId = Guid.NewGuid().ToString();
                    PersonBaseFeeDepartmentProjectInfoAdapter.Instance.InsertPersonBaseFeeDepartmentProjectInfo(personBaseFeeDP);
                }
            }

            UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.PersonEditUrl);
            urlEdit.AppendItem(PersonInfoConst.PersonID, personID);
            urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit);
            Redirect(urlEdit.ToUrlString());
        }
        else
        {
            PersonInfoAdapter.Instance.UpdatePersonInfo(info);
        }
        base.MessageAndRefreshParentByCurrHrefAndClose("员工保存成功!");
    }
예제 #11
0
    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());
    }
예제 #12
0
    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());
    }
예제 #13
0
    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");
                }
            }
        }
    }
예제 #14
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());
    }
예제 #15
0
    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());
    }
예제 #16
0
    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());
    }
예제 #17
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());
    }
예제 #18
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());
    }
예제 #19
0
 protected void btnSaveClick(Object sender, EventArgs e)
 {
     ReportInfo info = this.GetInfoFromPageControl();
     if (ReportInfoAdapter.Instance.IsReportCodeUsed(info, action == ActionType.Add))
     {
         base.MessageBox("报表编码冲突,请重新定义!");
         this.tbReportCode.Focus();
         return;
     }
     if (ReportInfoAdapter.Instance.IsReportNameUsed(info, action == ActionType.Add))
     {
         base.MessageBox("报表名称冲突,请重新定义!");
         this.tbReportName.Focus();
         return;
     }
     if (action == ActionType.Add)
     {
         ReportInfoAdapter.Instance.InsertReportInfo(info);
         UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.ReportEditUrl);
         urlEdit.AppendItem(ReportInfoConst.ReportID, info.ReportID);
         urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit);
         Redirect(urlEdit.ToUrlString());
     }
     else
     {
         ReportInfoAdapter.Instance.UpdateReportInfo(info);
     }
     base.MessageAndRefreshParentByCurrHref("报表保存成功!");
 }
예제 #20
0
    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();
            }
        }
    }
예제 #21
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());
    }
예제 #22
0
    /*
    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();
            }
        }
    }
예제 #23
0
 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");
             }
         }
     }
 }
예제 #24
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());
    }
예제 #25
0
    protected void trvDeparment_SelectedNodeChanged(object sender, EventArgs e)
    {
        this.GridViewDataBind();
        String value=this.trvDeparment.SelectedNode.Value;
        UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.PersonEditUrl);
        ImageButton ibtnAdd = this.gvList.HeaderRow.FindControl("ibtnAdd") as ImageButton;
        urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add);
        urlEdit.AppendItem(PersonInfoConst.DepartmentID, value);
        base.ControlClientClickBindOpen(ibtnAdd, 670, 600, urlEdit.ToUrlString());
        //urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add);
        //urlEdit.AppendItem(PersonInfoConst.DepartmentId, value);
        //base.ControlClientClickBindOpen(this.btnAdd, 700, 500, urlEdit.ToUrlString());

        urlEdit = new UrlParamBuilder(SalaryConst.DeparmentEditUrl);
        urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Add);
        urlEdit.AppendItem(DepartmentInfoConst.ParentID, value);
        base.ControlClientClickBindShow(this.btnAddDepartment, 670, 300, urlEdit.ToUrlString());

        if(!String.IsNullOrEmpty(value))
        {
            this.btnModifyDepartment.Enabled = true;
            urlEdit = new UrlParamBuilder(SalaryConst.DeparmentEditUrl);
            urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit);
            urlEdit.AppendItem(DepartmentInfoConst.DepartmentID, value);
            base.ControlClientClickBindShow(this.btnModifyDepartment, 670, 300, urlEdit.ToUrlString());
        }
    }
예제 #26
0
 protected void btnSaveClick(Object sender, EventArgs e)
 {
     FeeInfo info = this.GetInfoFromPageControl();
     if (FeeInfoAdapter.Instance.IsFeeCodeUsed(info, action == ActionType.Add))
     {
         base.MessageBox(this.name + "编码冲突,请重新定义!");
         this.tbFeeCode.Focus();
         return;
     }
     if (action == ActionType.Add)
     {
         FeeInfoAdapter.Instance.InsertFeeInfo(info);
         UrlParamBuilder urlEdit = new UrlParamBuilder(SalaryConst.FeeEditUrl);
         if (!String.IsNullOrEmpty(yearMonth))
         {
             urlEdit.AppendItem(FeeMonthInfoConst.YearMonth, yearMonth);
         }
         urlEdit.AppendItem(FeeInfoConst.FeeID, info.FeeID);
         urlEdit.AppendItem(SalaryConst.QueryAction, ActionType.Edit);
         Redirect(urlEdit.ToUrlString());
     }
     else
     {
         FeeInfoAdapter.Instance.UpdateFeeInfo(info);
     }
     if (info.FeeType.Equals(FeeType.Tax))
     {
         base.MessageAndRefreshParentByCurrHref(this.name + "保存成功!");
     }
     else
     {
         base.MessageAndRefreshParentByCurrHrefAndClose(this.name + "保存成功!");
     }
 }