Esempio n. 1
0
    protected void btnAllowOutDoor_Click(object sender, ImageClickEventArgs e)
    {
        //ACCTRUE.WMSBLL.Model.User user1 = (ACCTRUE.WMSBLL.Model.User)(Session[Config.Curren_User]);
        //this.PrintfError(user1.UserID);
        //return;
        try
        {
            if (string.IsNullOrEmpty(this.hidCValue.Value))
            {
                this.PrintfError("没有选择发运单!");
                return;
            }
            else
            {
                InDoorParam indoor             = new InDoorParam();
                ACCTRUE.WMSBLL.Model.User user = (ACCTRUE.WMSBLL.Model.User)(Session[Config.Curren_User]);
                int lstatus = Status(this.hidCValue.Value.Trim());
                switch (lstatus)
                {
                case 1:
                    this.PrintfError("正在装车,不能出门!");
                    this.txtICID.Focus();
                    return;

                case 2:
                    if (SysParam.GetParamValue("ZHQROUTDOOR") == "1")
                    {
                        string retstr = QuCheck.checkfydOutqrdoor(this.hidCValue.Value.Trim());
                        if (retstr != "")
                        {
                            this.PrintfError(retstr);
                            return;
                        }
                    }
                    if (SysParam.getwzip(user.UserID) != "")
                    {
                        string pzsl = SysParam.GetParamValue("PZOUTDOOR");
                        if (SysParam.GetParamValue("PZOUTDOOR") != "-1")
                        {
                            int v = 0;
                            try
                            {
                                v = int.Parse(pzsl);
                            }
                            catch (System.Exception ex)
                            {
                                this.PrintfError("允许拍照校验参数错误,联系系统管理人员!");
                                return;
                            }
                            string retstr = QuCheck.checkfydOutPicIsSuccess(this.hidCValue.Value.Trim(), v);    //拍照失败次数是否大于允许的次数
                            if (retstr != "")
                            {
                                this.PrintfError(retstr);
                                return;
                            }
                        }
                    }


                    if (indoor.Update2(this.hidCValue.Value.Trim(), 3, user.UserID, DateTime.Now))
                    {
                        this.PrintfError("该发运单现在可以出门了!");
                        indoor.setICIDoutdoor(this.hidICID.Value.Trim(), this.hidCValue.Value.Trim());
                        this.txtICID.Focus();
                    }
                    break;

                case 3:
                    this.WriteClientJava("window.showModalDialog('OutDoorOK.aspx?FYDH='+document.getElementById('hidCValue').value+'&ICID='+document.getElementById('hidICID').value,window,'dialogLeft=200;dialogTop=200;dialogWidth:350px; dialogHeight:150px;scroll:no; status:no; scrollbars:no; dialogHide:no; help:No;')");
                    //this.WriteClientJava("window.open('OutDoorOK.aspx?FYDH='+document.getElementById('hidCValue').value+'&ICID='+document.getElementById('hidICID').value, 'okorcancel', 'height=100, width=260, top=300, left=300, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')");
                    break;

                case 4:
                    this.PrintfError("进门后没有执行,不能出门,如果要出门,装货员需要执行完成操作!");
                    this.txtICID.Focus();
                    return;

                case 5:
                    this.PrintfError("该车辆已经出门!");
                    this.txtICID.Focus();
                    return;

                case 6:
                    this.PrintfError("还没有进门!");
                    this.txtICID.Focus();
                    return;
                }
                OutDoorCheckFYD();
            }
        }
        catch (Exception ex)
        {
            this.PrintfError("出门时出现错误,请重试或退出重新登陆重试" + ex.Message);
            return;
        }
    }