Exemple #1
0
        public Impr1 Get_Impr1_List(Impr request)
        {
            Impr1 Result = null;

            try
            {
                using (var db = DbConnectionFactory.OpenDbConnection())
                {
                    Result = null;                                                                                                                                            //db.QuerySingle<Impr1>(strSql);
                }
            }
            catch { throw; }
            return(Result);
        }
        public Impr1 GetList(List_Impr1 request)
        {
            Impr1 Result = null;

            try
            {
                using (var db = DbConnectionFactory.OpenDbConnection("WMS"))
                {
                    Result = db.QuerySingle <Impr1>(
                        "Select * From Impr1 Where IsNull(ProductCode,'')<>'' And IsNull(StatusCode,'')<>'DEL' And UserDefine01=" + Modfunction.SQLSafeValue(request.BarCode)
                        );
                }
            }
            catch { throw; }
            return(Result);
        }
        public Impr1 Get_Impr1_Single(Impr request)
        {
            Impr1 Result = null;

            try
            {
                using (var db = DbConnectionFactory.OpenDbConnection("WMS"))
                {
                    List <Impa1> impa1           = db.Select <Impa1>("Select * from Impa1");
                    string       strBarCodeFiled = impa1[0].BarCodeField;
                    string       strSql          = "Select * From Impr1 Where IsNull(ProductCode,'')<>'' And IsNull(StatusCode,'')<>'DEL' And " + strBarCodeFiled + "='" + request.BarCode + "'";
                    Result = db.QuerySingle <Impr1>(strSql);
                }
            }
            catch { throw; }
            return(Result);
        }
Exemple #4
0
        public Impr1 Get_Impr1_Single(Impr request)
        {
            Impr1 Result = null;

            try
            {
                using (var db = DbConnectionFactory.OpenDbConnection("WMS"))
                {
                    List <Impa1> impa1           = db.Select <Impa1>("Select * from Impa1");
                    string       strBarCodeFiled = impa1[0].BarCodeField;
                    string[]     strBarCodeList  = strBarCodeFiled.Split(',');
                    if (strBarCodeList.Length <= 1)
                    {
                        string strSql = "Select * From Impr1 Where IsNull(ProductCode,'')<>'' And IsNull(StatusCode,'')<>'DEL' And " + strBarCodeFiled + "='" + Modfunction.SQLSafe(request.BarCode) + "'";
                        Result = db.QuerySingle <Impr1>(strSql);
                    }
                    else
                    {
                        string strBarCodeFilter = "";
                        for (int i = 0; i < strBarCodeList.Length; i++)
                        {
                            if (strBarCodeFilter == "")
                            {
                                strBarCodeFilter = strBarCodeList[i] + "='" + Modfunction.SQLSafe(request.BarCode) + "'";
                            }
                            else
                            {
                                strBarCodeFilter = strBarCodeFilter + " OR " + strBarCodeList[i] + "='" + Modfunction.SQLSafe(request.BarCode) + "'";
                            }
                        }
                        if (strBarCodeFilter != "")
                        {
                            string strSql = "Select * From Impr1 Where IsNull(ProductCode,'')<>'' And IsNull(StatusCode,'')<>'DEL' And (" + strBarCodeFilter + ")";
                            Result = db.QuerySingle <Impr1>(strSql);
                        }
                        else
                        {
                            string strSql = "Select top 0 * From Impr1 ";
                            Result = db.QuerySingle <Impr1>(strSql);
                        }
                    }
                }
            }
            catch { throw; }
            return(Result);
        }