コード例 #1
0
ファイル: SalaryGrantView.aspx.cs プロジェクト: 892182825/SP
    protected void Page_Load(object sender, EventArgs e)
    {
        Permissions.ComRedirect(Page, Permissions.redirUrl);
        Response.Cache.SetExpires(DateTime.Now);
        Permissions.CheckManagePermission(EnumCompanyPermission.FinanceJiangjinshezhi);

        AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxClass));
        if (!IsPostBack)
        {
            if (Request.QueryString["qs"] != null)
            {
                ViewState["qs"] = Request.QueryString["qs"].ToString();
                bool blean = ReleaseBLL.IsProvide(Convert.ToInt32(ViewState["qs"].ToString()));
                if (blean)
                {
                    this.labmx.Text = "第 " + ViewState["qs"].ToString() + " 期已发放奖金明细";
                }
                else
                {
                    this.labmx.Text = "第 " + ViewState["qs"].ToString() + " 期未发放奖金明细";
                }
            }

            BtnConfirm_Click(null, null);
        }
        Translations();
    }
コード例 #2
0
ファイル: SalaryGrant.aspx.cs プロジェクト: 892182825/SP
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Attributes.Add("onmouseover", "bg=this.style.backgroundColor;this.style.backgroundColor='#FFFFCC'");
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=bg");
            LinkButton button1 = (LinkButton)e.Row.FindControl("add_jj");
            LinkButton button2 = (LinkButton)e.Row.FindControl("cancle_jj");

            int ExpectNum = Convert.ToInt32(e.Row.Cells[0].Text.ToString().Trim());
            if (ReleaseBLL.IsProvide(ExpectNum))
            {
                button1.Visible = false;
            }
            else
            {
                button2.Visible = false;
            }

            button1.Attributes.Add("onClick", "return confirm('" + GetTran("001386", "你确定要添加吗?") + "');");
            button2.Attributes.Add("onClick", "return confirm('" + GetTran("001388", "你确定要撤消吗?") + "');");
        }
        else if (e.Row.RowType == DataControlRowType.Header)
        {
            e.Row.Attributes.Add("style", "background-image:url('images/tabledp.gif')");
        }
        Translations();
    }
コード例 #3
0
ファイル: SalaryGrantView.aspx.cs プロジェクト: 892182825/SP
    public void getBalanceToPurseDetail()
    {
        string Number = DisposeString.DisString(this.Number.Text.Trim());
        string Name   = Encryption.Encryption.GetEncryptionName(DisposeString.DisString(this.Name.Text.Trim()));

        bool blean = ReleaseBLL.IsProvide(Convert.ToInt32(ViewState["qs"].ToString()));

        if (blean)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append(" 1=1 and b.number=m.number and b.isyxj=1 and b.ExpectNum=" + ViewState["qs"].ToString());
            if (Number.Length > 0)
            {
                sb.Append(" and b.Number like'%" + Number + "%'");
            }
            if (Name.Length > 0)
            {
                sb.Append(" and m.Name like'%" + Name + "%'");
            }

            ViewState["SQLSTR"] = "SELECT b.*,m.name FROM BalanceToPurseDetail b,memberinfo m WHERE " + sb.ToString() + " isyxj=1 order by b.id desc";
            string asg   = ViewState["SQLSTR"].ToString();
            Pager  pager = Page.FindControl("Pager1") as Pager;
            pager.Pageindex    = 0;
            pager.PageSize     = 10;
            pager.PageTable    = "BalanceToPurseDetail b,memberinfo m";
            pager.Condition    = sb.ToString();
            pager.PageColumn   = " b.*,m.name ";
            pager.ControlName  = "GridView1";
            pager.key          = " b.id ";
            pager.InitBindData = true;
            pager.PageBind();
        }
        else
        {
            StringBuilder sb = new StringBuilder();
            sb.Append(" 1=1 and b.number=m.number and b.isyxj=1 and b.ExpectNum=" + ViewState["qs"].ToString());
            if (Number.Length > 0)
            {
                sb.Append(" and b.Number like'%" + Number + "%'");
            }
            if (Name.Length > 0)
            {
                sb.Append(" and m.Name like'%" + Name + "%'");
            }
            ViewState["SQLSTR"] = "SELECT b.Number,b.CurrentOneMark,b.Bonus1,b.Bonus2,b.Bonus3,b.Bonus4,b.Bonus5,b.Bonus6,b.Bonus7,b.Bonus8,b.DeductTax as Total,b.CurrentSolidSend,m.name, b.ExpectNum as ExpectNum,'" + DateTime.Now.ToUniversalTime() + "' as TransferToPurseDate,0 as bqbukuan FROM BalanceToPurseDetail b,memberinfo m WHERE " + sb.ToString() + " order by m.id desc";
            string asg   = ViewState["SQLSTR"].ToString();
            Pager  pager = Page.FindControl("Pager1") as Pager;
            pager.Pageindex    = 0;
            pager.PageSize     = 10;
            pager.PageTable    = " BalanceToPurseDetail b,memberinfo m";
            pager.Condition    = sb.ToString();
            pager.PageColumn   = " b.Number,b.CurrentOneMark,b.Bonus1,b.Bonus2,b.Bonus3,b.Bonus4,b.Bonus5,b.Bonus6,b.Bonus7,b.Bonus8,b.DeductTax as Total,b.CurrentSolidSend,m.name,b.ExpectNum as ExpectNum,'" + DateTime.Now.ToUniversalTime() + "' as TransferToPurseDate,0 as bqbukuan  ";
            pager.ControlName  = "GridView1";
            pager.key          = " b.id ";
            pager.InitBindData = true;
            pager.PageBind();
        }

        Translations();
    }
コード例 #4
0
ファイル: SalaryGrant.aspx.cs プロジェクト: 892182825/SP
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        //if (IsProcessExist("ds2010.exe"))
        //{
        //    ClientScript.RegisterStartupScript(this.GetType(), "success", "alert('" + GetTran("007165", "奖金正在结算……") + "');", true);
        //    return;
        //}

        //获取最后一次结算状态
        DataTable dt = CommonDataBLL.GetJstype();

        if (dt.Rows.Count > 0)
        {
            if (dt.Rows[0]["jstype"].ToString() == "0")
            {
                ClientScript.RegisterStartupScript(this.GetType(), "success", "alert('" + GetTran("007165", "奖金正在结算……") + "');", true);
                GetShopList();
                return;
            }
        }

        if (e.CommandName == "add_jj")
        {
            string qishu = e.CommandArgument.ToString();
            bool   blean = ReleaseBLL.IsProvide(int.Parse(qishu));
            if (blean)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001374", "对不起,该期奖金已经写入用户电子帐户!") + "');</script>");
                GetShopList();
                return;
            }
            else
            {
                bool b = ReleaseBLL.Provide(int.Parse(qishu));
                if (b)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001375", "写入成功!") + "');</script>");
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001376", "对不起,写入电子帐户失败,请联系维护人员!") + "');</script>");
                }
            }
            GetShopList();
        }
        if (e.CommandName == "cancle_jj")
        {
            string ExpectNum = e.CommandArgument.ToString();
            bool   blean     = ReleaseBLL.IsProvide(int.Parse(ExpectNum));
            if (!blean)
            {
                ScriptHelper.SetAlert(Page, "奖金已撤销!");
                GetShopList();
                return;
            }
            else
            {
                int num = ReleaseBLL.Cancel(int.Parse(ExpectNum));
                if (num == 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001380", "撤销第") + ExpectNum + GetTran("001381", "期奖金成功!") + "');</script>");
                }

                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001215", "对不起,撤消电子帐户失败,请联系维护人员!") + "');</script>");
                }
            }
            GetShopList();
        }

        if (e.CommandName == "add_View")
        {
            string qishu = e.CommandArgument.ToString();
            Response.Redirect("SalaryGrantView.aspx?qs=" + qishu);
        }
    }