Beispiel #1
0
        public int UpdateDisqualification_to(EntityDisqualification_To entity, SearchParameter sp)
        {   //设置更新不合格产品临时表SQL语句
            string SqlStr = "";

            SqlStr  = "update tc_disqualification_to ";
            SqlStr += " set disqualification_to_count =  " + entity.DISQUALIFICATION_TO_COUNT + ",deal_date = '" + entity.DEAL_DATE + "',deal_address =  '" + entity.DEAL_ADDRESS.Trim() + "',issued =  '" + entity.ISSUED.Trim() + "',reamark =  '" + entity.REAMARK.Trim() + "',deal_oper =  '" + entity.DEAL_OPER.Trim() + "'";
            ArrayList arrayList = sp.Keys();

            switch (sp.GetHashTable[arrayList[0]].GetType().Name)
            {
            case "String":
                SqlStr += " where " + arrayList[0].ToString().Replace(":", "") + " like '" + sp.GetValue(arrayList[0].ToString()) + "%'";
                break;

            case "Int32":
                SqlStr += " where " + arrayList[0].ToString().Replace(":", "") + "= " + sp.GetValue(arrayList[0].ToString()) + "";
                break;

            default:
                SqlStr += " where " + arrayList[0].ToString().Replace(":", "") + " like '" + sp.GetValue(arrayList[0].ToString()) + "%'";
                break;
            }
            SqlCommand sqlCommand = new SqlCommand();

            sqlCommand.CommandText = SqlStr;
            //执行SQL语句
            ExcuteSql(sqlCommand);
            //返回操作成功结果
            return(Constants.SystemConfig.SERVER_SUCCESS);
        }
        public int InsertDisqualification_To(EntityDisqualification_To entity)
        {
            //设置插入不合格产品去向记录表SQL语句
            string SqlStr = " ";

            SqlStr  = "insert into tc_disqualification_to ";
            SqlStr += " values( " + entity.DISQUALIFICATION_CODE + ", " + entity.DISQUALIFICATION_TO_COUNT + ", '" + entity.DEAL_TYPE + "', '" + entity.DEAL_DATE + "','" + entity.DEAL_ADDRESS.Trim() + "','" + entity.ISSUED.Trim() + "','" + entity.REAMARK.Trim() + "','" + entity.DEAL_OPER.Trim() + "' )";
            SqlCommand sqlCommand = new SqlCommand();

            sqlCommand.CommandText = SqlStr;
            //执行SQL语句
            ExcuteSql(sqlCommand);
            //返回操作成功结果
            return(Constants.SystemConfig.SERVER_SUCCESS);
        }