Ejemplo n.º 1
0
        //清除条件
        private void clearCondition()
        {
            WarehouseDropDownList.ClearSelection();
            WarehouseDropDownList.Items[0].Selected = true;

            ChildWarehouseDropDownList.ClearSelection();
            ChildWarehouseDropDownList.Items[0].Selected = true;

            TypeDropDownList.ClearSelection();
            TypeDropDownList.Items[0].Selected = true;

            SubTypeDropDownList.ClearSelection();
            SubTypeDropDownList.Items[0].Selected = true;

            DateTextBox.Text = System.DateTime.Now.ToString("yyyy-MM-dd");

            TextBoxCode.Text      = string.Empty; //物料代码
            TextBoxName.Text      = string.Empty; //物料名称
            TextBoxPTC.Text       = string.Empty; //计划跟踪号
            TextBoxNO.Text        = string.Empty; //标识号
            TextBoxLotNumber.Text = string.Empty; //批号
            TextBoxLength.Text    = string.Empty; //长
            TextBoxWidth.Text     = string.Empty; //宽
            TextBoxAttribute.Text = string.Empty; //材质
            TextBoxStandard.Text  = string.Empty; //规格型号
            TextBoxFixed.Text     = string.Empty; //是否定尺
            TextBoxNote.Text      = string.Empty; //备注查询
            TextBoxOrderCode.Text = string.Empty; //订单编号
        }
Ejemplo n.º 2
0
        //清除条件
        private void clearCondition()
        {
            //审核状态
            foreach (ListItem lt in DropDownListState.Items)
            {
                if (lt.Selected)
                {
                    lt.Selected = false;
                }
            }
            DropDownListState.Items[0].Selected = true;

            //红蓝字
            foreach (ListItem lt in DropDownListColour.Items)
            {
                if (lt.Selected)
                {
                    lt.Selected = false;
                }
            }
            DropDownListColour.Items[0].Selected = true;


            //领料单编号
            TextBoxCode.Text = string.Empty;
            //领料部门
            TextBoxDep.Text       = string.Empty;
            TextBoxVrifier.Text   = string.Empty;
            TextBoxStartDate.Text = string.Empty;
            TextBoxDate.Text      = string.Empty;
            //TextBoxZhDEnd.Text = string.Empty;
            //TextBoxZhDStartTime.Text = string.Empty;
            TextBoxMCode.Text     = string.Empty;
            TextBoxMName.Text     = string.Empty;
            TextBoxMStandard.Text = string.Empty;
            TextBoxMPTC.Text      = string.Empty;
            TextBoxZDR.Text       = string.Empty;
            TextBoxCZ.Text        = string.Empty;
            TextBoxEngid.Text     = string.Empty;
            TextBoxZDDate.Text    = string.Empty;
            TextBoxZZBZ.Text      = string.Empty;
            TextBoxSender.Text    = string.Empty;
            TextBoxInCode.Text    = string.Empty;
            TextBoxNewCode.Text   = string.Empty;
            //TextBoxcangku.Text = string.Empty;
            //TextBoxwareposition.Text = string.Empty;
            TextBoxJhua.Text     = string.Empty;
            TextBoxBshi.Text     = string.Empty;
            TextBoxShifanum.Text = string.Empty;

            WarehouseDropDownList.ClearSelection();
            WarehouseDropDownList.Items[0].Selected = true;

            ChildWarehouseDropDownList.ClearSelection();
            ChildWarehouseDropDownList.Items[0].Selected = true;
        }
Ejemplo n.º 3
0
        private void GetWarehouse()
        {
            string    sql = "SELECT DISTINCT WS_ID,WS_NAME FROM TBWS_WAREHOUSE  ORDER BY WS_ID";
            DataTable dt  = DBCallCommon.GetDTUsingSqlText(sql);

            WarehouseDropDownList.DataSource     = dt;
            WarehouseDropDownList.DataTextField  = "WS_NAME";
            WarehouseDropDownList.DataValueField = "WS_ID";
            WarehouseDropDownList.DataBind();
            ListItem item = new ListItem("--请选择--", "0");

            WarehouseDropDownList.Items.Insert(0, item);
        }
Ejemplo n.º 4
0
        private string GetStrCondition()
        {
            string condition   = "1=1";
            string QRcondition = "";

            //以下语句为准备查询条件
            //物料代码条件
            if (TextBoxCode.Text.Trim() != "")
            {
                condition = " QROut_MatCode LIKE '%" + TextBoxCode.Text.Trim() + "%'";
                addQueryItem(PageName, "TextBoxCode", TextBoxCode.GetType().ToString(), TextBoxCode.Text.Trim());

                //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                if (DropDownListPlanno.SelectedValue != "1")
                {
                    QRcondition += " and QROut_MatCode like '%" + TextBoxCode.Text.Trim() + "%'";
                }
                //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            }

            //物料名称条件
            if ((TextBoxName.Text.Trim() != "") && (condition != ""))
            {
                condition += " AND " + " MaterialName LIKE '%" + TextBoxName.Text.Trim() + "%'";
                addQueryItem(PageName, "TextBoxName", TextBoxName.GetType().ToString(), TextBoxName.Text.Trim());
                //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                if (DropDownListPlanno.SelectedValue != "1")
                {
                    QRcondition += " and MaterialName like '%" + TextBoxName.Text.Trim() + "%'";
                }
                //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            }

            //标识号
            if ((TextBoxNO.Text.Trim() != "") && (condition != ""))
            {
                condition += " AND " + " CGMODE LIKE '%" + TextBoxNO.Text.Trim().ToUpper() + "%'";
                addQueryItem(PageName, "TextBoxNO", TextBoxNO.GetType().ToString(), TextBoxNO.Text.Trim());
            }
            //计划跟踪号条件
            if ((TextBoxPTC.Text.Trim() != "") && (condition != ""))
            {
                if (TextBoxPTC.Text.Trim() == "备库")
                {
                    condition += " AND " + " (PTC LIKE '%备库%' or PTC LIKE '%BEIKU%')";
                    addQueryItem(PageName, "TextBoxPTC", TextBoxPTC.GetType().ToString(), TextBoxPTC.Text.Trim());
                }
                else
                {
                    condition += " AND " + " PTC LIKE'%" + TextBoxPTC.Text.Trim() + "%'";
                    addQueryItem(PageName, "TextBoxPTC", TextBoxPTC.GetType().ToString(), TextBoxPTC.Text.Trim());
                }
            }
            //批号条件
            if ((TextBoxLotNumber.Text != "") && (condition != ""))
            {
                condition += " AND " + " PTC LIKE '%" + TextBoxLotNumber.Text.Trim() + "%'";
                addQueryItem(PageName, "TextBoxLotNumber", TextBoxLotNumber.GetType().ToString(), TextBoxLotNumber.Text.Trim());
            }
            //型号规格条件
            if ((TextBoxStandard.Text != "") && (condition != ""))
            {
                condition += " AND " + " Standard LIKE '%" + TextBoxStandard.Text.Trim() + "%'";
                addQueryItem(PageName, "TextBoxStandard", TextBoxStandard.GetType().ToString(), TextBoxStandard.Text.Trim());
                //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                if (DropDownListPlanno.SelectedValue != "1")
                {
                    QRcondition += " and Standard like '%" + TextBoxStandard.Text.Trim() + "%'";
                }
                //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            }
            //长度条件
            if ((TextBoxLength.Text != "") && (condition != ""))
            {
                condition += " AND " + " Length LIKE '%" + TextBoxLength.Text.Trim() + "%'";
                addQueryItem(PageName, "TextBoxLength", TextBoxLength.GetType().ToString(), TextBoxLength.Text.Trim());
            }
            //宽度条件
            if ((TextBoxWidth.Text != "") && (condition != ""))
            {
                condition += " AND " + " Width LIKE '%" + TextBoxWidth.Text.Trim() + "%'";
                addQueryItem(PageName, "TextBoxWidth", TextBoxWidth.GetType().ToString(), TextBoxWidth.Text.Trim());
            }
            //材质条件
            if ((TextBoxAttribute.Text != "") && (condition != ""))
            {
                condition += " AND " + " Attribute LIKE '%" + TextBoxAttribute.Text.Trim() + "%'";
                addQueryItem(PageName, "TextBoxAttribute", TextBoxAttribute.GetType().ToString(), TextBoxAttribute.Text.Trim());
                //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                if (DropDownListPlanno.SelectedValue != "1")
                {
                    QRcondition += " and Attribute like '%" + TextBoxAttribute.Text.Trim() + "%'";
                }
                //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            }
            //是否定尺
            if ((TextBoxFixed.Text != "") && (condition != ""))
            {
                condition += " AND " + " Fixed LIKE '%" + TextBoxFixed.Text.Trim().ToUpper() + "%'";
                addQueryItem(PageName, "TextBoxFixed", TextBoxFixed.GetType().ToString(), TextBoxFixed.Text.Trim());
            }
            //备注条件
            if ((TextBoxNote.Text != "") && (condition != ""))
            {
                condition += " AND " + " Note LIKE '%" + TextBoxNote.Text.Trim() + "%'";
                addQueryItem(PageName, "TextBoxNote", TextBoxNote.GetType().ToString(), TextBoxNote.Text.Trim());
            }

            //订单编号条件
            if ((TextBoxOrderCode.Text != "") && (condition != ""))
            {
                condition += " AND " + " OrderCode LIKE '%" + TextBoxOrderCode.Text.Trim() + "%'";
                addQueryItem(PageName, "TextBoxOrderCode", TextBoxOrderCode.GetType().ToString(), TextBoxOrderCode.Text.Trim());
            }


            //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            //是否出库(即是否生成入库单)
            if ((DropDownListQROutState.SelectedValue != "") && (condition != ""))
            {
                condition += " AND " + " QROut_State='" + DropDownListQROutState.SelectedValue + "'";
                addQueryItem(PageName, "DropDownListQROutState", DropDownListQROutState.GetType().ToString(), DropDownListQROutState.SelectedValue);

                //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                QRcondition += " and QROut_State='" + DropDownListQROutState.SelectedValue + "'";
                //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            }
            if ((DropDownListQROutState.SelectedValue == "") && (condition != ""))
            {
                condition += " AND " + " (QROut_State='0' or QROut_State='1')";
                addQueryItem(PageName, "DropDownListQROutState", DropDownListQROutState.GetType().ToString(), DropDownListQROutState.SelectedValue);
            }
            //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

            //仓库条件
            if ((WarehouseDropDownList.SelectedValue != "0") && (ChildWarehouseDropDownList.SelectedValue != "0"))
            {
                if (condition != "")
                {
                    condition += " AND " + " WarehouseCode='" + ChildWarehouseDropDownList.SelectedValue + "'";
                    addQueryItem(PageName, "WarehouseDropDownList", WarehouseDropDownList.GetType().ToString(), WarehouseDropDownList.SelectedValue);
                    addQueryItem(PageName, "ChildWarehouseDropDownList", ChildWarehouseDropDownList.GetType().ToString(), ChildWarehouseDropDownList.SelectedValue);
                }
                else
                {
                    condition += " WarehouseCode='" + ChildWarehouseDropDownList.SelectedValue + "'";
                    addQueryItem(PageName, "WarehouseDropDownList", WarehouseDropDownList.GetType().ToString(), WarehouseDropDownList.SelectedValue);
                    addQueryItem(PageName, "ChildWarehouseDropDownList", ChildWarehouseDropDownList.GetType().ToString(), ChildWarehouseDropDownList.SelectedValue);
                }
            }
            else if ((WarehouseDropDownList.SelectedValue != "0") && (ChildWarehouseDropDownList.SelectedValue == "0"))
            {
                if (condition != "")
                {
                    condition += " AND " + " WarehouseCode LIKE '" + WarehouseDropDownList.SelectedValue + "%'";
                    addQueryItem(PageName, "WarehouseDropDownList", WarehouseDropDownList.GetType().ToString(), WarehouseDropDownList.SelectedValue);
                    addQueryItem(PageName, "ChildWarehouseDropDownList", ChildWarehouseDropDownList.GetType().ToString(), ChildWarehouseDropDownList.SelectedValue);
                }
                else
                {
                    condition += " WarehouseCode LIKE '" + WarehouseDropDownList.SelectedValue + "%'";
                    addQueryItem(PageName, "WarehouseDropDownList", WarehouseDropDownList.GetType().ToString(), WarehouseDropDownList.SelectedValue);
                    addQueryItem(PageName, "ChildWarehouseDropDownList", ChildWarehouseDropDownList.GetType().ToString(), ChildWarehouseDropDownList.SelectedValue);
                }
            }

            //物料条件
            if ((TypeDropDownList.SelectedValue != "0") && (SubTypeDropDownList.SelectedValue != "0"))
            {
                if (condition != "")
                {
                    condition += " AND " + " QROut_MatCode LIKE '" + SubTypeDropDownList.SelectedValue + "%'";
                    addQueryItem(PageName, "TypeDropDownList", TypeDropDownList.GetType().ToString(), TypeDropDownList.SelectedValue);
                    addQueryItem(PageName, "SubTypeDropDownList", SubTypeDropDownList.GetType().ToString(), SubTypeDropDownList.SelectedValue);
                }
                else
                {
                    condition += " QROut_MatCode LIKE '" + SubTypeDropDownList.SelectedValue + "%'";
                    addQueryItem(PageName, "TypeDropDownList", TypeDropDownList.GetType().ToString(), TypeDropDownList.SelectedValue);
                    addQueryItem(PageName, "SubTypeDropDownList", SubTypeDropDownList.GetType().ToString(), SubTypeDropDownList.SelectedValue);
                }
            }
            else if ((TypeDropDownList.SelectedValue != "0") && (SubTypeDropDownList.SelectedValue == "0"))
            {
                if (condition != "")
                {
                    condition += " AND " + " QROut_MatCode LIKE '" + TypeDropDownList.SelectedValue + "%'";
                    addQueryItem(PageName, "TypeDropDownList", TypeDropDownList.GetType().ToString(), TypeDropDownList.SelectedValue);
                    addQueryItem(PageName, "SubTypeDropDownList", SubTypeDropDownList.GetType().ToString(), SubTypeDropDownList.SelectedValue);
                }
                else
                {
                    condition += " QROut_MatCode LIKE '" + TypeDropDownList.SelectedValue + "%'";
                    addQueryItem(PageName, "TypeDropDownList", TypeDropDownList.GetType().ToString(), TypeDropDownList.SelectedValue);
                    addQueryItem(PageName, "SubTypeDropDownList", SubTypeDropDownList.GetType().ToString(), SubTypeDropDownList.SelectedValue);
                }
            }
            if (DropDownListPlanno.SelectedValue == "1")
            {
                condition = condition;
            }
            else
            {
                condition = condition + " or ((PTC is null or PTC='')" + QRcondition + ")";
            }
            return(condition);
        }