Esempio n. 1
0
        /// <summary>
        /// 取得Defect信息
        /// </summary>
        /// <param name="defectId">Defect标识</param>
        /// <returns>Defect信息</returns>
        public DefectInfo GetDefectInfo(string defectId)
        {

            DefectInfo defectInfo = new DefectInfo();
            try
            {

                if (!String.IsNullOrEmpty(defectId))
                {
                    string sqlStr = @"SELECT Defect, Type, Descr
                                      FROM DefectCode
                                      WHERE Defect=@Defect";

                    DataTable dt = SQLHelper.ExecuteDataFill(SQLHelper.ConnectionString_CFG(),
                                               System.Data.CommandType.Text,
                                               sqlStr,
                                               SQLHelper.CreateSqlParameter("@Defect", 32, defectId));
                    foreach (DataRow dr in dt.Rows)
                    {                      
                        defectInfo.id = dr["Defect"].ToString().Trim();
                        defectInfo.friendlyName = dr["Descr"].ToString().Trim();
                        defectInfo.description = dr["Descr"].ToString().Trim();
                    }
                }
                return defectInfo;

            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 根据type,customer获取对应的Defect信息列表
        /// </summary>
        /// <param name="type">type</param>
        /// <param name="customer">customer</param>
        /// <returns>Defect信息列表</returns>
        public IList<DefectInfo> GetDefectInfoByTypeAndCustomer(string type, string customer)
        {
            IList<DefectInfo> retLst = new List<DefectInfo>(); 

            try
            {
                string sqlStr = @"SELECT Code, Description, Type
                                  FROM DefectInfo
                                  WHERE Type=@Type AND CustomerID= @CustomerID";

                DataTable dt = SQLHelper.ExecuteDataFill(SQLHelper.ConnectionString_CFG(),
                                           System.Data.CommandType.Text,
                                           sqlStr,
                                           SQLHelper.CreateSqlParameter("@Type", 32, type),
                                           SQLHelper.CreateSqlParameter("@CustomerID", 32, customer));
                foreach (DataRow dr in dt.Rows)
                {
                    DefectInfo item = new DefectInfo();
                    item.id = dr["Code"].ToString().Trim();
                    item.friendlyName = dr["Descr"].ToString().Trim();
                    item.description = dr["Descr"].ToString().Trim();
                    retLst.Add(item);
                }

                return retLst;

            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 取得Defect列表
        /// </summary>
        /// <param name="type">类型</param>
        /// <returns>Defect信息列表</returns>
        public IList<DefectInfo> GetDefectList(string type)
        {

            IList<DefectInfo> retLst = new List<DefectInfo>();

            try
            {

                if (!String.IsNullOrEmpty(type))
                {
                      string sqlStr =@"SELECT Defect, Type, Descr
                                       FROM DefectCode
                                       WHERE Type=@Type";

                    DataTable dt= SQLHelper.ExecuteDataFill(SQLHelper.ConnectionString_CFG(),
                                               System.Data.CommandType.Text,
                                               sqlStr, 
                                               SQLHelper.CreateSqlParameter("@Type",32,type));
                    foreach (DataRow dr in dt.Rows)
                    {
                        DefectInfo item = new DefectInfo();
                        item.id = dr["Defect"].ToString().Trim();
                        item.friendlyName = dr["Descr"].ToString().Trim();
                        item.description = dr["Descr"].ToString().Trim();
                        retLst.Add(item);
                    }
                }
                return retLst;
            }
            catch (Exception)
            {
                throw;
            }

        }