Example #1
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;
        }
    }
Example #2
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
        { }
    }
Example #3
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);
        }
    }
Example #4
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;
        }
    }