Example #1
0
    protected void gvInfo_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string[] Arg     = Convert.ToString(e.CommandArgument).Split('_');
        string   DocID   = Arg[0];
        int      isExist = StorageInBrowseBLL.DocIdIsExistByDocId(DocID);

        //Exist
        if (isExist > 0)
        {
            if (e.CommandName == "Auditing")
            {
                int isAuditing = StorageInBrowseBLL.IsAuditingByDocId(DocID, 1);
                //Effective(In other words,Auditing)
                if (isAuditing > 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("006888", "该入库单已经被审核!")));
                }
                //No Auditing
                else
                {
                    string   DocAuditer   = CommonDataBLL.GetNameByAdminID(Session["Company"].ToString());
                    DateTime DocAuditTime = MYDateTime1.GetCurrentDateTime();
                    string   OperateIP    = CommonDataBLL.OperateIP;
                    string   OperateNum   = CommonDataBLL.OperateBh;

                    //更新公司库存
                    string TempWareHouseID = Arg[1];
                    int    changwei        = Convert.ToInt32(Arg[2]);
                    int    auditingCout    = StorageInBrowseBLL.checkDoc(DocAuditer, DocAuditTime, OperateIP, OperateNum, DocID, TempWareHouseID, changwei);
                    if (auditingCout > 0)
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>if(confirm('" + GetTran("002214", "入库单审核成功,是否要打印此入库单?") + "'))window.open('docPrint.aspx?DocID=" + DocID + "');</script>");
                    }

                    else
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002216", "入库单审核失败,请联系管理员!")));
                        return;
                    }
                }
            }
            else if (e.CommandName == "NoEffect")
            {
                int isEffect = StorageInBrowseBLL.IsAuditingByDocId(DocID, 0);
                //No effect
                if (isEffect <= 0)
                {
                    DateTime CloseDate     = MYDateTime1.GetCurrentDateTime();
                    string   OperateIP     = CommonDataBLL.OperateIP;
                    string   OperateNum    = CommonDataBLL.OperateBh;
                    int      noEffectCount = StorageInBrowseBLL.updDocTypeName(CloseDate, DocID, OperateIP, OperateNum);
                    if (noEffectCount > 0)
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002218", "此入库单审核无效成功!")));
                    }

                    else
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002221", "此入库单审核无效失败,请联系管理员!")));
                    }
                }

                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("006890", "该入库单已经被审核无效!")));
                }
            }
            else if (e.CommandName == "Del")
            {
                ChangeLogs cl = new ChangeLogs("InventoryDoc", "DocID");
                cl.AddRecord(DocID);
                ChangeLogs cl2 = new ChangeLogs("InventoryDocDetails", "DocID");
                cl2.AddRecord(DocID);
                int delCount = StorageInBrowseBLL.delDoc(DocID);
                if (delCount > 0)
                {
                    cl.AddRecord(DocID);
                    cl.DeletedIntoLogs(ChangeCategory.company8, Session["Company"].ToString(), ENUM_USERTYPE.objecttype0);
                    cl2.AddRecord(DocID);
                    cl2.DeletedIntoLogs(ChangeCategory.company8, Session["Company"].ToString(), ENUM_USERTYPE.objecttype0);

                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002225", "入库单删除成功!")));
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002228", "入库单编辑失败,请联系管理员!")));
                    return;
                }
            }
            else if (e.CommandName == "Edit")
            {
                Response.Redirect("StorageInEdit.aspx?billID=" + DocID);
            }
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("006894", "该入库单不存在!")));
        }
        Btn_Search_Click(null, null);
    }
Example #2
0
    protected void gvInfo_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string DocID   = Convert.ToString(e.CommandArgument);
        int    isExist = StorageInBrowseBLL.DocIdIsExistByDocId(DocID);

        //Exist
        if (isExist > 0)
        {
            if (e.CommandName == "Auditing")
            {
                int isAuditing = StorageInBrowseBLL.IsAuditingByDocId(DocID, 1);
                //Effective(In other words,Auditing)
                if (isAuditing > 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("006888", "该入库单已经被审核!")));
                }

                //No Auditing
                else
                {
                    string   DocAuditer   = CommonDataBLL.GetNameByAdminID(Session["Company"].ToString());
                    DateTime DocAuditTime = MYDateTime1.GetCurrentDateTime();
                    string   OperateIP    = CommonDataBLL.OperateIP;
                    string   OperateNum   = CommonDataBLL.OperateBh;

                    //更新公司库存
                    GridViewRow row             = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer;
                    string      TempWareHouseID = ((HtmlInputHidden)row.FindControl("hidwarehouseId")).Value;
                    string      aaa             = ((HtmlInputHidden)row.FindControl("changwei")).Value;
                    int         changwei        = Convert.ToInt32(aaa);
                    int         auditingCout    = StorageInBrowseBLL.checkDoc(DocAuditer, DocAuditTime, OperateIP, OperateNum, DocID, TempWareHouseID, changwei);
                    if (auditingCout > 0)
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>if(confirm('" + GetTran("002214", "入库单审核成功,是否要打印此入库单?") + "'))window.open('docPrint.aspx?DocID=" + DocID + "');</script>");
                    }

                    else
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002216", "入库单审核失败,请联系管理员!")));
                        return;
                    }
                }
            }

            else if (e.CommandName == "NoEffect")
            {
                int isEffect = StorageInBrowseBLL.IsAuditingByDocId(DocID, 0);
                //No effect
                if (isEffect <= 0)
                {
                    DateTime CloseDate     = MYDateTime1.GetCurrentDateTime();
                    string   OperateIP     = CommonDataBLL.OperateIP;
                    string   OperateNum    = CommonDataBLL.OperateBh;
                    int      noEffectCount = StorageInBrowseBLL.updDocTypeName(CloseDate, DocID, OperateIP, OperateNum);
                    if (noEffectCount > 0)
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002218", "此入库单审核无效成功!")));
                    }

                    else
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002221", "此入库单审核无效失败,请联系管理员!")));
                    }
                }

                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("006890", "该入库单已经被审核无效!")));
                }
            }

            else if (e.CommandName == "Del")
            {
                int delCount = StorageInBrowseBLL.delDoc(DocID);
                if (delCount > 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002225", "入库单删除成功!")));
                }

                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002228", "入库单编辑失败,请联系管理员!")));
                    return;
                }
            }

            else if (e.CommandName == "Edit")
            {
                Response.Redirect("StorageInEdit.aspx?billID=" + DocID);
            }
        }

        else
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("006894", "该入库单不存在!")));
        }
        Response.Redirect("StorageInBrowse.aspx");
    }