示例#1
0
        public static string getPiecePart(string partNo)
        {
            string res = string.Empty;

            try
            {
                string sql = "SELECT  [BarcodeNO],[PartNO],[Location],[Creater],[CreateDate] " +
                             "FROM [WMS_BarCode_V10].[dbo].[ARGPackingWIP_t] where PartNo = '" + partNo + "' and BPstatus = '0'  " +
                             "order by cast(replace(REPLACE(location,'-',''),'M','') as int)";

                DataSet ds = new DataSet();
                ds = FGA_DAL.Base.SQLServerHelper_WMS.Query(sql);
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    List <BarcodeHelperModel> luw = new List <BarcodeHelperModel>();
                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        BarcodeHelperModel ERM = new BarcodeHelperModel(row);
                        luw.Add(ERM);
                    }

                    JavaScriptSerializer jssl = new JavaScriptSerializer();
                    res = jssl.Serialize(luw);
                    res = res.Replace("\\/Date(", "").Replace(")\\/", "");
                }
            }
            catch (Exception e)
            {
            }
            return(res);
        }
        public static string getPartialData()
        {
            string res = string.Empty;

            try
            {
                string sql = "SELECT [BarcodeNO],[PartNO],[BoxType],[OrderQty],[Quantity] " +
                             ",[Creator],[CreateDate],[BoxStatus],[Location] " +
                             " FROM [WMS_BarCode_V10].[dbo].[ARGPartialBox_T] where isnull(dr,0) = 0 and len(barcodeno) > 7 and [Location] not like '%T%' order by CreateDate DESC ";

                DataSet ds = new DataSet();
                ds = FGA_DAL.Base.SQLServerHelper_WMS.Query(sql);
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    List <BarcodeHelperModel> luw = new List <BarcodeHelperModel>();
                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        BarcodeHelperModel ERM = new BarcodeHelperModel(row);
                        luw.Add(ERM);
                    }

                    JavaScriptSerializer jssl = new JavaScriptSerializer();
                    res = jssl.Serialize(luw);
                    res = res.Replace("\\/Date(", "").Replace(")\\/", "");
                }
            }
            catch (Exception e)
            {
            }
            return(res);
        }
        public static string SearchPartialData(string BarcodeID)
        {
            string res = string.Empty;

            try
            {
                string sql = "SELECT [BarcodeNO],[PartNO],[BoxType],[OrderQty],[Quantity] " +
                             ",[Creator],[CreateDate],[BoxStatus],[Location] " +
                             " FROM [WMS_BarCode_V10].[dbo].[ARGPartialBox_T] where isnull(dr,0) = 0 and len(barcodeno) > 7 and [Location] not like '%T%' ";

                //查询条件
                if (!String.IsNullOrEmpty(BarcodeID))
                {
                    string ids = "\'0\'";
                    int    lg  = BarcodeID.Length / 9;
                    for (int i = 0; i < lg; i++)
                    {
                        ids = ids + "," + '\'' + BarcodeID.Substring(i * 9, 9) + '\'';
                    }

                    sql = sql + " and [BarcodeNO] in (" + ids + ") ";
                }
                else
                {
                    sql = sql + " and 1 = 2 ";
                }

                sql = sql + " order by CreateDate DESC";

                DataSet ds = new DataSet();
                ds = FGA_DAL.Base.SQLServerHelper_WMS.Query(sql);
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    List <BarcodeHelperModel> luw = new List <BarcodeHelperModel>();
                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        BarcodeHelperModel ERM = new BarcodeHelperModel(row);
                        luw.Add(ERM);
                    }

                    JavaScriptSerializer jssl = new JavaScriptSerializer();
                    res = jssl.Serialize(luw);
                    res = res.Replace("\\/Date(", "").Replace(")\\/", "");
                }
            }
            catch (Exception e)
            {
            }
            return(res);
        }
示例#4
0
        public static string SearchData(string bncode, string pncode, string location, string fdate, string tdate)
        {
            string res = string.Empty;

            try
            {
                string sql = "SELECT  [BarcodeNO],[PartNO],[Location],[Creater],[CreateDate] " +
                             "FROM [WMS_BarCode_V10].[dbo].[ARGPackingWIP_t] where 1=1 and BPstatus = '0'";

                //查询条件
                if (!String.IsNullOrEmpty(bncode))
                {
                    sql = sql + " and [BarcodeNO] like '" + bncode + "'";
                }
                if (!String.IsNullOrEmpty(pncode))
                {
                    sql = sql + " and [PartNO] like  '" + pncode + "'";
                }
                if (!String.IsNullOrEmpty(location))
                {
                    if (location == "All")
                    {
                        sql = sql + " and [location] = [location]";
                    }
                    else
                    {
                        sql = sql + " and [location] = '" + location + "'";
                    }
                }
                if (!String.IsNullOrEmpty(fdate))
                {
                    sql = sql + " and [createdate] >= cast('" + fdate + "' as datetime)";
                }
                if (!String.IsNullOrEmpty(tdate))
                {
                    sql = sql + " and [createdate] <= cast('" + tdate + "' as datetime)";
                }


                sql = sql + " order by cast(replace(substring(location,2,len(location)-1),'-','') as int)";

                DataSet ds = new DataSet();
                ds = FGA_DAL.Base.SQLServerHelper_WMS.Query(sql);
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    List <BarcodeHelperModel> luw = new List <BarcodeHelperModel>();
                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        BarcodeHelperModel ERM = new BarcodeHelperModel(row);
                        luw.Add(ERM);
                    }

                    JavaScriptSerializer jssl = new JavaScriptSerializer();
                    res = jssl.Serialize(luw);
                    res = res.Replace("\\/Date(", "").Replace(")\\/", "");
                }
            }
            catch (Exception e)
            {
            }
            return(res);
        }
        public static string SearchData(string bncode, string pncode, string location, string fdate, string tdate)
        {
            string res = string.Empty;

            try
            {
                string sql = "SELECT [BarcodeNO],[PartNO],[BoxType],[OrderQty],[Quantity] " +
                             ",[Creator],[CreateDate],[BoxStatus],[Location] " +
                             " FROM [WMS_BarCode_V10].[dbo].[ARGPartialBox_T] where isnull(dr,0) = 0 and len(barcodeno) > 7";

                //查询条件
                if (!String.IsNullOrEmpty(bncode))
                {
                    sql = sql + " and [BarcodeNO] like '%" + bncode + "%' ";
                }
                if (!String.IsNullOrEmpty(pncode))
                {
                    sql = sql + " and [PartNO] like  '%" + pncode + "%' ";
                }
                if (!String.IsNullOrEmpty(location))
                {
                    if (location == "All")
                    {
                        sql = sql + " and [location] = [location]";
                    }
                    else
                    {
                        sql = sql + " and [location] like  '%" + location + "%' ";
                    }
                }
                if (!String.IsNullOrEmpty(fdate))
                {
                    sql = sql + " and [createdate] >= cast('" + fdate + "' as datetime)";
                }
                if (!String.IsNullOrEmpty(tdate))
                {
                    sql = sql + " and [createdate] <= cast('" + tdate + "' as datetime)";
                }


                sql = sql + " order by location";

                DataSet ds = new DataSet();
                ds = FGA_DAL.Base.SQLServerHelper_WMS.Query(sql);
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    List <BarcodeHelperModel> luw = new List <BarcodeHelperModel>();
                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        BarcodeHelperModel ERM = new BarcodeHelperModel(row);
                        luw.Add(ERM);
                    }

                    JavaScriptSerializer jssl = new JavaScriptSerializer();
                    res = jssl.Serialize(luw);
                    res = res.Replace("\\/Date(", "").Replace(")\\/", "");
                }
            }
            catch (Exception e)
            {
            }
            return(res);
        }