Ejemplo n.º 1
0
        public List <productTestDesc> getProductTestDescriptionList()
        {
            productTestDesc        ptdesc;
            List <productTestDesc> PTDescList = new List <productTestDesc>();

            try
            {
                SqlConnection conn  = new SqlConnection(Login.connString);
                string        query = "select TestDescriptionID, TestDescription,Status,CreateTime,CreateUser from ProductTestDescription order by TestDescriptionID";

                SqlCommand cmd = new SqlCommand(query, conn);
                conn.Open();
                SqlDataReader reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    ptdesc = new productTestDesc();
                    ptdesc.TestDescriptionID = reader.GetString(0);
                    ptdesc.TestDescription   = reader.GetString(1);
                    ptdesc.Status            = reader.GetInt32(2);
                    ptdesc.CreateTime        = reader.GetDateTime(3);
                    ptdesc.CreateUser        = reader.GetString(4);
                    PTDescList.Add(ptdesc);
                }
                conn.Close();
            }
            catch (Exception ex)
            {
            }
            return(PTDescList);
        }
Ejemplo n.º 2
0
        public Boolean insertProductTestDescription(productTestDesc ptdesc)
        {
            Boolean status   = true;
            string  utString = "";

            try
            {
                DateTime cdt       = DateTime.Now;
                string   updateSQL = "insert into ProductTestDescription (TestDescriptionID,TestDescription,Status,CreateTime,CreateUser)" +
                                     "values (" +
                                     "'" + ptdesc.TestDescriptionID + "'," +
                                     "'" + ptdesc.TestDescription + "'," +
                                     ptdesc.Status + "," +
                                     "GETDATE()" + "," +
                                     "'" + Login.userLoggedIn + "'" + ")";
                utString = utString + updateSQL + Main.QueryDelimiter;
                utString = utString +
                           ActivityLogDB.PrepareActivityLogQquerString("insert", "ProductTestDescription", "", updateSQL) +
                           Main.QueryDelimiter;
                if (!UpdateTable.UT(utString))
                {
                    status = false;
                }
            }
            catch (Exception)
            {
                status = false;
            }
            return(status);
        }
Ejemplo n.º 3
0
        //public string getDocumentStatusString(int userStatus)
        //{
        //    string documentStatusString = "Unknown";
        //    try
        //    {
        //        for (int i = 0; i < Document.documentStatusValues.GetLength(0); i++)
        //        {
        //            if (Convert.ToInt32(Document.documentStatusValues[i, 0]) == userStatus)
        //            {
        //                documentStatusString = Document.documentStatusValues[i, 1];
        //                break;
        //            }
        //        }
        //    }
        //    catch (Exception)
        //    {
        //        documentStatusString = "Unknown";
        //    }
        //    return documentStatusString;
        //}



        //public int getDocumentStatusCode(string documentStatusString)
        //{
        //    int documentStatusCode = 0;
        //    try
        //    {
        //        for (int i = 0; i < Document.documentStatusValues.GetLength(0); i++)
        //        {
        //            if (Document.documentStatusValues[i, 1].Equals(documentStatusString))
        //            {
        //                documentStatusCode = Convert.ToInt32(Document.documentStatusValues[i, 0]);
        //                break;
        //            }
        //        }
        //    }
        //    catch (Exception)
        //    {
        //        documentStatusCode = 0;
        //    }
        //    return documentStatusCode;
        //}

        public Boolean updateProductTestDescription(productTestDesc ptdesc)
        {
            Boolean status   = true;
            string  utString = "";

            try
            {
                string updateSQL = "update ProductTestDescription set Status=" + ptdesc.Status + "," +
                                   "TestDescription='" + ptdesc.TestDescription + "'" +
                                   " where TestDescriptionID='" + ptdesc.TestDescriptionID + "'";
                utString = utString + updateSQL + Main.QueryDelimiter;
                utString = utString +
                           ActivityLogDB.PrepareActivityLogQquerString("update", "ProductTestDescription", "", updateSQL) +
                           Main.QueryDelimiter;
                if (!UpdateTable.UT(utString))
                {
                    status = false;
                }
            }
            catch (Exception)
            {
                status = false;
            }
            return(status);
        }
Ejemplo n.º 4
0
        public Boolean validateProductTestDescription(productTestDesc ptdesc)
        {
            Boolean status = true;

            try
            {
                if (ptdesc.TestDescriptionID.Trim().Length == 0 || ptdesc.TestDescriptionID == null)
                {
                    return(false);
                }
                if (ptdesc.TestDescription.Trim().Length == 0 || ptdesc.TestDescription == null)
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
            }

            return(status);
        }