Exemple #1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public string Update(UFIDA.U8.UAP.CustomApp.ControlForm.Model._DefectMaster model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update _DefectMaster set ");
            if (model.DefectName != null)
            {
                strSql.Append("DefectName='" + model.DefectName + "',");
            }
            int n = strSql.ToString().LastIndexOf(",");

            strSql.Remove(n, 1);
            strSql.Append(" where DefectID=" + model.DefectID + " ");
            return(strSql.ToString());
        }
Exemple #2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public string Add(UFIDA.U8.UAP.CustomApp.ControlForm.Model._DefectMaster model)
        {
            StringBuilder strSql  = new StringBuilder();
            StringBuilder strSql1 = new StringBuilder();
            StringBuilder strSql2 = new StringBuilder();

            if (model.DefectCode != null)
            {
                strSql1.Append("DefectCode,");
                strSql2.Append("'" + model.DefectCode + "',");
            }
            if (model.DefectName != null)
            {
                strSql1.Append("DefectName,");
                strSql2.Append("'" + model.DefectName + "',");
            }
            strSql.Append("insert into _DefectMaster(");
            strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
            strSql.Append(")");
            strSql.Append(" values (");
            strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
            strSql.Append(")");
            return(strSql.ToString());
        }