Example #1
0
    protected void gvDisplaceGoods_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        GridViewRow gvRow = (GridViewRow)((LinkButton)e.CommandSource).Parent.Parent;

        if (e.CommandName.ToString() == string.Empty)
        {
            return;
        }

        if (e.CommandName == "NoEffect")
        {
            int i = bll.GetStaDisplaceDocByDocId(e.CommandArgument.ToString());
            if (i > 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("005827", "已被为无效单了,不需要再审核了!") + "');</script>");
                return;
            }
            bll.UpdateStateFlagAndCloseFlag(e.CommandArgument.ToString());
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("005828", "审核无效完成!") + "');location.href='DisplaceGoodsBrowse.aspx';</script>");
            //跳转打印页面
            // Page.RegisterClientScriptBlock("openwin2", "<script>if(confirm('您要打印此单据的退货单吗?'))window.open('docPrint.aspx?docID=" + e.CommandArgument.ToString().Trim() + "&docType=" + CompanyData.GetDocTypeIDByDocTypeName("退货单") + "');</script>");
        }
        else
        if (e.CommandName == "Edit")
        {
            Response.Redirect("DisplaceGoodsEdit.aspx?billID=" + e.CommandArgument.ToString());
        }
        else
        if (e.CommandName == "del")
        {
            bll.DeleteDisplaceGoodsOrderAndOrderDetail(e.CommandArgument.ToString());
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000749", "删除成功!") + "');location.href='DisplaceGoodsBrowse.aspx';</script>");
        }
    }