Пример #1
0
    protected void reCount_Click(object sender, EventArgs e)
    {
        RunExe myRun = new RunExe();

        myRun.Kill(CommonDataBLL.JiesuanProgramFilename);
        int  a  = CommonDataBLL.UpJstype(ViewState["jsId"].ToString());
        bool re = ReleaseBLL.CheckSetsys();

        if (!re)
        {
            bool res = ReleaseBLL.UpdateSystemID();
            if (!res)
            {
                Response.Write("<meta http-equiv=refresh content=0><script> alert('" + GetTran("001214", "程序停止失败") + "'); </script>");
                return;
            }
            else
            {
                bool r = ReleaseBLL.DelSetsys();
                if (!r)
                {
                    Response.Write("<meta http-equiv=refresh content=0><script> alert('" + GetTran("001214", "程序停止失败") + "'); </script>");
                    return;
                }
            }
        }
        if (a > 0)
        {
            Response.Write("<meta http-equiv=refresh content=0><script> alert('" + GetTran("001212", "程序停止成功") + "'); </script>");
        }
        else
        {
            Response.Write("<meta http-equiv=refresh content=0><script> alert('" + GetTran("001214", "程序停止失败") + "'); </script>");
        }
        Application["jinzhi"] = "F";
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Cache.SetExpires(DateTime.Now);
        Permissions.CheckManagePermission(EnumCompanyPermission.FinanceXitongjiesuan, false);
        string Operatenum = CommonDataBLL.OperateBh;
        string Operateip  = CommonDataBLL.OperateIP;
        int    qishu      = 0;

        if (Request.QueryString["qs"] != null)
        {
            qishu = Convert.ToInt32(Request.QueryString["qs"]);
        }
        if (qishu == BLL.CommonClass.CommonDataBLL.GetMaxqishu())
        {
            BlackListBLL.GetSystemClose(Operateip, Operatenum);
        }
        RunExe myRun = new RunExe();

        //if ( myRun.IsRun(  CommonDataBLL.JiesuanProgramFilename  ) )
        if (Request.QueryString["id"] != null)
        {
            ViewState["id"] = Request.QueryString["id"].ToString();
        }
        string jstype = CommonDataBLL.GetJstypeID(ViewState["id"].ToString());

        if (jstype == "0")
        {
            Response.Write("<body bgcolor=#616378><div id='mydiv'>");
            Response.Write("_");
            Response.Write("</div></body>");
            Response.Write("<script>mydiv.innerText = '';</script>");
            Response.Write("<script language=javascript>;");
            Response.Write("var dots = 0;var dotmax = 10;function ShowWait()");
            Response.Write("{var output; output = '" + GetTran("001234", "程序正在运行") + "';dots++;if(dots>=dotmax)dots=1;");
            Response.Write("for(var x = 0;x < dots;x++){output += '·';}mydiv.innerText =  output;}");
            Response.Write("function StartShowWait(){mydiv.style.visibility = 'visible'; ");
            Response.Write("window.setInterval('ShowWait()',1000);}");
//				Response.Write("function HideWait(){mydiv.style.visibility = 'hidden';");
//				Response.Write("window.clearInterval();}");
            Response.Write("StartShowWait();</script>");
            Response.Write("<script>window.setTimeout('location=location',5000)</script>");
            Response.Flush();
            Thread.Sleep(10000);
        }
        else
        {
            string cuowu = "";
            //是否有错误单子
            //int err = ReleaseBLL.IsErrorOrder(Convert.ToInt32(Session["nowqishu"].ToString()));
            Application["jinzhi"] = "F";
            bool re = ReleaseBLL.CheckSetsys();
            if (!re)
            {
                bool res = ReleaseBLL.UpdateSystemID();
                if (res)
                {
                    bool r = ReleaseBLL.DelSetsys();
                }
            }
            //if ( err>0 )
            //{
            //    cuowu = GetTran("001235", "但是本期中有错误单子。");
            //}
            if (jstype == "1")
            {
                cuowu = "正常结束。";
            }
            else if (jstype == "2")
            {
                cuowu = "错误报单结束。";
            }
            else if (jstype == "3")
            {
                cuowu = "异常结束。";
            }
            else
            {
                cuowu = "未启动。";
            }

            //if (cuowu == "")
            if (jstype == "1")
            {
                ReleaseBLL.UPConfigflag(int.Parse(Request.QueryString["qs"]));
            }
            ReleaseBLL.UPConfigNum(int.Parse(Request.QueryString["qs"]));
            Response.Write("<script language='javascript'> alert('" + GetTran("001236", "程序运行完毕!") + cuowu + "');window.close()</script>");
        }
        if (qishu == BLL.CommonClass.CommonDataBLL.GetMaxqishu())
        {
            BlackListBLL.GetSystemOpen(Operateip, Operatenum);
        }
    }
Пример #3
0
    protected void BeginBalanceProg()
    {
        //检测是否存在没有会员编号的店铺
        int exists = ReleaseBLL.IsNumberExists();

        if (exists > 0)
        {
            Response.Write(Transforms.ReturnAlert(GetTran("001210", "对不起,当前系统中还有店铺没有会员编号,请先在门店管理页面中为这些店添加正确的会员编号!")));
            Application["jinzhi"] = "F";
            Response.End();
        }
        bool re = ReleaseBLL.CheckSetsys();

        if (!re)
        {
            bool r = ReleaseBLL.DelSetsys();
            if (!r)
            {
                ScriptHelper.SetAlert(Page, "系统开关不确定!请先确认系统开关。");
                return;
            }
        }
        if (!ReleaseBLL.GetSystemList())
        {
            ScriptHelper.SetAlert(Page, "系统开关不确定!请先确认系统开关。");
            return;
        }

        bool res = ReleaseBLL.UpdateSystem();

        if (!res)
        {
            ScriptHelper.SetAlert(Page, "系统开关不确定!请先确认系统开关。");
            return;
        }
        RunExe myRun = new RunExe();

        //if (!myRun.IsRun(CommonDataBLL.JiesuanProgramFilename))

        if (ViewState["jsType"].ToString() != "0")
        {
            if (setExeParam())
            {
                if (myRun.RunIt(Server.MapPath("jiesuan\\" + CommonDataBLL.JiesuanProgramFilename + ".exe")))
                {
                    Response.Write("<script>location.href('CompanyBalancerunning.aspx?Qishu=QC888&qs=" + Request.QueryString["qs"] + "&id=" + ViewState["newjsid"].ToString() + "')</script>");
                }
                else
                {
                    Application["jinzhi"] = "F";
                    Response.Write("<script> alert('" + GetTran("001211", "程序启动失败") + "');</script>");
                }
            }
            else
            {
            }
        }
        else
        {
        }
    }