Пример #1
0
 protected void btnCancelInDoor_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         if (string.IsNullOrEmpty(this.hidCheckFYDSlc.Value))
         {
             this.PrintfError("未选择发运单!");
             return;
         }
         else
         {
             DataSet statusCount = InDoorParam.StatusNo1DS(this.hidCheckFYDSlc.Value.Trim());
             if (statusCount.Tables[0].Rows.Count >= 1)
             {
                 this.PrintfError("不能重进门!");
                 return;
             }
             else
             {
                 InDoorParam indoor = new InDoorParam();
                 indoor.cancelInDoor(this.hidCheckFYDSlc.Value.Trim());
                 this.PrintfError("进门状态已改变,可以刷卡重新进门!");
                 BindGridView();
                 this.hidCheckFYDSlc.Value = "";
             }
         }
     }
     catch (Exception ex)
     {
         String strEx = ex.Message;
         this.PrintfError("撤销失败,请重试!");
         return;
     }
 }
Пример #2
0
    protected void grdFYD_Sorting(object sender, GridViewSortEventArgs e)
    {
        if (string.IsNullOrEmpty(this.hidsort.Value))
        {
            this.hidsort.Value = "DESC";
        }
        else
        {
            if (this.hidsort.Value.Trim() == "DESC")
            {
                this.hidsort.Value = "ASC";
            }
            else
            {
                this.hidsort.Value = "DESC";
            }
        }
        string sortField = e.SortExpression.ToString();
        string strsort   = " order by " + sortField + "  " + this.hidsort.Value;

        this.hidStrSort.Value = strsort;

        string sqlWhere = GetSqlWhere();

        sqlWhere += strsort;

        DataSet ds = InDoorParam.GetFYDInfoSort(sqlWhere);

        this.grdFYD.DataSource = ds;
        this.grdFYD.DataBind();
    }
Пример #3
0
    /// <summary>
    /// 允许出门后查询发运单绑定主界面列表
    /// </summary>
    private void OutDoorCheckFYD()
    {
        try
        {
            string strWhere = "";
            if (!string.IsNullOrEmpty(this.hidICID.Value))
            {
                strWhere = " and wms_pub_ic.ICID = '" + this.hidICID.Value.Trim() + "'";
            }
            if (!string.IsNullOrEmpty(this.hidICNumber.Value))
            {
                strWhere += " and wms_pub_ic.ICNumber = '" + this.hidICNumber.Value.Trim() + "'";
            }
            if (!string.IsNullOrEmpty(this.hidPassword.Value))
            {
                strWhere += "and  wms_pub_ic.ICPass = '******'";
            }


            DataSet ds   = InDoorParam.GetICDataSet(strWhere);
            string  KHID = ds.Tables[0].Rows[0]["KHID"].ToString();
            string  KHLB = ds.Tables[0].Rows[0]["KHLB"].ToString();
            string  strWhereFYD;
            if (KHLB == "0")
            {
                strWhereFYD = " Status = 2 ";
            }
            else
            {
                strWhereFYD = " KHBM = '" + KHID + "' and Status = 2";//取消了客户编码限制,与旧系统保持一致
            }
            string CPH = this.txtCPH.Text.Trim();
            if (string.IsNullOrEmpty(CPH))
            {
                strWhereFYD += " and yslb = '1' ";
            }
            else
            {
                strWhereFYD += " and cph like '%" + CPH + "%' and yslb = '1'";
            }
            if (!string.IsNullOrEmpty(this.hidFYDH.Value))
            {
                strWhereFYD += " and FYDH = '" + this.hidFYDH.Value.Trim() + "'";
            }
            DataSet dsFYD = InDoorParam.GetFYDDataSet(strWhereFYD);
            this.GridView1.DataSource = dsFYD;
            this.GridView1.DataBind();
            this.txtICID.Focus();
        }
        catch (Exception ex)
        {
            String strEx = ex.Message;
            this.PrintfError("允许出门后重新加载出现错误,请重试!");
            return;
        }
    }
Пример #4
0
 protected void btnOK_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         if (string.IsNullOrEmpty(this.txtICID.Text) && string.IsNullOrEmpty(this.txtICNumber.Text))
         {
             this.PrintfError("请输入IC卡ID或IC卡号!");
             this.txtICID.Focus();
             return;
         }
         else
         {
             InDoorParam indoor = new InDoorParam();
             bool        hasIC  = indoor.hasIC(this.txtICID.Text.Trim(), this.txtICNumber.Text.Trim());
             if (hasIC == false)
             {
                 this.PrintfError("没有该卡号!");
                 this.txtICID.Focus();
                 return;
             }
             else
             {
                 if (this.txtNewPassword1.Text.Trim() != this.txtNewPassword2.Text.Trim())
                 {
                     this.PrintfError("两次输入的新密码不一致!");
                     this.txtICID.Focus();
                     return;
                 }
                 else
                 {
                     bool passwordvalidate = indoor.PasswordValidate(this.txtICID.Text.Trim(), this.txtICNumber.Text.Trim(), this.txtOldPassword.Text.Trim());
                     if (passwordvalidate == false)
                     {
                         this.PrintfError("原密码错误!");
                         this.txtICID.Focus();
                         return;
                     }
                     else
                     {
                         indoor.ModifyPassword(this.txtICID.Text.Trim(), this.txtICNumber.Text.Trim(), this.txtNewPassword1.Text.Trim());
                         this.WriteClientJava("window.alert('密码修改成功!');window.close();");
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         String strEx = ex.Message;
         this.PrintfError("数据访问错误,请重试!");
         return;
     }
 }
Пример #5
0
    /// <summary>
    /// 允许进门后查询发运单绑定主界面列表
    /// </summary>
    private void InDoorCheckFYD()
    {
        try
        {
            string strWhere = "";
            if (!string.IsNullOrEmpty(this.hidICID.Value))
            {
                strWhere = " and wms_pub_ic.ICID = '" + this.hidICID.Value.Trim() + "'";
            }
            if (!string.IsNullOrEmpty(this.hidICNumber.Value))
            {
                strWhere += " and wms_pub_ic.ICNumber = '" + this.hidICNumber.Value.Trim() + "'";
            }
            if (!string.IsNullOrEmpty(this.hidPassword.Value))
            {
                strWhere += "and  wms_pub_ic.ICPass = '******'";
            }


            DataSet ds = InDoorParam.GetICDataSet(strWhere);
            string  strWhereFYD;
            string  KHID = ds.Tables[0].Rows[0]["KHID"].ToString();
            string  KHLB = ds.Tables[0].Rows[0]["KHLB"].ToString();
            if (KHLB == "0")
            {
                strWhereFYD = " Status in (0,1,2,5) ";
            }
            else
            {
                strWhereFYD = " KHBM = '" + KHID + "' and Status in (0,1,2,5)";
            }
            //string KHID = ds.Tables[0].Rows[0]["KHID"].ToString();
            //string strWhereFYD = " KHBM = '" + KHID + "' and Status in (0,1,2,5)";
            string CPH = this.hidCheckCPH.Value.Trim();
            if (string.IsNullOrEmpty(CPH))
            {
                strWhereFYD += " and yslb = '1' ";
            }
            else
            {
                strWhereFYD += " and cph like '%" + CPH + "%' and yslb = '1'";
            }

            DataSet dsFYD = InDoorParam.GetFYDDataSet(strWhereFYD);
            this.GridView1.DataSource = dsFYD;
            this.GridView1.DataBind();
        }
        catch
        { }
    }
Пример #6
0
    //protected void btnPrintFYD_Click(object sender, ImageClickEventArgs e)
    //{
    //    try
    //    {
    //        if (this.grdFYD.Rows.Count < 1)
    //        {
    //            this.PrintfError("没有要打印的记录!");
    //            return;
    //        }
    //        string sql = GetSqlWhere();
    //        sql = Server.UrlEncode(sql);
    //        this.WriteClientJava("window.open(\"../../Print.aspx?TYPE=3&QUERYSQL=" + sql + "\")");
    //    }
    //    catch (Exception ex)
    //    {
    //        String strEx = ex.Message;
    //        this.PrintfError("数据访问错误,请重试!");
    //        return;
    //    }
    //}
    #endregion

    protected void grdFYD_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.grdFYD.PageIndex = e.NewPageIndex;
        string sqlWhere = GetSqlWhere();

        if (string.IsNullOrEmpty(this.hidStrSort.Value))
        {
            sqlWhere += " order by FYDH ";
        }
        else
        {
            sqlWhere += this.hidStrSort.Value;
        }
        DataSet ds = InDoorParam.GetFYDInfoSort(sqlWhere);

        this.grdFYD.DataSource = ds;
        this.grdFYD.DataBind();
    }
Пример #7
0
 protected void btnOK_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         InDoorParam indoor             = new InDoorParam();
         ACCTRUE.WMSBLL.Model.User user = (ACCTRUE.WMSBLL.Model.User)(Session[Config.Curren_User]);
         if (indoor.Update2(Request["FYDH"], 3, Config.Curuserid, DateTime.Now))
         {
             this.WriteClientJava("window.alert('该发运单现在可以出门了!');window.close();");
             indoor.setICIDoutdoor(Request["ICID"], Request["FYDH"]);
         }
     }
     catch (Exception ex)
     {
         String strEx = ex.Message;
         this.PrintfError("第三种情况出现错误,请重试!");
         return;
     }
 }
Пример #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string type = "";
         if (Request["TYPE"] == null)
         {
             return;
         }
         type = Request["TYPE"];
         switch (type)
         {
         case "1":    //发运单号
             DataSet ds1 = null;
             try
             {
                 ds1 = InDoorParam.GetFYDH();
             }
             catch (Exception ex)
             {
                 string a = ex.Message;
                 Response.Write("ERROR");
             }
             if (ds1 != null)
             {
                 try
                 {
                     XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding);
                     writer.Formatting  = Formatting.Indented;
                     writer.Indentation = 4;
                     writer.IndentChar  = ' ';
                     ds1.WriteXml(writer);
                     writer.Flush();
                     writer.Close();
                     Response.End();
                 }
                 catch
                 { }
             }
             break;
         }
     }
 }
Пример #9
0
 private void BindCZ_User()
 {
     try
     {
         DataSet ds = InDoorParam.GetUser("");
         if (ds != null)
         {
             this.drpCZ_User.DataSource     = ds;
             this.drpCZ_User.DataTextField  = "UserID";
             this.drpCZ_User.ToolTip        = "操作人";
             this.drpCZ_User.DataValueField = "UserID";
             this.drpCZ_User.DataBind();
             this.drpCZ_User.Items.Insert(0, "请选择");
         }
     }
     catch (Exception ex)
     {
         String strEx = ex.Message;
         this.PrintfError("数据访问错误,请重试!");
         return;
     }
 }
Пример #10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             if (!string.IsNullOrEmpty(Request.QueryString["icid"].ToString().Trim()))
             {
                 string      icid       = Request.QueryString["icid"].ToString().Trim();
                 InDoorParam indoor     = new InDoorParam();
                 DataSet     dsicnumber = indoor.GetICNumber(icid);
                 if (dsicnumber != null)
                 {
                     Response.Write(dsicnumber.Tables[0].Rows[0]["ICNumber"].ToString() + "," + dsicnumber.Tables[0].Rows[0]["CPH"].ToString() + "," + dsicnumber.Tables[0].Rows[0]["KHLB"].ToString());
                 }
             }
         }
         catch
         {
             this.PrintfError("数据错误!");
         }
     }
 }
Пример #11
0
 private void BindFYDH()
 {
     try
     {
         DataSet ds = InDoorParam.GetFYDH();
         if (ds != null)
         {
             this.drpFYDH.DataSource     = ds;
             this.drpFYDH.DataTextField  = "FYDH";
             this.drpFYDH.ToolTip        = "发运单号";
             this.drpFYDH.DataValueField = "FYDH";
             this.drpFYDH.DataBind();
             Bestcomy.Web.UI.WebControls.ComboItem value = new Bestcomy.Web.UI.WebControls.ComboItem("请选择");
             this.drpFYDH.Items.Insert(0, value);
         }
     }
     catch (Exception ex)
     {
         String strEx = ex.Message;
         this.PrintfError("数据访问错误,请重试!");
         return;
     }
 }
Пример #12
0
 private void BindGridView()
 {
     if (CheckUI())
     {
         DataSet ds      = InDoorParam.GetFYDInfo(QueryFYD());
         DataSet dsCount = InDoorParam.GetFYDInfoCount(QueryFYD());
         if (ds != null)
         {
             this.lblFYDsum.Text = dsCount.Tables[0].Rows[0]["HS"].ToString();
             this.lblJHSL.Text   = dsCount.Tables[0].Rows[0]["HJJHSL"].ToString();
             this.lblSJSL.Text   = dsCount.Tables[0].Rows[0]["HJSJSL"].ToString();
             this.lblJHZL.Text   = dsCount.Tables[0].Rows[0]["HJJHZL"].ToString();
             this.lblSJZL.Text   = dsCount.Tables[0].Rows[0]["HJSJZL"].ToString();
         }
         this.grdFYD.DataSource = ds;
         this.grdFYD.DataBind();
         this.hidCheckFYDSlc.Value = "";
     }
     else
     {
         this.PrintfError("时间格式有误,请重试!");
         return;
     }
 }
Пример #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request["TYPE"]))
        {
            string type = Request["TYPE"];
            switch (type)
            {
            case "1":    //打印完工单
                if (!string.IsNullOrEmpty(Request["QUERYSQL"]))
                {
                    try
                    {
                        DataSet ds      = WGDQuery.QueryWGDExcel(Request["QUERYSQL"]);
                        string  strPrin = this.DGPrint(ds.Tables[0]);
                        Response.Write(strPrin);
                    }
                    catch
                    {
                        return;
                    }
                }
                break;

            case "2":    //打印IC卡信息
                try
                {
                    DataSet ds      = ICParam.GetPrintDS(Request["QUERYSQL"]);
                    string  strPrin = this.DGPrint(ds.Tables[0]);
                    Response.Write(strPrin);
                }

                catch
                {
                    return;
                }
                break;

            case "3":    //打印发运单(进出门管理的查看发运单模块)
                try
                {
                    DataSet ds1      = InDoorParam.GetPrintDS(Request["QUERYSQL"]);
                    string  strPrin1 = this.DGPrint(ds1.Tables[0]);
                    Response.Write(strPrin1);
                }
                catch
                {
                    return;
                }
                break;

            case "4":   //打印发运单(查询)

                break;

            case "5":   //打印转库单(查询)
                try
                {
                    DataSet ds      = ZKDQuery.QueryZKDExcel(Request["QUERYSQL"]);
                    string  strPrin = this.DGPrint(ds.Tables[0]);
                    Response.Write(strPrin);
                }
                catch
                {
                    return;
                }
                break;

            case "6":   //打印移位单(查询)
                try
                {
                    DataSet ds      = YWDQuery.QueryYWDExcel(Request["QUERYSQL"]);
                    string  strPrin = this.DGPrint(ds.Tables[0]);
                    Response.Write(strPrin);
                }
                catch
                {
                    return;
                }
                break;

            case "7":    //打印退货单(查询)
                try
                {
                    DataSet ds      = THDQuery.QueryTHDExcel(Request["QUERYSQL"]);
                    string  strPrin = this.DGPrint(ds.Tables[0]);
                    Response.Write(strPrin);
                }
                catch
                {
                    return;
                }
                break;

            case "8":    //打印待判品查询单(查询)
                try
                {
                    DataSet ds      = DPPQuery.QueryPDDExcel(Request["QUERYSQL"]);
                    string  strPrin = this.DGPrint(ds.Tables[0]);
                    Response.Write(strPrin);
                }
                catch
                {
                    return;
                }
                break;

            case "9":    //打印入库账簿单(查询)
                try
                {
                    DataSet ds      = RKZBQuery.QueryRKZBExcel(Request["QUERYSQL"]);
                    string  strPrin = this.DGPrint(ds.Tables[0]);
                    Response.Write(strPrin);
                }
                catch
                {
                    return;
                }
                break;

            case "10":    //打印出库账簿单(查询)
                try
                {
                    DataSet ds      = CKZBQuery.QueryCKZBExcel(Request["QUERYSQL"]);
                    string  strPrin = this.DGPrint(ds.Tables[0]);
                    Response.Write(strPrin);
                }
                catch
                {
                    return;
                }
                break;
            }
        }
    }
Пример #14
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;
        }
    }
Пример #15
0
    /// <summary>
    /// 根据发运单状态数据集返回不同的当前发运单的执行情况
    /// </summary>
    /// <param name="FYDH"></param>
    /// <returns></returns>
    public int Status(string FYDH)
    {
        DataSet statusDS = InDoorParam.StatusDS(FYDH);
        int     jmzt     = 0;
        int     zczt     = 0;
        int     wczt     = 0;
        int     cmzt     = 0;
        int     inizt    = 0;

        foreach (DataRow dr in statusDS.Tables[0].Rows)
        {
            {
                switch (dr[0].ToString())
                {
                case "0":
                    inizt = 1;
                    return(6);

                    break;

                case "1":
                    jmzt = 1;
                    return(4);   //刚进门

                    break;

                case "2":
                    wczt = 1;
                    break;

                case "3":
                    cmzt = 1;
                    return(5);

                    break;

                case "5":
                    zczt = 1;
                    return(1);

                    break;
                }
            }
        }
        //for (int i = 0; i < statusDS.Tables[0].Rows.Count; i++)

        if (zczt == 1)
        {
            return(1);//有正在装车
        }
        if (wczt == 1)
        {
            if (jmzt == 1)
            {
                return(3); //有进门没有装车的,也有完成状态的
            }
            return(2);     //有完成状态的
        }
        if (jmzt == 1)
        {
            return(4);//刚进门
        }
        if (cmzt == 1)
        {
            return(5);//出门状态
        }
        if (inizt == 1)
        {
            return(6);//没有进门状态
        }
        return(0);
    }
Пример #16
0
    /// <summary>
    /// 查询发运单绑定主界面列表
    /// </summary>
    private void InitFYD()
    {
        try
        {
            string strWhere = "";


            if (!string.IsNullOrEmpty(this.txtICID.Text.Trim()))
            {
                strWhere = " and wms_pub_ic.ICID = '" + this.txtICID.Text.Trim() + "'";
            }
            if (!string.IsNullOrEmpty(this.txtICNumber.Text.Trim()))
            {
                strWhere += " and wms_pub_ic.ICNumber = '" + this.txtICNumber.Text.Trim() + "'";
            }
            if (!string.IsNullOrEmpty(this.txtPassword.Text.Trim()))
            {
                strWhere += "and  wms_pub_ic.ICPass = '******'";
            }

            DataSet ds = InDoorParam.GetICDataSet(strWhere);
            if (ds == null || ds.Tables.Count <= 0 || ds.Tables[0].Rows.Count <= 0)
            {
                this.PrintfError("卡号或密码输入有误!");
                this.txtICID.Focus();
                return;
            }
            else
            {
                if (ds.Tables[0].Rows[0]["flag"].ToString() == "挂失")
                {
                    this.PrintfError("该卡已经被挂失!");
                    this.txtICID.Focus();
                    return;
                }
                else
                {
                    string strWhereFYD;
                    string KHID = ds.Tables[0].Rows[0]["KHID"].ToString();
                    string KHLB = ds.Tables[0].Rows[0]["KHLB"].ToString();
                    //2011-11-13取消客户编码限制
                    //if (KHLB == "0")
                    //{
                    //    strWhereFYD = " Status = 2 ";
                    //}
                    //else
                    //{
                    //    strWhereFYD = " KHBM = '" + KHID + "' and Status = 2";//取消了客户编码限制,与旧系统保持一致
                    //}
                    strWhereFYD = " Status = 2";

                    string CPH = this.txtCPH.Text.Trim();
                    if (string.IsNullOrEmpty(this.txtCPH.Text.Trim()))
                    {
                        strWhereFYD += " and yslb = '1' ";
                    }
                    else
                    {
                        strWhereFYD += " and cph like '%" + CPH + "%' and yslb = '1'";
                    }
                    if (!string.IsNullOrEmpty(this.txtFYDH.Text.Trim()))
                    {
                        strWhereFYD += " and FYDH = '" + this.txtFYDH.Text.Trim() + "'";
                    }
                    strWhereFYD += " and ckrq>=convert(varchar(19),getdate()-7,21)";
                    DataSet dsFYD = InDoorParam.GetFYDDataSet(strWhereFYD);
                    bool    ise   = false;
                    if (dsFYD != null && dsFYD.Tables.Count > 0 && dsFYD.Tables[0].Rows.Count > 0)
                    {
                        foreach (DataRow dr in dsFYD.Tables[0].Rows)
                        {
                            if (dr["khbmh"].ToString() == KHID)
                            {
                                ise = true;
                                break;
                            }
                        }
                        if (KHID == "0")
                        {
                            ise = true;
                        }
                        if (!ise)
                        {
                            this.PrintfError("使用正确的IC卡!");
                            return;
                        }
                    }

                    if (dsFYD != null && dsFYD.Tables[0].Rows.Count > 0)
                    {
                        this.lblFYDsum.Text = dsFYD.Tables[0].Rows.Count.ToString();
                    }
                    this.GridView1.DataSource = dsFYD;
                    this.GridView1.DataBind();
                    if (this.GridView1.Rows.Count < 1)
                    {
                        this.PrintfError("您没有可选的发运单!");
                    }
                    this.txtICID.Focus();
                }
            }
        }
        catch (Exception ex)
        {
            String strEx = ex.Message;
            this.PrintfError("查询发运单方法出现错误,请重试!");
            return;
        }
    }
Пример #17
0
    /// <summary>
    /// 初始化页面时获取发运单DataSet并为打印页填充值
    /// </summary>
    private void InitDS()
    {
        try
        {
            this.Literal1.Text = "";
            string strInit = "";
            if (string.IsNullOrEmpty(Request["fydh"]))
            {
                this.PrintfError("没有选择要打印的发运单!");
                return;
            }
            else
            {
                //string strWhere = " FYDH = '" + Request["fydh"] + "' and CKDH = '"+Request["ckdh"]+"' and CK = '"+Request["ck"]+"' and WLH = '"+Request["wlh"]+"'";
                string  strWhere = " FYDH = '" + Request["fydh"] + "'";
                DataSet ds       = InDoorParam.getDS(strWhere);
                DataSet dsHJ     = InDoorParam.getDSByFYDH(Request["fydh"]);


                int    HJJHSL = 0;
                double HJJHZL = 0;
                foreach (DataRow dr in dsHJ.Tables[0].Rows)
                {
                    if (!string.IsNullOrEmpty(dr["JHSL"].ToString()))
                    {
                        HJJHSL += Convert.ToInt32(dr["JHSL"].ToString());
                    }
                    if (!string.IsNullOrEmpty(dr["JHZL"].ToString()))
                    {
                        HJJHZL += Convert.ToDouble(dr["JHZL"].ToString());
                    }
                }

                ACCTRUE.WMSBLL.Model.User user = (ACCTRUE.WMSBLL.Model.User)(Session[Config.Curren_User]);
                string userName  = user.UserName;
                string PrintDate = DateTime.Now.ToShortDateString();
                this.txtCZ_User.Text = userName;
                this.txtRQ.Text      = PrintDate;
                this.txtHJ_JHSL.Text = HJJHSL.ToString();
                this.txtHJ_JHZL.Text = HJJHZL.ToString();

                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    this.txtFYDH.Text   = ds.Tables[0].Rows[0]["fydh"].ToString();
                    this.txtCPH.Text    = ds.Tables[0].Rows[0]["CPH"].ToString();
                    this.txtKHName.Text = ds.Tables[0].Rows[0]["KHName"].ToString();
                    this.txtZDRY.Text   = ds.Tables[0].Rows[0]["NCZDRY"].ToString();
                    this.txtZDRQ.Text   = Convert.ToDateTime(ds.Tables[0].Rows[0]["NCZDRQ"].ToString()).ToShortDateString();
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        string FYDH;
                        if (string.IsNullOrEmpty(dr["FYDH"].ToString()))
                        {
                            FYDH = "";
                        }
                        else
                        {
                            FYDH = dr["FYDH"].ToString();
                        }

                        string CPH;
                        if (string.IsNullOrEmpty(dr["CPH"].ToString()))
                        {
                            CPH = "";
                        }
                        else
                        {
                            CPH = dr["CPH"].ToString();
                        }

                        string KHName;
                        if (string.IsNullOrEmpty(dr["KHName"].ToString()))
                        {
                            KHName = "";
                        }
                        else
                        {
                            KHName = dr["KHName"].ToString();
                        }

                        string NCZDRY;
                        if (string.IsNullOrEmpty(dr["NCZDRY"].ToString()))
                        {
                            NCZDRY = "";
                        }
                        else
                        {
                            NCZDRY = dr["NCZDRY"].ToString();
                        }

                        DateTime NCZDRQ = DateTime.Now;
                        string   ZDRQ;
                        if (string.IsNullOrEmpty(dr["NCZDRQ"].ToString()))
                        {
                            ZDRQ = "";
                        }
                        else
                        {
                            NCZDRQ = Convert.ToDateTime(dr["NCZDRQ"]);
                            ZDRQ   = NCZDRQ.ToShortDateString();
                        }

                        string CKName;
                        if (string.IsNullOrEmpty(dr["CKName"].ToString()))
                        {
                            CKName = "";
                        }
                        else
                        {
                            CKName = dr["CKName"].ToString();
                        }

                        string WLMC;
                        if (string.IsNullOrEmpty(dr["WLMC"].ToString()))
                        {
                            WLMC = "";
                        }
                        else
                        {
                            WLMC = dr["WLMC"].ToString();
                        }
                        string free;
                        string free1;
                        string free2;
                        string free3;
                        free1 = "【" + dr["vfree1"].ToString() + "】";
                        free2 = "【" + dr["vfree2"].ToString() + "】";
                        free3 = "【" + dr["vfree3"].ToString() + "】";
                        free  = "【" + dr["vfree1"].ToString() + "】" + "【" + dr["vfree2"].ToString() + "】" + "【" + dr["vfree3"].ToString() + "】";
                        string SX;
                        if (string.IsNullOrEmpty(dr["SX"].ToString()))
                        {
                            SX = "";
                        }
                        else
                        {
                            SX = dr["SX"].ToString();
                        }

                        int JHSL;
                        if (string.IsNullOrEmpty(dr["JHSL"].ToString()))
                        {
                            JHSL = 0;
                        }
                        else
                        {
                            JHSL = Convert.ToInt32(dr["JHSL"].ToString());
                        }

                        double JHZL;
                        if (string.IsNullOrEmpty(dr["JHZL"].ToString()))
                        {
                            JHZL = 0;
                        }
                        else
                        {
                            JHZL = Convert.ToDouble(dr["JHZL"].ToString());
                        }

                        string FJLDW;
                        if (string.IsNullOrEmpty(dr["FJLDW"].ToString()))
                        {
                            FJLDW = "";
                        }
                        else
                        {
                            FJLDW = dr["FJLDW"].ToString();
                        }

                        string PCInfo;
                        if (string.IsNullOrEmpty(dr["PCInfo"].ToString()))
                        {
                            PCInfo = "";
                        }
                        else
                        {
                            PCInfo = dr["PCInfo"].ToString();
                        }

                        string Remark;
                        if (string.IsNullOrEmpty(dr["ZLDJ"].ToString()))
                        {
                            Remark = "";
                        }
                        else
                        {
                            Remark = dr["ZLDJ"].ToString();
                        }
                        if (string.IsNullOrEmpty(strInit))
                        {
                            strInit += InitTable(CKName, WLMC, SX, JHSL.ToString(), JHZL.ToString(), FJLDW, PCInfo, Remark, free1, free2, free3);
                        }
                        else
                        {
                            strInit += "<tr><td>&nbsp;</td></tr>";
                            strInit += InitTable(CKName, WLMC, SX, JHSL.ToString(), JHZL.ToString(), FJLDW, PCInfo, Remark, free1, free2, free3);
                        }
                    }
                    this.Literal1.Text = strInit;
                }
            }
        }
        catch
        {
            this.PrintfError("打印小票出现错误,请重试或退出系统后重新登陆");
            return;
        }
    }
Пример #18
0
    /// <summary>
    /// 查询发运单绑定主界面列表
    /// </summary>
    private int InitFYD()
    {
        string strWhere = "";

        if (!string.IsNullOrEmpty(this.txtICID.Text.Trim()))    //IC卡ID
        {
            strWhere = " and wms_pub_ic.ICID = '" + this.txtICID.Text.Trim() + "'";
        }
        if (!string.IsNullOrEmpty(this.txtICNumber.Text.Trim()))    //IC卡卡号
        {
            strWhere += " and wms_pub_ic.ICNumber = '" + this.txtICNumber.Text.Trim() + "'";
        }
        if (!string.IsNullOrEmpty(this.txtPassword.Text.Trim()))        //IC卡密码
        {
            strWhere += "and  wms_pub_ic.ICPass = '******'";
        }

        try
        {
            DataSet ds = InDoorParam.GetICDataSet(strWhere);
            if (ds == null || ds.Tables.Count <= 0 || ds.Tables[0].Rows.Count <= 0)
            {
                this.PrintfError("卡号或密码输入有误!");
                this.txtICID.Focus();
                return(-1);
            }
            else
            {
                if (ds.Tables[0].Rows[0]["flag"].ToString() == "挂失")
                {
                    this.PrintfError("该卡已经被挂失!");
                    this.txtICID.Focus();
                    return(-1);
                }
                else
                {
                    if (ds.Tables[0].Rows[0]["ICPass"].ToString() == "1")
                    {
                        return(-2);
                    }
                    string strWhereFYD;
                    string KHID = ds.Tables[0].Rows[0]["KHID"].ToString();
                    string KHLB = ds.Tables[0].Rows[0]["KHLB"].ToString();
                    if (KHLB == "0")
                    {
                        strWhereFYD = " Status in (0,1,2,5) ";
                    }
                    else
                    {
                        strWhereFYD = " KHBM = '" + KHID + "' and Status in (0,1,2,5)";
                    }
                    string CPH = this.txtCPH.Text.Trim();
                    if (string.IsNullOrEmpty(CPH))
                    {
                        strWhereFYD += " and yslb = '1' ";
                    }
                    else
                    {
                        strWhereFYD += " and cph like '%" + CPH + "%' and yslb = '1'";
                    }

                    DataSet dsFYD = InDoorParam.GetFYDDataSet(strWhereFYD);
                    if (dsFYD != null && dsFYD.Tables[0].Rows.Count > 0)
                    {
                        this.lblFYDsum.Text = dsFYD.Tables[0].Rows.Count.ToString();
                    }
                    this.GridView1.DataSource = dsFYD;
                    this.GridView1.DataBind();
                    if (this.GridView1.Rows.Count < 1)
                    {
                        this.PrintfError("您没有可选的发运单!");
                    }
                }
            }
            return(0);
        }
        catch (Exception ex)
        {
            String strEx = ex.Message;
            this.PrintfError("数据访问错误,请重试!");
            return(-1);
        }
    }
Пример #19
0
 /// <summary>
 /// 允许进门
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnAllowInDoor_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         if (string.IsNullOrEmpty(this.hidCPH.Value))
         {
             this.PrintfError("没有选择发运单!");
             this.txtICID.Focus();
             return;
         }
         InDoorParam indoor   = new InDoorParam();
         bool        isIndoor = indoor.IsInDoor(this.hidCPH.Value.ToString().Trim());
         if (isIndoor == true)
         {
             Response.Write("<script>window.alert('此车号的车已经在厂内,不允许二次进厂!')</script>");
             this.txtICID.Focus();
             return;
         }
         else
         {
             bool timeInterval = indoor.isTimeAllow(this.hidCPH.Value);
             if (timeInterval == false)
             {
                 Response.Write("<script>window.alert('该车号的时间间隔太短,不能二次进门!')</script>");
                 this.txtICID.Focus();
                 return;
             }
             else
             {
                 string status = indoor.getStatus(this.hidCValue.Value, this.hidCK.Value, this.hidWLH.Value, this.hidSX.Value);
                 if (status != "0")
                 {
                     this.PrintfError("该发运单不存在或当前状态已不允许进门!");
                     this.txtICID.Focus();
                     return;
                 }
                 else
                 {
                     if (string.IsNullOrEmpty(this.hidICID.Value))
                     {
                         this.PrintfError("出现错误,请重新刷卡进门");
                         return;
                     }
                     ACCTRUE.WMSBLL.Model.User user = (ACCTRUE.WMSBLL.Model.User)(Session[Config.Curren_User]);
                     if (indoor.Update(this.hidCValue.Value, 1, user.UserID, DateTime.Now))
                     {
                         this.PrintfError("该发运单现在可以进门了!");
                         indoor.setICIDindoor(this.hidICID.Value.Trim(), this.hidCValue.Value.Trim());
                         InDoorCheckFYD();
                         this.txtICID.Focus();
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         String strEx = ex.Message;
         this.PrintfError("进门失败,请重试!");
         return;
     }
 }